summary refs log tree commit diff
path: root/pkgs/tools/misc/rmlint
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2021-08-04 10:43:07 +0000
committerAlyssa Ross <hi@alyssa.is>2021-08-04 10:43:07 +0000
commit62614cbef7da005c1eda8c9400160f6bcd6546b8 (patch)
treec2630f69080637987b68acb1ee8676d2681fe304 /pkgs/tools/misc/rmlint
parentd9c82ed3044c72cecf01c6ea042489d30914577c (diff)
parente24069138dfec3ef94f211f1da005bb5395adc11 (diff)
downloadnixpkgs-62614cbef7da005c1eda8c9400160f6bcd6546b8.tar
nixpkgs-62614cbef7da005c1eda8c9400160f6bcd6546b8.tar.gz
nixpkgs-62614cbef7da005c1eda8c9400160f6bcd6546b8.tar.bz2
nixpkgs-62614cbef7da005c1eda8c9400160f6bcd6546b8.tar.lz
nixpkgs-62614cbef7da005c1eda8c9400160f6bcd6546b8.tar.xz
nixpkgs-62614cbef7da005c1eda8c9400160f6bcd6546b8.tar.zst
nixpkgs-62614cbef7da005c1eda8c9400160f6bcd6546b8.zip
Merge branch 'nixpkgs-update' into master
Diffstat (limited to 'pkgs/tools/misc/rmlint')
-rw-r--r--pkgs/tools/misc/rmlint/default.nix45
1 files changed, 28 insertions, 17 deletions
diff --git a/pkgs/tools/misc/rmlint/default.nix b/pkgs/tools/misc/rmlint/default.nix
index 936c78b695d..8211c5aebc7 100644
--- a/pkgs/tools/misc/rmlint/default.nix
+++ b/pkgs/tools/misc/rmlint/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , cairo
 , fetchFromGitHub
 , gettext
@@ -9,16 +9,18 @@
 , libelf
 , makeWrapper
 , pango
-, pkgconfig
+, pkg-config
 , polkit
 , python3
 , scons
 , sphinx
-, utillinux
+, util-linux
 , wrapGAppsHook
 , withGui ? false }:
 
-with stdenv.lib;
+assert withGui -> !stdenv.isDarwin;
+
+with lib;
 stdenv.mkDerivation rec {
   pname = "rmlint";
   version = "2.10.1";
@@ -30,14 +32,11 @@ stdenv.mkDerivation rec {
     sha256 = "15xfkcw1bkfyf3z8kl23k3rlv702m0h7ghqxvhniynvlwbgh6j2x";
   };
 
-  CFLAGS="-I${stdenv.lib.getDev utillinux}/include";
-
   nativeBuildInputs = [
-    pkgconfig
+    pkg-config
     sphinx
-    gettext
     scons
-  ] ++ stdenv.lib.optionals withGui [
+  ] ++ lib.optionals withGui [
     makeWrapper
     wrapGAppsHook
   ];
@@ -46,8 +45,8 @@ stdenv.mkDerivation rec {
     glib
     json-glib
     libelf
-    utillinux
-  ] ++ stdenv.lib.optionals withGui [
+    util-linux
+  ] ++ lib.optionals withGui [
     cairo
     gobject-introspection
     gtksourceview3
@@ -57,12 +56,24 @@ stdenv.mkDerivation rec {
     python3.pkgs.pygobject3
   ];
 
-  # this doesn't seem to support configureFlags, and appends $out afterwards,
-  # so add the --without-gui in front of it
-  prefixKey = stdenv.lib.optionalString (!withGui) " --without-gui " + "--prefix=";
+  prePatch = ''
+    export CFLAGS="$NIX_CFLAGS_COMPILE"
+    export LDFLAGS="''${NIX_LDFLAGS//-rpath /-Wl,-rpath=}"
+
+    # remove sources of nondeterminism
+    substituteInPlace lib/cmdline.c \
+      --replace "__DATE__" "\"Jan  1 1970\"" \
+      --replace "__TIME__" "\"00:00:00\""
+    substituteInPlace docs/SConscript \
+      --replace "gzip -c " "gzip -cn "
+  '';
+
+  prefixKey = "--prefix=";
+
+  sconsFlags = lib.optionals (!withGui) [ "--without-gui" ];
 
   # in GUI mode, this shells out to itself, and tries to import python modules
-  postInstall = stdenv.lib.optionalString withGui ''
+  postInstall = lib.optionalString withGui ''
     gappsWrapperArgs+=(--prefix PATH : "$out/bin")
     gappsWrapperArgs+=(--prefix PYTHONPATH : "$(toPythonPath $out):$(toPythonPath ${python3.pkgs.pygobject3}):$(toPythonPath ${python3.pkgs.pycairo})")
   '';
@@ -70,8 +81,8 @@ stdenv.mkDerivation rec {
   meta = {
     description = "Extremely fast tool to remove duplicates and other lint from your filesystem";
     homepage = "https://rmlint.readthedocs.org";
-    platforms = platforms.linux;
+    platforms = platforms.unix;
     license = licenses.gpl3;
-    maintainers = [ maintainers.koral ];
+    maintainers = with maintainers; [ aaschmid koral ];
   };
 }