2021-01-15 22:18:51 +00:00
|
|
|
{ lib, stdenv
|
2020-06-15 15:56:04 +00:00
|
|
|
, cairo
|
|
|
|
, fetchFromGitHub
|
|
|
|
, gettext
|
|
|
|
, glib
|
|
|
|
, gobject-introspection
|
|
|
|
, gtksourceview3
|
|
|
|
, json-glib
|
|
|
|
, libelf
|
|
|
|
, makeWrapper
|
|
|
|
, pango
|
2021-02-05 17:12:51 +00:00
|
|
|
, pkg-config
|
2020-06-15 15:56:04 +00:00
|
|
|
, polkit
|
|
|
|
, python3
|
|
|
|
, scons
|
|
|
|
, sphinx
|
2020-11-24 20:58:05 +00:00
|
|
|
, util-linux
|
2020-06-15 15:56:04 +00:00
|
|
|
, wrapGAppsHook
|
|
|
|
, withGui ? false }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
with lib;
|
2020-04-24 23:36:52 +00:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "rmlint";
|
2020-06-18 07:06:33 +00:00
|
|
|
version = "2.10.1";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "sahib";
|
|
|
|
repo = "rmlint";
|
|
|
|
rev = "v${version}";
|
2020-06-18 07:06:33 +00:00
|
|
|
sha256 = "15xfkcw1bkfyf3z8kl23k3rlv702m0h7ghqxvhniynvlwbgh6j2x";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
CFLAGS="-I${lib.getDev util-linux}/include";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [
|
2021-02-05 17:12:51 +00:00
|
|
|
pkg-config
|
2020-06-15 15:56:04 +00:00
|
|
|
sphinx
|
|
|
|
gettext
|
|
|
|
scons
|
2021-01-15 22:18:51 +00:00
|
|
|
] ++ lib.optionals withGui [
|
2020-06-15 15:56:04 +00:00
|
|
|
makeWrapper
|
|
|
|
wrapGAppsHook
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
2020-06-15 15:56:04 +00:00
|
|
|
glib
|
|
|
|
json-glib
|
|
|
|
libelf
|
2020-11-24 20:58:05 +00:00
|
|
|
util-linux
|
2021-01-15 22:18:51 +00:00
|
|
|
] ++ lib.optionals withGui [
|
2020-06-15 15:56:04 +00:00
|
|
|
cairo
|
|
|
|
gobject-introspection
|
|
|
|
gtksourceview3
|
|
|
|
pango
|
|
|
|
polkit
|
|
|
|
python3
|
|
|
|
python3.pkgs.pygobject3
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
2020-06-15 15:56:04 +00:00
|
|
|
# this doesn't seem to support configureFlags, and appends $out afterwards,
|
|
|
|
# so add the --without-gui in front of it
|
2021-01-15 22:18:51 +00:00
|
|
|
prefixKey = lib.optionalString (!withGui) " --without-gui " + "--prefix=";
|
2020-06-15 15:56:04 +00:00
|
|
|
|
|
|
|
# in GUI mode, this shells out to itself, and tries to import python modules
|
2021-01-15 22:18:51 +00:00
|
|
|
postInstall = lib.optionalString withGui ''
|
2020-06-15 15:56:04 +00:00
|
|
|
gappsWrapperArgs+=(--prefix PATH : "$out/bin")
|
|
|
|
gappsWrapperArgs+=(--prefix PYTHONPATH : "$(toPythonPath $out):$(toPythonPath ${python3.pkgs.pygobject3}):$(toPythonPath ${python3.pkgs.pycairo})")
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Extremely fast tool to remove duplicates and other lint from your filesystem";
|
|
|
|
homepage = "https://rmlint.readthedocs.org";
|
|
|
|
platforms = platforms.linux;
|
|
|
|
license = licenses.gpl3;
|
|
|
|
maintainers = [ maintainers.koral ];
|
|
|
|
};
|
|
|
|
}
|