Skip to content

Commit

Permalink
Merge pull request #90267 from flokli/rmlint-gui
Browse files Browse the repository at this point in the history
rmlint: fix running rmlint --gui
  • Loading branch information
flokli committed Jun 18, 2020
2 parents 79b964a + 35040cf commit 79e8ba7
Showing 1 changed file with 47 additions and 6 deletions.
53 changes: 47 additions & 6 deletions pkgs/tools/misc/rmlint/default.nix
@@ -1,6 +1,22 @@
{ stdenv, fetchFromGitHub
, gettext, pkgconfig, scons
, glib, json-glib, libelf, sphinx, utillinux }:
{ stdenv
, cairo
, fetchFromGitHub
, gettext
, glib
, gobject-introspection
, gtksourceview3
, json-glib
, libelf
, makeWrapper
, pango
, pkgconfig
, polkit
, python3
, scons
, sphinx
, utillinux
, wrapGAppsHook
, withGui ? false }:

with stdenv.lib;
stdenv.mkDerivation rec {
Expand All @@ -17,14 +33,39 @@ stdenv.mkDerivation rec {
CFLAGS="-I${stdenv.lib.getDev utillinux}/include";

nativeBuildInputs = [
pkgconfig sphinx gettext scons
pkgconfig
sphinx
gettext
scons
] ++ stdenv.lib.optionals withGui [
makeWrapper
wrapGAppsHook
];

buildInputs = [
glib json-glib libelf utillinux
glib
json-glib
libelf
utillinux
] ++ stdenv.lib.optionals withGui [
cairo
gobject-introspection
gtksourceview3
pango
polkit
python3
python3.pkgs.pygobject3
];

prefixKey = "--prefix=";
# 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=";

# in GUI mode, this shells out to itself, and tries to import python modules
postInstall = stdenv.lib.optionalString withGui ''
gappsWrapperArgs+=(--prefix PATH : "$out/bin")
gappsWrapperArgs+=(--prefix PYTHONPATH : "$(toPythonPath $out):$(toPythonPath ${python3.pkgs.pygobject3}):$(toPythonPath ${python3.pkgs.pycairo})")
'';

meta = {
description = "Extremely fast tool to remove duplicates and other lint from your filesystem";
Expand Down

0 comments on commit 79e8ba7

Please sign in to comment.