2017-07-30 11:51:57 +02:00
|
|
|
{ stdenv, fetchFromGitHub, qmake
|
2017-07-31 16:06:34 +02:00
|
|
|
, coreutils, xdg_utils, bash
|
2018-12-15 04:50:31 +01:00
|
|
|
, makeWrapper, perlPackages }:
|
2017-07-30 11:51:57 +02:00
|
|
|
|
|
|
|
let
|
2019-01-11 20:31:36 +01:00
|
|
|
version = "1.5";
|
2017-07-30 14:16:02 +02:00
|
|
|
in stdenv.mkDerivation rec {
|
2017-07-30 11:51:57 +02:00
|
|
|
name = "qdirstat-${version}";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "shundhammer";
|
|
|
|
repo = "qdirstat";
|
|
|
|
rev = "${version}";
|
2019-01-11 20:31:36 +01:00
|
|
|
sha256 = "1v879kd7zahalb2qazq61wzi364k5cy3lgy6c8wj6mclwxjws1vc";
|
2017-07-30 11:51:57 +02:00
|
|
|
};
|
|
|
|
|
2017-07-31 16:06:34 +02:00
|
|
|
nativeBuildInputs = [ qmake makeWrapper ];
|
2017-07-30 11:51:57 +02:00
|
|
|
|
2018-12-15 04:50:31 +01:00
|
|
|
buildInputs = [ perlPackages.perl ];
|
2017-07-30 11:51:57 +02:00
|
|
|
|
|
|
|
preBuild = ''
|
|
|
|
substituteInPlace scripts/scripts.pro \
|
2019-01-11 20:31:36 +01:00
|
|
|
--replace /bin/true ${coreutils}/bin/true
|
2017-07-30 11:51:57 +02:00
|
|
|
|
2019-01-11 20:31:36 +01:00
|
|
|
for i in src/SysUtil.cpp src/FileSizeStatsWindow.cpp
|
2017-07-30 14:16:02 +02:00
|
|
|
do
|
2017-07-30 11:51:57 +02:00
|
|
|
substituteInPlace $i \
|
2017-07-30 14:16:02 +02:00
|
|
|
--replace /usr/bin/xdg-open ${xdg_utils}/bin/xdg-open
|
2017-07-30 11:51:57 +02: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-01-11 20:31:36 +01:00
|
|
|
postPatch = ''
|
|
|
|
export qmakeFlags="$qmakeFlags INSTALL_PREFIX=$out"
|
|
|
|
'';
|
2017-07-30 11:51:57 +02:00
|
|
|
|
2017-07-31 16:06:34 +02:00
|
|
|
postInstall = ''
|
|
|
|
wrapProgram $out/bin/qdirstat-cache-writer \
|
2018-12-15 04:50:31 +01:00
|
|
|
--set PERL5LIB "${perlPackages.makePerlPath [ perlPackages.URI ]}"
|
2017-07-31 16:06:34 +02:00
|
|
|
'';
|
|
|
|
|
2017-07-30 11:51:57 +02:00
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "Graphical disk usage analyzer";
|
|
|
|
homepage = src.meta.homepage;
|
|
|
|
license = licenses.gpl2;
|
|
|
|
maintainers = with maintainers; [ gnidorah ];
|
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|