forgejo-lts: 7.0.10 -> 7.0.11
[NixPkgs.git] / pkgs / by-name / tu / turtle / package.nix
blob2bf54ee525fd57319f837681b1ca9490f38392d9
2   lib,
3   python3Packages,
4   fetchFromGitLab,
5   gobject-introspection,
6   wrapGAppsHook4,
7   libadwaita,
8 }:
10 python3Packages.buildPythonApplication rec {
11   pname = "turtle";
12   version = "0.10";
13   pyproject = true;
15   src = fetchFromGitLab {
16     domain = "gitlab.gnome.org";
17     owner = "philippun1";
18     repo = "turtle";
19     rev = version;
20     hash = "sha256-hWjxNAf0qy/aJ4Y7nLA5m69k3mEn3/1XaJ58aHQrWug=";
21   };
23   postPatch = ''
24     substituteInPlace ./install.py \
25       --replace-fail "/usr" "$out" \
26       --replace-fail "gtk-update-icon-cache" "gtk4-update-icon-cache"
27   '';
29   nativeBuildInputs = [
30     gobject-introspection
31     wrapGAppsHook4
32   ];
34   buildInputs = [ libadwaita ];
36   build-system = with python3Packages; [ setuptools ];
38   dependencies = with python3Packages; [
39     pygobject3
40     pygit2
41     secretstorage
42     dbus-python
43   ];
45   postInstall = ''
46     python ./install.py install
47   '';
49   # Avoid wrapping two times
50   dontWrapGApps = true;
52   # Make sure we patch other scripts after wrapper is generated
53   # to get $program_PYTHONPATH
54   dontWrapPythonPrograms = true;
56   postFixup =
57     ''
58       makeWrapperArgs+=(''${gappsWrapperArgs[@]})
59       wrapPythonPrograms
60     ''
61     # Dialogs are not imported, but executed. The same does
62     # nautilus-python plugins. So we need to patch them as well.
63     + ''
64       for dialog_scripts in $out/lib/python*/site-packages/turtlevcs/dialogs/*.py; do
65         patchPythonScript $dialog_scripts
66       done
67       for nautilus_extensions in $out/share/nautilus-python/extensions/*.py; do
68         patchPythonScript $nautilus_extensions
69       done
70     '';
72   meta = {
73     description = "Graphical interface for version control intended to run on gnome and nautilus";
74     homepage = "https://gitlab.gnome.org/philippun1/turtle";
75     license = lib.licenses.gpl3Plus;
76     mainProgram = "turtle_cli";
77     maintainers = with lib.maintainers; [ aleksana ];
78     platforms = lib.platforms.unix;
79   };