summary refs log tree commit diff
path: root/pkgs/tools/misc
diff options
context:
space:
mode:
authorFrederik Rietdijk <fridh@fridh.nl>2019-08-17 09:39:23 +0200
committerFrederik Rietdijk <fridh@fridh.nl>2019-08-17 09:39:23 +0200
commitfe9a3e3e63fa59c8014d454b0efd3231bdd19350 (patch)
tree3546e83902366b34599e8d5f6a698e37935a104d /pkgs/tools/misc
parented3cb39bfa7234e5bbf2b50ce6f658ef5fda686a (diff)
parentc68f58d95c0e34d91ff3e4f08464954fd0e9e466 (diff)
downloadnixpkgs-fe9a3e3e63fa59c8014d454b0efd3231bdd19350.tar
nixpkgs-fe9a3e3e63fa59c8014d454b0efd3231bdd19350.tar.gz
nixpkgs-fe9a3e3e63fa59c8014d454b0efd3231bdd19350.tar.bz2
nixpkgs-fe9a3e3e63fa59c8014d454b0efd3231bdd19350.tar.lz
nixpkgs-fe9a3e3e63fa59c8014d454b0efd3231bdd19350.tar.xz
nixpkgs-fe9a3e3e63fa59c8014d454b0efd3231bdd19350.tar.zst
nixpkgs-fe9a3e3e63fa59c8014d454b0efd3231bdd19350.zip
Merge staging-next into staging
Diffstat (limited to 'pkgs/tools/misc')
-rw-r--r--pkgs/tools/misc/coreutils/avoid-false-positive-in-date-debug-test.patch52
-rw-r--r--pkgs/tools/misc/coreutils/default.nix13
-rw-r--r--pkgs/tools/misc/gparted/default.nix33
-rw-r--r--pkgs/tools/misc/gparted/polkit.patch12
-rw-r--r--pkgs/tools/misc/noti/default.nix22
-rw-r--r--pkgs/tools/misc/pazi/cargo-lock.patch8
-rw-r--r--pkgs/tools/misc/pazi/default.nix10
7 files changed, 118 insertions, 32 deletions
diff --git a/pkgs/tools/misc/coreutils/avoid-false-positive-in-date-debug-test.patch b/pkgs/tools/misc/coreutils/avoid-false-positive-in-date-debug-test.patch
new file mode 100644
index 00000000000..ae1a02d4d20
--- /dev/null
+++ b/pkgs/tools/misc/coreutils/avoid-false-positive-in-date-debug-test.patch
@@ -0,0 +1,52 @@
+From 0251229bfd9617e8a35cf9dd7d338d63fff74a0c Mon Sep 17 00:00:00 2001
+From: Assaf Gordon <assafgordon@gmail.com>
+Date: Mon, 13 May 2019 16:37:40 -0600
+Subject: [PATCH] tests: avoid false-positive in date-debug test
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+When debugging an invalid date due to DST switching, the intermediate
+'normalized time' should not be checked - its value can differ between
+systems (e.g. glibc vs musl).
+
+Reported by Niklas Hambüchen in
+https://lists.gnu.org/r/coreutils/2019-05/msg00031.html
+Analyzed by Rich Felker in
+https://lists.gnu.org/r/coreutils/2019-05/msg00039.html
+
+* tests/misc/date-debug.sh: Replace the exact normalized time
+with 'XX:XX:XX' so different values would not trigger test failure.
+---
+ tests/misc/date-debug.sh | 11 +++++++++--
+ 1 file changed, 9 insertions(+), 2 deletions(-)
+
+diff --git a/tests/misc/date-debug.sh b/tests/misc/date-debug.sh
+index aa47f1abb..2ce6f4ce8 100755
+--- a/tests/misc/date-debug.sh
++++ b/tests/misc/date-debug.sh
+@@ -71,7 +71,7 @@ date: input timezone: TZ="America/Edmonton" in date string
+ date: using specified time as starting value: '02:30:00'
+ date: error: invalid date/time value:
+ date:     user provided time: '(Y-M-D) 2006-04-02 02:30:00'
+-date:        normalized time: '(Y-M-D) 2006-04-02 03:30:00'
++date:        normalized time: '(Y-M-D) 2006-04-02 XX:XX:XX'
+ date:                                             --
+ date:      possible reasons:
+ date:        non-existing due to daylight-saving time;
+@@ -81,7 +81,14 @@ date: invalid date 'TZ="America/Edmonton" 2006-04-02 02:30:00'
+ EOF
+ 
+ # date should return 1 (error) for invalid date
+-returns_ 1 date --debug -d "$in2" >out2 2>&1 || fail=1
++returns_ 1 date --debug -d "$in2" >out2-t 2>&1 || fail=1
++
++# The output line of "normalized time" can differ between systems
++# (e.g. glibc vs musl) and should not be checked.
++# See: https://lists.gnu.org/archive/html/coreutils/2019-05/msg00039.html
++sed '/normalized time:/s/ [0-9][0-9]:[0-9][0-9]:[0-9][0-9]/ XX:XX:XX/' \
++    out2-t > out2 || framework_failure_
++
+ compare exp2 out2 || fail=1
+ 
+ ##
diff --git a/pkgs/tools/misc/coreutils/default.nix b/pkgs/tools/misc/coreutils/default.nix
index c80bb64d0bb..cbe97dda9e5 100644
--- a/pkgs/tools/misc/coreutils/default.nix
+++ b/pkgs/tools/misc/coreutils/default.nix
@@ -25,6 +25,9 @@ stdenv.mkDerivation rec {
   };
 
   patches = optional stdenv.hostPlatform.isCygwin ./coreutils-8.23-4.cygwin.patch
