about summary refs log tree commit diff
path: root/pkgs/by-name/me/menulibre/package.nix
blob: 134c7cc98cc90e6f28f17d95a93475be31ab812b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
{ lib
, fetchFromGitHub
, python3Packages
, gnome-menus
, gtk3
, intltool
, gobject-introspection
, wrapGAppsHook
, nix-update-script
, testers
, menulibre
}:

python3Packages.buildPythonApplication rec {
  name = "menulibre";
  version = "2.4.0";

  src = fetchFromGitHub {
    owner = "bluesabre";
    repo = "menulibre";
    rev = "menulibre-${version}";
    hash = "sha256-IfsuOYP/H3r1GDWMVVSBfYvQS+01VJaAlZu+c05geWg=";
  };

  propagatedBuildInputs = with python3Packages; [
    pygobject3
    gnome-menus
    psutil
    distutils-extra
  ];

  nativeBuildInputs = [
    gtk3
    intltool
    gobject-introspection
    wrapGAppsHook
  ];

  postPatch = ''
    substituteInPlace setup.py \
      --replace-fail 'data_dir =' "data_dir = '$out/share/menulibre' #" \
      --replace-fail 'update_desktop_file(desktop_file, script_path)' ""
  '';

  preBuild = ''
    export HOME=$TMPDIR
  '';

  passthru = {
    updateScript = nix-update-script { };
    tests.version = testers.testVersion {
      package = menulibre;
      command = "HOME=$TMPDIR menulibre --version | cut -d' ' -f2";
    };
  };

  meta = with lib; {
    description = "An advanced menu editor with an easy-to-use interface";
    homepage = "https://bluesabre.org/projects/menulibre";
    license = licenses.gpl3Plus;
    maintainers = with maintainers; [ lelgenio ];
    mainProgram = "menulibre";
    platforms = platforms.linux;
  };
}