2021-01-15 09:19:50 +00:00
|
|
|
{ lib, stdenv
|
2020-06-14 00:30:18 +01:00
|
|
|
, cairo
|
|
|
|
, fetchFromGitHub
|
|
|
|
, gettext
|
|
|
|
, glib
|
|
|
|
, gobject-introspection
|
|
|
|
, gtksourceview3
|
|
|
|
, json-glib
|
|
|
|
, libelf
|
|
|
|
, makeWrapper
|
|
|
|
, pango
|
2021-01-17 03:51:22 +00:00
|
|
|
, pkg-config
|
2020-06-14 00:30:18 +01:00
|
|
|
, polkit
|
|
|
|
, python3
|
|
|
|
, scons
|
|
|
|
, sphinx
|
2020-11-24 15:29:28 +00:00
|
|
|
, util-linux
|
2020-06-14 00:30:18 +01:00
|
|
|
, wrapGAppsHook
|
|
|
|
, withGui ? false }:
|
2013-06-09 19:34:50 +01:00
|
|
|
|
2021-04-04 14:33:01 +01:00
|
|
|
assert withGui -> !stdenv.isDarwin;
|
|
|
|
|
2021-01-15 09:19:50 +00:00
|
|
|
with lib;
|
2013-06-09 19:34:50 +01:00
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "rmlint";
|
2020-06-15 03:42:48 +01:00
|
|
|
version = "2.10.1";
|
2013-06-09 19:34:50 +01:00
|
|
|
|
2017-08-21 17:14:14 +01:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "sahib";
|
|
|
|
repo = "rmlint";
|
|
|
|
rev = "v${version}";
|
2020-06-15 03:42:48 +01:00
|
|
|
sha256 = "15xfkcw1bkfyf3z8kl23k3rlv702m0h7ghqxvhniynvlwbgh6j2x";
|
2013-06-09 19:34:50 +01:00
|
|
|
};
|
|
|
|
|
2018-12-23 21:41:09 +00:00
|
|
|
nativeBuildInputs = [
|
2021-01-17 03:51:22 +00:00
|
|
|
pkg-config
|
2020-06-14 00:30:18 +01:00
|
|
|
sphinx
|
|
|
|
scons
|
2021-01-15 09:19:50 +00:00
|
|
|
] ++ lib.optionals withGui [
|
2020-06-14 00:30:18 +01:00
|
|
|
makeWrapper
|
|
|
|
wrapGAppsHook
|
2018-12-23 20:43:28 +00:00
|
|
|
];
|
2015-01-26 00:08:05 +00:00
|
|
|
|
2018-12-23 21:41:09 +00:00
|
|
|
buildInputs = [
|
2020-06-14 00:30:18 +01:00
|
|
|
glib
|
|
|
|
json-glib
|
|
|
|
libelf
|
2020-11-24 15:29:28 +00:00
|
|
|
util-linux
|
2021-01-15 09:19:50 +00:00
|
|
|
] ++ lib.optionals withGui [
|
2020-06-14 00:30:18 +01:00
|
|
|
cairo
|
|
|
|
gobject-introspection
|
|
|
|
gtksourceview3
|
|
|
|
pango
|
|
|
|
polkit
|
|
|
|
python3
|
|
|
|
python3.pkgs.pygobject3
|
2018-12-23 21:41:09 +00:00
|
|
|
];
|
2015-01-26 00:08:05 +00:00
|
|
|
|
2021-04-04 14:33:01 +01:00
|
|
|
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" ];
|
2020-06-14 00:30:18 +01:00
|
|
|
|
|
|
|
# in GUI mode, this shells out to itself, and tries to import python modules
|
2021-01-15 09:19:50 +00:00
|
|
|
postInstall = lib.optionalString withGui ''
|
2020-06-14 00:30:18 +01:00
|
|
|
gappsWrapperArgs+=(--prefix PATH : "$out/bin")
|
|
|
|
gappsWrapperArgs+=(--prefix PYTHONPATH : "$(toPythonPath $out):$(toPythonPath ${python3.pkgs.pygobject3}):$(toPythonPath ${python3.pkgs.pycairo})")
|
|
|
|
'';
|
2013-06-09 19:34:50 +01:00
|
|
|
|
|
|
|
meta = {
|
2015-04-28 09:54:58 +01:00
|
|
|
description = "Extremely fast tool to remove duplicates and other lint from your filesystem";
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://rmlint.readthedocs.org";
|
2021-04-04 14:33:01 +01:00
|
|
|
platforms = platforms.unix;
|
2015-01-26 00:08:05 +00:00
|
|
|
license = licenses.gpl3;
|
2021-04-04 14:33:01 +01:00
|
|
|
maintainers = with maintainers; [ aaschmid koral ];
|
2013-06-09 19:34:50 +01:00
|
|
|
};
|
|
|
|
}
|