git.iko.soy/typeable/nixpkgs
on master help sign in
gparted: correct polkit support

Use wrapGAppsHook as well

commit7b3006478d0db846971f284ff80ea773309d9231 authorworldofpeace <worldofpeace@protonmail.ch> dateThu 8 Aug 2019, 18:39 (7 years ago) parent397c7d2
2 files changed+36−9
pkgs/tools/misc/gparted/default.nix+24−9 pkgs/tools/misc/gparted/polkit.patch+12
pkgs/tools/misc/gparted/default.nix+24−9
@@ -1,6 +1,6 @@
1−{ stdenv, fetchurl, intltool, gettext, makeWrapper
2−, parted, glib, libuuid, pkgconfig, gtkmm3, libxml2, hicolor-icon-theme
3−, gpart, hdparm, procps, utillinux
1+{ stdenv, fetchurl, intltool, gettext, makeWrapper, coreutils, gnused
2+, gnugrep, parted, glib, libuuid, pkgconfig, gtkmm3, libxml2, hicolor-icon-theme
3+, gpart, hdparm, procps, utillinux, polkit, wrapGAppsHook, substituteAll
44}:
55
66stdenv.mkDerivation rec {
@@ -11,16 +11,31 @@ stdenv.mkDerivation rec {
1111 sha256 = "0mdvn85jvy72ff7nds3dakx9kzknh8gx1z8i0w2sf970q03qp2z4";
1212 };
1313
14+ # Tries to run `pkexec --version` to get version.
15+ # however the binary won't be suid so it returns
16+ # an error preventing the program from detection
17+ patches = [
18+ (substituteAll {
19+ src = ./polkit.patch;
20+ polkit_version = polkit.version;
21+ })
22+ ];
23+
1424 configureFlags = [ "--disable-doc" ];
1525
16− buildInputs = [ parted glib libuuid gtkmm3 libxml2 hicolor-icon-theme ];
17− nativeBuildInputs = [ intltool gettext makeWrapper pkgconfig ];
26+ buildInputs = [ parted glib libuuid gtkmm3 libxml2 hicolor-icon-theme polkit.bin ];
27+ nativeBuildInputs = [ intltool gettext pkgconfig wrapGAppsHook ];
28+
29+ preFixup = ''
30+ gappsWrapperArgs+=(
31+ --prefix PATH : "${stdenv.lib.makeBinPath [ gpart hdparm utillinux procps coreutils gnused gnugrep ]}"
32+ )
33+ '';
1834
35+ # Doesn't get installed automaticallly if PREFIX != /usr
1936 postInstall = ''
20− wrapProgram $out/bin/gparted \
21− --prefix PATH : "${procps}/bin"
22− wrapProgram $out/sbin/gpartedbin \
23− --prefix PATH : "${stdenv.lib.makeBinPath [ gpart hdparm utillinux ]}"
37+ install -D -m0644 org.gnome.gparted.policy \
38+ $out/share/polkit-1/actions/org.gnome.gparted.policy
2439 '';
2540
2641 meta = with stdenv.lib; {
pkgs/tools/misc/gparted/polkit.patchnew file+12
@@ -0,0 +1,12 @@
1+diff -ru old/gparted-1.0.0/configure gparted-1.0.0/configure
2+--- old/gparted-1.0.0/configure 2019-05-29 12:02:13.000000000 -0400
3++++ gparted-1.0.0/configure 2019-08-08 18:09:52.792795781 -0400
4+@@ -16145,7 +16145,7 @@
5+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pkexec >= $PKEXEC_REQUIRED_VERSION" >&5
6+ $as_echo_n "checking for pkexec >= $PKEXEC_REQUIRED_VERSION... " >&6; }
7+ PKEXEC_REQUIRED_INT=`echo "$PKEXEC_REQUIRED_VERSION" | $AWK -F. '{print $1 * 10000 + $2}'`
8+-PKEXEC_VERSION_OUTPUT=`pkexec --version 2> /dev/null` ||
9++PKEXEC_VERSION_OUTPUT='pkexec version @polkit_version@' ||
10+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5
11+ $as_echo "not found" >&6; }
12+ if test "x$PKEXEC_VERSION_OUTPUT" != 'x'; then