about summary refs log tree commit diff
path: root/nixpkgs/pkgs/desktops/gnome/apps/file-roller/default.nix
blob: c4c489dae08e08e69d5ff41eb25b4d842b74f0df (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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
{ lib
, stdenv
, fetchurl
, fetchpatch
, desktop-file-utils
, gettext
, glibcLocales
, itstool
, libxml2
, meson
, ninja
, pkg-config
, python3
, wrapGAppsHook
, cpio
, file
, glib
, gnome
, gtk3
, json-glib
, libarchive
, libnotify
, nautilus
, pantheon
, unzip
, withPantheon ? false
}:

stdenv.mkDerivation rec {
  pname = "file-roller";
  version = "3.40.0";

  src = fetchurl {
    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
    sha256 = "039w1dcpa5ypmv6sm634alk9vbcdkyvy595vkh5gn032jsiqca2a";
  };

  patches = lib.optionals withPantheon [
    # Make this respect dark mode settings from Pantheon
    # https://github.com/elementary/fileroller/
    (fetchpatch {
      url = "https://raw.githubusercontent.com/elementary/fileroller/f183eac36c68c9c9441e72294d4e305cf5fe36ed/fr-application-prefers-color-scheme.patch";
      sha256 = "sha256-d/sqf4Oen9UrzYqru7Ck15o/6g6WfxRDH/iAGFXgYAA=";
    })
  ];

  LANG = "en_US.UTF-8"; # postinstall.py

  nativeBuildInputs = [
    desktop-file-utils
    gettext
    glibcLocales
    itstool
    libxml2
    meson
    ninja
    pkg-config
    python3
    wrapGAppsHook
  ];

  buildInputs = [
    cpio
    file
    glib
    gnome.adwaita-icon-theme
    gtk3
    json-glib
    libarchive
    libnotify
    nautilus
  ] ++ lib.optionals withPantheon [
    pantheon.granite
  ];

  PKG_CONFIG_LIBNAUTILUS_EXTENSION_EXTENSIONDIR = "${placeholder "out"}/lib/nautilus/extensions-3.0";

  postPatch = ''
    chmod +x postinstall.py # patchShebangs requires executable file
    patchShebangs postinstall.py
    patchShebangs data/set-mime-type-entry.py
  '';

  preFixup = ''
    # Workaround because of https://gitlab.gnome.org/GNOME/file-roller/issues/40
    gappsWrapperArgs+=(
      --prefix PATH : ${lib.makeBinPath [ unzip ]}
    )
  '';

  passthru = {
    updateScript = gnome.updateScript {
      packageName = "file-roller";
      attrPath = "gnome.file-roller";
    };
  };

  meta = with lib; {
    homepage = "https://wiki.gnome.org/Apps/FileRoller";
    description = "Archive manager for the GNOME desktop environment";
    license = licenses.gpl2Plus;
    platforms = platforms.linux;
    maintainers = teams.gnome.members ++ teams.pantheon.members;
  };
}