summary refs log tree commit diff
path: root/pkgs/tools
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/tools')
-rw-r--r--pkgs/tools/X11/xkbvalidate/default.nix6
-rw-r--r--pkgs/tools/X11/xkbvalidate/xkbvalidate.c21
-rw-r--r--pkgs/tools/backup/s3ql/default.nix22
-rw-r--r--pkgs/tools/filesystems/apfs-fuse/default.nix26
-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
-rw-r--r--pkgs/tools/networking/mtr/default.nix4
-rw-r--r--pkgs/tools/system/inxi/default.nix4
13 files changed, 182 insertions, 51 deletions
diff --git a/pkgs/tools/X11/xkbvalidate/default.nix b/pkgs/tools/X11/xkbvalidate/default.nix
index f5a26410835..92a47aa6563 100644
--- a/pkgs/tools/X11/xkbvalidate/default.nix
+++ b/pkgs/tools/X11/xkbvalidate/default.nix
@@ -5,11 +5,11 @@ runCommandCC "xkbvalidate" {
   meta = {
     description = "NixOS tool to validate X keyboard configuration";
     license = lib.licenses.mit;
-    platforms = lib.platforms.linux;
+    platforms = lib.platforms.unix;
     maintainers = [ lib.maintainers.aszlig ];
   };
 } ''
   mkdir -p "$out/bin"
-  gcc -std=gnu11 -Wall -pedantic -lxkbcommon ${./xkbvalidate.c} \
-    -o "$out/bin/validate"
+  $CC -std=c11 -Wall -pedantic -lxkbcommon ${./xkbvalidate.c} \
+    -o "$out/bin/xkbvalidate"
 ''
diff --git a/pkgs/tools/X11/xkbvalidate/xkbvalidate.c b/pkgs/tools/X11/xkbvalidate/xkbvalidate.c
index d9c9042467c..d25eef154b3 100644
--- a/pkgs/tools/X11/xkbvalidate/xkbvalidate.c
+++ b/pkgs/tools/X11/xkbvalidate/xkbvalidate.c
@@ -1,4 +1,3 @@
-#define _GNU_SOURCE
 #include <stdarg.h>
 #include <stdbool.h>
 #include <stdio.h>
