diff options
Diffstat (limited to 'pkgs/tools/misc/rmlint')
-rw-r--r-- | pkgs/tools/misc/rmlint/default.nix | 45 |
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 ]; }; } |