2021-09-21 15:53:37 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
|
|
|
, fetchFromGitLab
|
|
|
|
, python3
|
|
|
|
, meson
|
|
|
|
, ninja
|
|
|
|
, pkg-config
|
|
|
|
, gobject-introspection
|
|
|
|
, desktop-file-utils
|
|
|
|
, shared-mime-info
|
|
|
|
, wrapGAppsHook
|
|
|
|
, glib
|
|
|
|
, gtk3
|
|
|
|
, gtk4
|
2023-06-20 15:22:19 +00:00
|
|
|
, gtksourceview4
|
2022-06-16 17:03:08 +00:00
|
|
|
, libadwaita
|
|
|
|
, libhandy
|
2023-06-20 15:22:19 +00:00
|
|
|
, webkitgtk_4_1
|
|
|
|
, webkitgtk_6_0
|
2021-09-21 15:53:37 +00:00
|
|
|
, nix-update-script
|
|
|
|
}:
|
|
|
|
|
|
|
|
python3.pkgs.buildPythonApplication rec {
|
|
|
|
pname = "cambalache";
|
2024-01-07 07:54:15 +00:00
|
|
|
version = "0.16.0";
|
2021-09-21 15:53:37 +00:00
|
|
|
|
|
|
|
format = "other";
|
|
|
|
|
2023-06-20 15:22:19 +00:00
|
|
|
# Did not fetch submodule since it is only for tests we don't run.
|
2021-09-21 15:53:37 +00:00
|
|
|
src = fetchFromGitLab {
|
|
|
|
domain = "gitlab.gnome.org";
|
|
|
|
owner = "jpu";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2024-01-07 07:54:15 +00:00
|
|
|
sha256 = "sha256-Ha94Ca5a7EUBYuSJvMrLc5895Q2/01/tbKpwlHLmTDc=";
|
2021-09-21 15:53:37 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
meson
|
|
|
|
ninja
|
|
|
|
pkg-config
|
|
|
|
gobject-introspection # for setup hook
|
|
|
|
desktop-file-utils # for update-desktop-database
|
|
|
|
shared-mime-info # for update-mime-database
|
|
|
|
wrapGAppsHook
|
|
|
|
];
|
|
|
|
|
|
|
|
pythonPath = with python3.pkgs; [
|
|
|
|
pygobject3
|
|
|
|
lxml
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
glib
|
|
|
|
gtk3
|
|
|
|
gtk4
|
2023-06-20 15:22:19 +00:00
|
|
|
gtksourceview4
|
|
|
|
webkitgtk_4_1
|
|
|
|
webkitgtk_6_0
|
2022-06-16 17:03:08 +00:00
|
|
|
# For extra widgets support.
|
|
|
|
libadwaita
|
|
|
|
libhandy
|
2021-09-21 15:53:37 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
# Prevent double wrapping.
|
|
|
|
dontWrapGApps = true;
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
patchShebangs postinstall.py
|
2022-12-29 16:40:14 +00:00
|
|
|
# those programs are used at runtime not build time
|
2023-06-20 15:22:19 +00:00
|
|
|
# https://gitlab.gnome.org/jpu/cambalache/-/blob/0.12.1/meson.build#L79-80
|
2022-12-29 16:40:14 +00:00
|
|
|
substituteInPlace ./meson.build \
|
|
|
|
--replace "find_program('broadwayd', required: true)" "" \
|
|
|
|
--replace "find_program('gtk4-broadwayd', required: true)" ""
|
2021-09-21 15:53:37 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
preFixup = ''
|
|
|
|
# Let python wrapper use GNOME flags.
|
|
|
|
makeWrapperArgs+=(
|
|
|
|
# For broadway daemons
|
|
|
|
--prefix PATH : "${lib.makeBinPath [ gtk3 gtk4 ]}"
|
|
|
|
"''${gappsWrapperArgs[@]}"
|
|
|
|
)
|
|
|
|
'';
|
|
|
|
|
|
|
|
postFixup = ''
|
|
|
|
# Wrap a helper script in an unusual location.
|
|
|
|
wrapPythonProgramsIn "$out/${python3.sitePackages}/cambalache/priv/merengue" "$out $pythonPath"
|
|
|
|
'';
|
|
|
|
|
|
|
|
passthru = {
|
2022-12-25 22:11:14 +00:00
|
|
|
updateScript = nix-update-script { };
|
2021-09-21 15:53:37 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://gitlab.gnome.org/jpu/cambalache";
|
|
|
|
description = "RAD tool for GTK 4 and 3 with data model first philosophy";
|
|
|
|
maintainers = teams.gnome.members;
|
|
|
|
license = with licenses; [
|
|
|
|
lgpl21Only # Cambalache
|
|
|
|
gpl2Only # tools
|
|
|
|
];
|
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
}
|