@@ -14,6 +13,9 @@ static bool log_alloc_success = true;
 static void add_log(struct xkb_context *ctx, enum xkb_log_level level,
                     const char *fmt, va_list args)
 {
+    size_t buflen;
+    va_list tmpargs;
+
     log_buffer_size++;
 
     if (log_buffer == NULL)
@@ -28,11 +30,24 @@ static void add_log(struct xkb_context *ctx, enum xkb_log_level level,
         return;
     }
 
-    if (vasprintf(&log_buffer[log_buffer_size - 1], fmt, args) == -1) {
+    /* Unfortunately, vasprintf() is a GNU extension and thus not very
+     * portable, so let's first get the required buffer size using a dummy
+     * vsnprintf and afterwards allocate the returned amount of bytes.
+     *
+     * We also need to make a copy of the args, because the value of the args
+     * will be indeterminate after the return.
+     */
+    va_copy(tmpargs, args);
+    buflen = vsnprintf(NULL, 0, fmt, tmpargs);
+    va_end(tmpargs);
+
+    log_buffer[log_buffer_size - 1] = malloc(++buflen);
+
+    if (vsnprintf(log_buffer[log_buffer_size - 1], buflen, fmt, args) == -1) {
         perror("log line alloc");
         log_alloc_success = false;
-        return;
     }
+    va_end(args);
 }
 
 static void print_logs(void)
diff --git a/pkgs/tools/backup/s3ql/default.nix b/pkgs/tools/backup/s3ql/default.nix
index 1bd8ebfd44b..b71f032bd7a 100644
--- a/pkgs/tools/backup/s3ql/default.nix
+++ b/pkgs/tools/backup/s3ql/default.nix
@@ -1,33 +1,35 @@
-{ stdenv, fetchurl, python3Packages, sqlite, which }:
+{ stdenv, fetchFromGitHub, python3Packages, sqlite, which }:
 
 python3Packages.buildPythonApplication rec {
-  name = "${pname}-${version}";
   pname = "s3ql";
-  version = "2.26";
+  version = "3.2";
 
-  src = fetchurl {
-    url = "https://bitbucket.org/nikratio/${pname}/downloads/${name}.tar.bz2";
-    sha256 = "0xs1jbak51zwjrd6jmd96xl3a3jpw0p1s05f7sw5wipvvg0xnmfn";
+  src = fetchFromGitHub {
+    owner = pname;
+    repo = pname;
+    rev = "release-${version}";
+    sha256 = "01ky0jc1s3w9dry5siz9b69jf2maiargz99axgxvyihap0d7qs52";
   };
 
-  buildInputs = [ which ]; # tests will fail without which
+  checkInputs = [ which ] ++ (with python3Packages; [ cython pytest ]);
   propagatedBuildInputs = with python3Packages; [
     sqlite apsw pycrypto requests defusedxml dugong llfuse
-    cython pytest pytest-catchlog
+    cython pytest pytest-catchlog google_auth google-auth-oauthlib
   ];
 
   preBuild = ''
-    # https://bitbucket.org/nikratio/s3ql/issues/118/no-module-named-s3qldeltadump-running#comment-16951851
     ${python3Packages.python.interpreter} ./setup.py build_cython build_ext --inplace
   '';
 
   checkPhase = ''
+    # Removing integration tests
+    rm tests/t{4,5,6}_*
     pytest tests
   '';
 
   meta = with stdenv.lib; {
     description = "A full-featured file system for online data storage";
-    homepage = https://bitbucket.org/nikratio/s3ql;
+    homepage = "https://github.com/s3ql/s3ql/";
     license = licenses.gpl3;
     maintainers = with maintainers; [ rushmorem ];
     platforms = platforms.linux;
diff --git a/pkgs/tools/filesystems/apfs-fuse/default.nix b/pkgs/tools/filesystems/apfs-fuse/default.nix
new file mode 100644
index 00000000000..9ee0b813326
--- /dev/null
+++ b/pkgs/tools/filesystems/apfs-fuse/default.nix
@@ -0,0 +1,26 @@
+{ stdenv, fetchFromGitHub, fuse3, bzip2, zlib, attr, cmake }:
+
+stdenv.mkDerivation rec {
+  pname = "apfs-fuse-unstable";
+  version = "2019-07-23";
+
+  src = fetchFromGitHub {
+    owner  = "sgan81";
+    repo   = "apfs-fuse";
+    rev    = "309ecb030f38edac4c10fa741a004c5eb7a23e15";
+    sha256 = "0wq6rlqi00m5dp5gbzy65i1plm40j6nsm7938zvfgx5laal4wzr2";
+    fetchSubmodules = true;
+  };
+
+  buildInputs = [ fuse3 bzip2 zlib attr ];
+  nativeBuildInputs = [ cmake ];
+
+  meta = with stdenv.lib; {
+    homepage    = "https://github.com/sgan81/apfs-fuse";
+    description = "FUSE driver for APFS (Apple File System)";
+    license     = licenses.gpl2;
+    maintainers = with maintainers; [ ealasu ];
+    platforms   = platforms.linux;
+  };
+
+}
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 ];
 
diff --git a/pkgs/tools/networking/mtr/default.nix b/pkgs/tools/networking/mtr/default.nix
index 59242551f92..d00e3737237 100644
--- a/pkgs/tools/networking/mtr/default.nix
+++ b/pkgs/tools/networking/mtr/default.nix
@@ -30,7 +30,9 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ autoreconfHook pkgconfig ];
 
-  buildInputs = [ libcap ncurses ] ++ stdenv.lib.optional withGtk gtk2;
+  buildInputs = [ ncurses ]
+    ++ stdenv.lib.optional withGtk gtk2
+    ++ stdenv.lib.optional stdenv.isLinux libcap;
 
   enableParallelBuilding = true;
 
diff --git a/pkgs/tools/system/inxi/default.nix b/pkgs/tools/system/inxi/default.nix
index 52d091073c0..3c1e3e79862 100644
--- a/pkgs/tools/system/inxi/default.nix
+++ b/pkgs/tools/system/inxi/default.nix
@@ -2,13 +2,13 @@
 
 stdenv.mkDerivation rec {
   pname = "inxi";
-  version = "3.0.35-1";
+  version = "3.0.36-1";
 
   src = fetchFromGitHub {
     owner = "smxi";
     repo = "inxi";
     rev = version;
-    sha256 = "1rvidz2b9zp3ikkcjf8zr5r8r9mxnw3zgly2pvlim11kkp76zdl9";
+    sha256 = "04134l323vwd0g2bffj11rnpw2jgs9la6aqrmv8vh7w9mq5nd57y";
   };
 
   buildInputs = [ perl ];