base16-schemes: unstable-2024-06-21 -> unstable-2024-11-12
[NixPkgs.git] / pkgs / by-name / ge / gearlever / package.nix
blob4530bddb2e99b99207c28338bcd5a00ba8c66498
2   lib,
3   python3Packages,
4   fetchFromGitHub,
5   stdenv,
6   meson,
7   ninja,
8   pkg-config,
9   gobject-introspection,
10   wrapGAppsHook4,
11   desktop-file-utils,
12   libadwaita,
13   file,
14   p7zip,
15   which,
16   appimage-run,
17   gtk4,
18   bintools,
19   libnotify,
22 python3Packages.buildPythonApplication rec {
23   pname = "gearlever";
24   version = "2.1.0";
25   pyproject = false; # Built with meson
27   src = fetchFromGitHub {
28     owner = "mijorus";
29     repo = "gearlever";
30     rev = "refs/tags/${version}";
31     hash = "sha256-OpNzJwEjLni/vG1RtRSH29wovMRwKzJn+Vep1vZDEFM=";
32   };
34   postPatch =
35     # https://github.com/NixOS/nixpkgs/issues/302605
36     # But since the author only builds on flatpak, we don't expect much on it...
37     ''
38       substituteInPlace build-aux/meson/postinstall.py \
39         --replace-fail 'gtk-update-icon-cache' 'gtk4-update-icon-cache'
40     ''
41     # Use gtk4 instead of gtk3 to get smaller closure size
42     + ''
43       substituteInPlace src/providers/AppImageProvider.py \
44         --replace-fail "gtk-launch" "gtk4-launch"
45     ''
46     # We don't have `arch` in coreutils, so just return a string in advance
47     + ''
48       substituteInPlace src/AppDetails.py \
49         --replace-fail "sandbox_sh(['arch'])" '"${stdenv.hostPlatform.uname.processor}"'
50     '';
52   nativeBuildInputs = [
53     meson
54     ninja
55     pkg-config
56     gobject-introspection
57     wrapGAppsHook4
58     desktop-file-utils
59   ];
61   buildInputs = [ libadwaita ];
63   dependencies = with python3Packages; [
64     pygobject3
65     dbus-python
66     pyxdg
67     requests
68   ];
70   dontWrapGApps = true;
72   makeWrapperArgs = [
73     "\${gappsWrapperArgs[@]}"
74     "--prefix PATH : ${
75       lib.makeBinPath [
76         file
77         p7zip
78         which
79         appimage-run
80         desktop-file-utils # update-desktop-database
81         gtk4.dev # gtk4-launch
82         bintools # readelf
83         libnotify # notify-send
84       ]
85     }"
86   ];
88   meta = {
89     description = "Manage AppImages with ease";
90     longDescription = ''
91       Features:
93       - Integrate AppImages into your app menu with just one click
94       - Drag and drop files directly from your file manager
95       - Keep all the AppImages organized in a custom folder
96       - Open new AppImages directly with Gear lever
97       - Manage updates: keep older versions installed or replace
98         them with the latest release
99       - Save CLI apps with their executable name automatically
100       - Modern and Fresh UI
101     '';
102     homepage = "https://mijorus.it/projects/gearlever";
103     license = with lib.licenses; [
104       gpl3Plus
105       cc0
106     ];
107     mainProgram = "gearlever";
108     maintainers = with lib.maintainers; [ aleksana ];
109     platforms = lib.platforms.linux;
110   };