@@ -0,0 +1,55 @@
1+{ stdenv, fetchFromGitHub, qmake
2+, coreutils, xdg_utils, bash, perl }:
3+
4+let
5+ version = "1.4";
6+in stdenv.mkDerivation {
7+ name = "qdirstat-${version}";
8+
9+ src = fetchFromGitHub {
10+ owner = "shundhammer";
11+ repo = "qdirstat";
12+ rev = "${version}";
13+ sha256 = "1ppasbr0mq301q6n3rm0bsmprs7vgkcjmmc0gbgqpgw84nmp9fqh";
14+ };
15+
16+ nativeBuildInputs = [ qmake ];
17+
18+ buildInputs = [ perl ];
19+
20+ preBuild = ''
21+ substituteInPlace scripts/scripts.pro \
22+ --replace /bin/true ${coreutils}/bin/true \
23+ --replace /usr/bin $out/bin
24+ substituteInPlace src/src.pro \
25+ --replace /usr/bin $out/bin \
26+ --replace /usr/share $out/share
27+ for i in doc/doc.pro doc/stats/stats.pro
28+ do
29+ substituteInPlace $i \
30+ --replace /usr/share $out/share
31+ done
32+
33+ for i in src/MainWindow.cpp src/FileSizeStatsWindow.cpp
34+ do
35+ substituteInPlace $i \
36+ --replace /usr/bin/xdg-open ${xdg_utils}/bin/xdg-open
37+ done
38+ for i in src/Cleanup.cpp src/cleanup-config-page.ui
39+ do
40+ substituteInPlace $i \
41+ --replace /bin/bash ${bash}/bin/bash \
42+ --replace /bin/sh ${bash}/bin/sh
43+ done
44+ substituteInPlace src/StdCleanup.cpp \
45+ --replace /bin/bash ${bash}/bin/bash
46+ '';
47+
48+ meta = with stdenv.lib; {
49+ description = "Graphical disk usage analyzer";
50+ homepage = src.meta.homepage;
51+ license = licenses.gpl2;
52+ maintainers = with maintainers; [ gnidorah ];
53+ platforms = platforms.linux;
54+ };
55+}