2021-01-15 10:19:50 +01:00
|
|
|
{ lib, stdenv
|
2020-06-14 01:30:18 +02:00
|
|
|
, cairo
|
2024-04-03 21:52:31 +02:00
|
|
|
, elfutils
|
2020-06-14 01:30:18 +02:00
|
|
|
, fetchFromGitHub
|
|
|
|
, glib
|
|
|
|
, gobject-introspection
|
|
|
|
, gtksourceview3
|
|
|
|
, json-glib
|
|
|
|
, makeWrapper
|
|
|
|
, pango
|
2021-01-17 04:51:22 +01:00
|
|
|
, pkg-config
|
2020-06-14 01:30:18 +02:00
|
|
|
, polkit
|
|
|
|
, python3
|
|
|
|
, scons
|
|
|
|
, sphinx
|
2020-11-24 16:29:28 +01:00
|
|
|
, util-linux
|
2020-06-14 01:30:18 +02:00
|
|
|
, wrapGAppsHook
|
|
|
|
, withGui ? false }:
|
2013-06-09 20:34:50 +02:00
|
|
|
|
2021-04-04 15:33:01 +02:00
|
|
|
assert withGui -> !stdenv.isDarwin;
|
|
|
|
|
2013-06-09 20:34:50 +02:00
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 14:41:18 +02:00
|
|
|
pname = "rmlint";
|
2023-08-13 15:01:13 +02:00
|
|
|
version = "2.10.2";
|
2013-06-09 20:34:50 +02:00
|
|
|
|
2017-08-21 18:14:14 +02:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "sahib";
|
|
|
|
repo = "rmlint";
|
|
|
|
rev = "v${version}";
|
2023-08-13 15:01:13 +02:00
|
|
|
sha256 = "sha256-pOo1YfeqHUU6xyBRFbcj2lX1MHJ+a5Hi31BMC1nYZGo=";
|
2013-06-09 20:34:50 +02:00
|
|
|
};
|
|
|
|
|
2023-01-27 20:08:46 +01:00
|
|
|
patches = [
|
|
|
|
# pass through NIX_* environment variables to scons.
|
|
|
|
./scons-nix-env.patch
|
|
|
|
];
|
|
|
|
|
2018-12-23 22:41:09 +01:00
|
|
|
nativeBuildInputs = [
|
2021-01-17 04:51:22 +01:00
|
|
|
pkg-config
|
2020-06-14 01:30:18 +02:00
|
|
|
sphinx
|
|
|
|
scons
|
2021-01-15 10:19:50 +01:00
|
|
|
] ++ lib.optionals withGui [
|
2020-06-14 01:30:18 +02:00
|
|
|
makeWrapper
|
|
|
|
wrapGAppsHook
|
2023-06-22 13:49:31 +02:00
|
|
|
gobject-introspection
|
2018-12-23 21:43:28 +01:00
|
|
|
];
|
2015-01-26 01:08:05 +01:00
|
|
|
|
2018-12-23 22:41:09 +01:00
|
|
|
buildInputs = [
|
2020-06-14 01:30:18 +02:00
|
|
|
glib
|
|
|
|
json-glib
|
2020-11-24 16:29:28 +01:00
|
|
|
util-linux
|
2021-01-15 10:19:50 +01:00
|
|
|
] ++ lib.optionals withGui [
|
2020-06-14 01:30:18 +02:00
|
|
|
cairo
|
|
|
|
gtksourceview3
|
|
|
|
pango
|
|
|
|
polkit
|
|
|
|
python3
|
|
|
|
python3.pkgs.pygobject3
|
2024-04-03 21:52:31 +02:00
|
|
|
] ++ lib.optionals (lib.meta.availableOn stdenv.hostPlatform elfutils) [
|
|
|
|
elfutils
|
2018-12-23 22:41:09 +01:00
|
|
|
];
|
2015-01-26 01:08:05 +01:00
|
|
|
|
2021-04-04 15:33:01 +02:00
|
|
|
prePatch = ''
|
|
|
|
# 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 "
|
|
|
|
'';
|
|
|
|
|
2023-01-27 20:08:46 +01:00
|
|
|
# Otherwise tries to access /usr.
|
2021-04-04 15:33:01 +02:00
|
|
|
prefixKey = "--prefix=";
|
|
|
|
|
|
|
|
sconsFlags = lib.optionals (!withGui) [ "--without-gui" ];
|
2020-06-14 01:30:18 +02:00
|
|
|
|
|
|
|
# in GUI mode, this shells out to itself, and tries to import python modules
|
2021-01-15 10:19:50 +01:00
|
|
|
postInstall = lib.optionalString withGui ''
|
2020-06-14 01:30:18 +02:00
|
|
|
gappsWrapperArgs+=(--prefix PATH : "$out/bin")
|
|
|
|
gappsWrapperArgs+=(--prefix PYTHONPATH : "$(toPythonPath $out):$(toPythonPath ${python3.pkgs.pygobject3}):$(toPythonPath ${python3.pkgs.pycairo})")
|
|
|
|
'';
|
2013-06-09 20:34:50 +02:00
|
|
|
|
2023-01-24 17:35:54 +01:00
|
|
|
meta = with lib; {
|
2015-04-28 10:54:58 +02:00
|
|
|
description = "Extremely fast tool to remove duplicates and other lint from your filesystem";
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "https://rmlint.readthedocs.org";
|
2021-04-04 15:33:01 +02:00
|
|
|
platforms = platforms.unix;
|
2015-01-26 01:08:05 +01:00
|
|
|
license = licenses.gpl3;
|
2021-04-04 15:33:01 +02:00
|
|
|
maintainers = with maintainers; [ aaschmid koral ];
|
2023-11-27 02:17:53 +01:00
|
|
|
mainProgram = "rmlint";
|
2013-06-09 20:34:50 +02:00
|
|
|
};
|
|
|
|
}
|