2017-07-30 11:51:57 +02:00
|
|
|
{ stdenv, fetchFromGitHub, qmake
|
2017-07-31 16:06:34 +02:00
|
|
|
, coreutils, xdg_utils, bash
|
|
|
|
, perl, makeWrapper, perlPackages }:
|
2017-07-30 11:51:57 +02:00
|
|
|
|
|
|
|
let
|
|
|
|
version = "1.4";
|
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}";
|
|
|
|
sha256 = "1ppasbr0mq301q6n3rm0bsmprs7vgkcjmmc0gbgqpgw84nmp9fqh";
|
|
|
|
};
|
|
|
|
|
2017-07-31 16:06:34 +02:00
|
|
|
nativeBuildInputs = [ qmake makeWrapper ];
|
2017-07-30 11:51:57 +02:00
|
|
|
|
|
|
|
buildInputs = [ perl ];
|
|
|
|
|
|
|
|
preBuild = ''
|
|
|
|
substituteInPlace scripts/scripts.pro \
|
|
|
|
--replace /bin/true ${coreutils}/bin/true \
|
|
|
|
--replace /usr/bin $out/bin
|
|
|
|
substituteInPlace src/src.pro \
|
|
|
|
--replace /usr/bin $out/bin \
|
|
|
|
--replace /usr/share $out/share
|
|
|
|
for i in doc/doc.pro doc/stats/stats.pro
|
|
|
|
do
|
|
|
|
substituteInPlace $i \
|
|
|
|
--replace /usr/share $out/share
|
|
|
|
done
|
|
|
|
|
2017-07-30 14:16:02 +02:00
|
|
|
for i in src/MainWindow.cpp src/FileSizeStatsWindow.cpp
|
|
|
|
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
|
|
|
|
'';
|
|
|
|
|
2017-07-31 16:06:34 +02:00
|
|
|
postInstall = ''
|
|
|
|
wrapProgram $out/bin/qdirstat-cache-writer \
|
|
|
|
--set PERL5LIB "${stdenv.lib.makePerlPath [ perlPackages.URI ]}"
|
|
|
|
'';
|
|
|
|
|
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;
|
|
|
|
};
|
|
|
|
}
|