gparted: correct polkit support

Use wrapGAppsHook as well

+36 -9
+24 -9
pkgs/tools/misc/gparted/default.nix
··· 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 4 4 }: 5 5 6 6 stdenv.mkDerivation rec { ··· 11 11 sha256 = "0mdvn85jvy72ff7nds3dakx9kzknh8gx1z8i0w2sf970q03qp2z4"; 12 12 }; 13 13 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 + 14 24 configureFlags = [ "--disable-doc" ]; 15 25 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 ]; 18 28 29 + preFixup = '' 30 + gappsWrapperArgs+=( 31 + --prefix PATH : "${stdenv.lib.makeBinPath [ gpart hdparm utillinux procps coreutils gnused gnugrep ]}" 32 + ) 33 + ''; 34 + 35 + # Doesn't get installed automaticallly if PREFIX != /usr 19 36 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 24 39 ''; 25 40 26 41 meta = with stdenv.lib; {
+12
pkgs/tools/misc/gparted/polkit.patch
··· 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