nixpkgs/pkgs/applications/misc/qdirstat/default.nix

58 lines
1.4 KiB
Nix
Raw Normal View History

{ lib, fetchFromGitHub, qmake
2021-02-01 08:05:09 +00:00
, coreutils, xdg-utils, bash
2019-08-07 09:20:03 +00:00
, makeWrapper, perlPackages, mkDerivation }:
2017-07-30 09:51:57 +00:00
let
2019-08-13 21:52:01 +00:00
pname = "qdirstat";
version = "1.7";
2017-07-30 09:51:57 +00:00
src = fetchFromGitHub {
owner = "shundhammer";
repo = pname;
2019-09-08 23:38:31 +00:00
rev = version;
2020-07-27 21:30:41 +00:00
sha256 = "163x3fxra0l3vvrzm25mh7jvcwjbmwsqlpppkxx76mkz9a1769fy";
2017-07-30 09:51:57 +00:00
};
in
mkDerivation {
inherit pname version src;
2017-07-30 09:51:57 +00:00
2017-07-31 14:06:34 +00:00
nativeBuildInputs = [ qmake makeWrapper ];
2017-07-30 09:51:57 +00:00
buildInputs = [ perlPackages.perl ];
2017-07-30 09:51:57 +00:00
2019-11-16 18:27:03 +00:00
postPatch = ''
2017-07-30 09:51:57 +00:00
substituteInPlace scripts/scripts.pro \
2019-01-11 19:31:36 +00:00
--replace /bin/true ${coreutils}/bin/true
2017-07-30 09:51:57 +00:00
2019-01-11 19:31:36 +00:00
for i in src/SysUtil.cpp src/FileSizeStatsWindow.cpp
do
2017-07-30 09:51:57 +00:00
substituteInPlace $i \
2021-02-01 08:05:09 +00:00
--replace /usr/bin/xdg-open ${xdg-utils}/bin/xdg-open
2017-07-30 09:51:57 +00:00
done
for i in src/Cleanup.cpp src/cleanup-config-page.ui
do
substituteInPlace $i \
--replace /bin/bash ${bash}/bin/bash \
--replace /bin/sh ${bash}/bin/sh
done
substituteInPlace src/StdCleanup.cpp \
--replace /bin/bash ${bash}/bin/bash
'';
2019-11-16 18:27:03 +00:00
qmakeFlags = [ "INSTALL_PREFIX=${placeholder "out"}" ];
2017-07-30 09:51:57 +00:00
2017-07-31 14:06:34 +00:00
postInstall = ''
wrapProgram $out/bin/qdirstat-cache-writer \
--set PERL5LIB "${perlPackages.makePerlPath [ perlPackages.URI ]}"
2017-07-31 14:06:34 +00:00
'';
meta = with lib; {
2017-07-30 09:51:57 +00:00
description = "Graphical disk usage analyzer";
homepage = src.meta.homepage;
license = licenses.gpl2;
maintainers = with maintainers; [ gnidorah ];
platforms = platforms.linux;
};
}