+         # Fix failing test with musl. See https://lists.gnu.org/r/coreutils/2019-05/msg00031.html
+         # To be removed in coreutils-8.32.
+         ++ optional stdenv.hostPlatform.isMusl ./avoid-false-positive-in-date-debug-test.patch
          # Fix compilation in musl-cross environments. To be removed in coreutils-8.32.
          ++ optional stdenv.hostPlatform.isMusl ./coreutils-8.31-musl-cross.patch;
 
@@ -54,10 +57,12 @@ stdenv.mkDerivation rec {
     for f in gnulib-tests/{test-chown.c,test-fchownat.c,test-lchown.c}; do
       echo "int main() { return 77; }" > "$f"
     done
-  '' + optionalString (stdenv.hostPlatform.libc == "musl") ''
-    echo "int main() { return 77; }" > gnulib-tests/test-parse-datetime.c
-    echo "int main() { return 77; }" > gnulib-tests/test-getlogin.c
-  '';
+  '' + optionalString (stdenv.hostPlatform.libc == "musl") (lib.concatStringsSep "\n" [
+    ''
+      echo "int main() { return 77; }" > gnulib-tests/test-parse-datetime.c
+      echo "int main() { return 77; }" > gnulib-tests/test-getlogin.c
+    ''
+  ]);
 
   outputs = [ "out" "info" ];
 
diff --git a/pkgs/tools/misc/gparted/default.nix b/pkgs/tools/misc/gparted/default.nix
index 6834a555e4d..49a2809b604 100644
--- a/pkgs/tools/misc/gparted/default.nix
+++ b/pkgs/tools/misc/gparted/default.nix
@@ -1,6 +1,6 @@
-{ stdenv, fetchurl, intltool, gettext, makeWrapper
-, parted, glib, libuuid, pkgconfig, gtkmm3, libxml2, hicolor-icon-theme
-, gpart, hdparm, procps, utillinux
+{ stdenv, fetchurl, intltool, gettext, makeWrapper, coreutils, gnused, gnome3
+, gnugrep, parted, glib, libuuid, pkgconfig, gtkmm3, libxml2, hicolor-icon-theme
+, gpart, hdparm, procps, utillinux, polkit, wrapGAppsHook, substituteAll
 }:
 
 stdenv.mkDerivation rec {
@@ -11,16 +11,31 @@ stdenv.mkDerivation rec {
     sha256 = "0mdvn85jvy72ff7nds3dakx9kzknh8gx1z8i0w2sf970q03qp2z4";
   };
 
+  # Tries to run `pkexec --version` to get version.
+  # however the binary won't be suid so it returns
+  # an error preventing the program from detection
+  patches = [
+    (substituteAll {
+      src = ./polkit.patch;
+      polkit_version = polkit.version;
+    })
+  ];
+
   configureFlags = [ "--disable-doc" ];
 
-  buildInputs = [ parted glib libuuid gtkmm3 libxml2 hicolor-icon-theme ];
-  nativeBuildInputs = [ intltool gettext makeWrapper pkgconfig ];
+  buildInputs = [ parted glib libuuid gtkmm3 libxml2 hicolor-icon-theme polkit.bin gnome3.adwaita-icon-theme  ];
+  nativeBuildInputs = [ intltool gettext pkgconfig wrapGAppsHook ];
+
+  preFixup = ''
+    gappsWrapperArgs+=(
+       --prefix PATH : "${stdenv.lib.makeBinPath [ gpart hdparm utillinux procps coreutils gnused gnugrep ]}"
+    )
+  '';
 
+  # Doesn't get installed automaticallly if PREFIX != /usr
   postInstall = ''
-    wrapProgram $out/bin/gparted \
-      --prefix PATH : "${procps}/bin"
-    wrapProgram $out/sbin/gpartedbin \
-      --prefix PATH : "${stdenv.lib.makeBinPath [ gpart hdparm utillinux ]}"
+    install -D -m0644 org.gnome.gparted.policy \
+      $out/share/polkit-1/actions/org.gnome.gparted.policy
   '';
 
   meta = with stdenv.lib; {
diff --git a/pkgs/tools/misc/gparted/polkit.patch b/pkgs/tools/misc/gparted/polkit.patch
new file mode 100644
index 00000000000..a42ed785de9
--- /dev/null
+++ b/pkgs/tools/misc/gparted/polkit.patch
@@ -0,0 +1,12 @@
+diff -ru old/gparted-1.0.0/configure gparted-1.0.0/configure
+--- old/gparted-1.0.0/configure	2019-05-29 12:02:13.000000000 -0400
++++ gparted-1.0.0/configure	2019-08-08 18:09:52.792795781 -0400
+@@ -16145,7 +16145,7 @@
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pkexec >= $PKEXEC_REQUIRED_VERSION" >&5
+ $as_echo_n "checking for pkexec >= $PKEXEC_REQUIRED_VERSION... " >&6; }
+ PKEXEC_REQUIRED_INT=`echo "$PKEXEC_REQUIRED_VERSION" | $AWK -F. '{print $1 * 10000 + $2}'`
+-PKEXEC_VERSION_OUTPUT=`pkexec --version 2> /dev/null` ||
++PKEXEC_VERSION_OUTPUT='pkexec version @polkit_version@' ||
+ 	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5
+ $as_echo "not found" >&6; }
+ if test "x$PKEXEC_VERSION_OUTPUT" != 'x'; then
diff --git a/pkgs/tools/misc/noti/default.nix b/pkgs/tools/misc/noti/default.nix
index bfe674d2f5c..74b1f96fad8 100644
--- a/pkgs/tools/misc/noti/default.nix
+++ b/pkgs/tools/misc/noti/default.nix
@@ -1,19 +1,20 @@
-{ stdenv, buildGoPackage, fetchFromGitHub, Cocoa }:
+{ stdenv, lib, buildGoPackage, fetchFromGitHub
+, Cocoa ? null }:
 
 buildGoPackage rec {
   pname = "noti";
-  version = "3.1.0";
+  version = "3.2.0";
 
   src = fetchFromGitHub {
     owner = "variadico";
     repo = "noti";
-    rev = "${version}";
-    sha256 = "1chsqfqk0pnhx5k2nr4c16cpb8m6zv69l1jvv4v4903zgfzcm823";
+    rev = version;
+    sha256 = "1lw1wmw2m83m0s5znb4gliywjpg74qrhrj6rwpcb5p352c4vbwxs";
   };
 
-  buildInputs = stdenv.lib.optionals stdenv.isDarwin [ Cocoa ];
+  buildInputs = lib.optional stdenv.isDarwin Cocoa;
   # TODO: Remove this when we update apple_sdk
-  NIX_CFLAGS_COMPILE = stdenv.lib.optionals stdenv.isDarwin [ "-fno-objc-arc" ];
+  NIX_CFLAGS_COMPILE = lib.optional stdenv.isDarwin "-fno-objc-arc";
 
   goPackagePath = "github.com/variadico/noti";
 
@@ -22,12 +23,11 @@ buildGoPackage rec {
   '';
 
   postInstall = ''
-    mkdir -p $out/share/man/man{1,5}/
-    cp $src/docs/man/noti.1      $out/share/man/man1/
-    cp $src/docs/man/noti.yaml.5 $out/share/man/man5/
+    install -Dm444 -t $out/share/man/man1 $src/docs/man/*.1
+    install -Dm444 -t $out/share/man/man5 $src/docs/man/*.5
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Monitor a process and trigger a notification.";
     longDescription = ''
       Monitor a process and trigger a notification.
@@ -36,7 +36,7 @@ buildGoPackage rec {
     '';
     homepage = https://github.com/variadico/noti;
     license = licenses.mit;
-    maintainers = [ maintainers.stites ];
+    maintainers = with maintainers; [ stites ];
     platforms = platforms.all;
   };
 }
diff --git a/pkgs/tools/misc/pazi/cargo-lock.patch b/pkgs/tools/misc/pazi/cargo-lock.patch
index 4be7aa44c9c..3abc3f0a2f8 100644
--- a/pkgs/tools/misc/pazi/cargo-lock.patch
+++ b/pkgs/tools/misc/pazi/cargo-lock.patch
@@ -6,8 +6,8 @@ index 074b0ca..22f3bc5 100644
  
  [[package]]
  name = "pazi"
--version = "0.1.0"
-+version = "0.2.0"
+-version = "0.2.0"
++version = "0.3.0"
  dependencies = [
-  "clap 2.32.0 (registry+https://github.com/rust-lang/crates.io-index)",
-  "crossbeam-channel 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)",
+  "clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)",
+  "crossbeam-channel 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
diff --git a/pkgs/tools/misc/pazi/default.nix b/pkgs/tools/misc/pazi/default.nix
index 48c248ad205..325ac044552 100644
--- a/pkgs/tools/misc/pazi/default.nix
+++ b/pkgs/tools/misc/pazi/default.nix
@@ -1,17 +1,19 @@
-{ stdenv, fetchFromGitHub, rustPlatform }:
+{ stdenv, fetchFromGitHub, rustPlatform, darwin }:
 
 rustPlatform.buildRustPackage rec {
   pname = "pazi";
-  version = "0.2.0";
+  version = "0.3.0";
 
   src = fetchFromGitHub {
     owner = "euank";
     repo = pname;
     rev = "v${version}";
-    sha256 = "12z2vyzmyxfq1krbbrjar7c2gvyq1969v16pb2pm7f4g4k24g0c8";
+    sha256 = "1gnh6047hacavcb9bhps9d1zjns66rdbd158fw20kjp1lln5srrn";
   };
 
-  cargoSha256 = "1w97jvlamxlxkqpim5iyayhbsqvg3rqds2nxq1fk5imj4hbi3681";
+  buildInputs = stdenv.lib.optionals stdenv.isDarwin [ darwin.apple_sdk.frameworks.Security ];
+
+  cargoSha256 = "15s03vwgl6562n5h9r4d5kp2r168jakn5nwnyibmrs8r5q0idmjs";
 
   cargoPatches = [ ./cargo-lock.patch ];