1{ stdenv, lib, fetchFromGitHub, fetchpatch, ncurses
2, withGui ? false, qtbase }:
3
4stdenv.mkDerivation rec {
5 pname = "i7z";
6 version = "0.27.4";
7
8 src = fetchFromGitHub {
9 owner = "DimitryAndric";
10 repo = "i7z";
11 rev = "v${version}";
12 sha256 = "00c4ng30ry88hcya4g1i9dngiqmz3cs31x7qh1a10nalxn1829xy";
13 };
14
15 buildInputs = [ ncurses ] ++ lib.optional withGui qtbase;
16
17 patches = [
18 (fetchpatch {
19 url = "https://salsa.debian.org/debian/i7z/raw/ad1359764ee7a860a02e0c972f40339058fa9369/debian/patches/fix-insecure-tempfile.patch";
20 sha256 = "0ifg06xjw14y4fnzzgkhqm4sv9mcdzgi8m2wffq9z8b1r0znya3s";
21 })
22 (fetchpatch {
23 url = "https://salsa.debian.org/debian/i7z/raw/ad1359764ee7a860a02e0c972f40339058fa9369/debian/patches/nehalem.patch";
24 sha256 = "1ys6sgm01jkqb6d4y7qc3h89dzph8jjjcfya5c5jcm7dkxlzjq8a";
25 })
26 (fetchpatch {
27 url = "https://salsa.debian.org/debian/i7z/raw/ad1359764ee7a860a02e0c972f40339058fa9369/debian/patches/hyphen-used-as-minus-sign.patch";
28 sha256 = "1ji2qvdyq0594cpqz0dlsfggvw3rm63sygh0jxvwjgxpnhykhg1p";
29 })
30 ./qt5.patch
31 ];
32
33 enableParallelBuilding = true;
34
35 postBuild = lib.optionalString withGui ''
36 cd GUI
37 qmake
38 make clean
39 make
40 cd ..
41 '';
42
43 makeFlags = [ "prefix=${placeholder "out"}" ];
44
45 postInstall = lib.optionalString withGui ''
46 install -Dm755 GUI/i7z_GUI $out/bin/i7z-gui
47 '';
48
49 meta = with lib; {
50 description = "A better i7 (and now i3, i5) reporting tool for Linux";
51 homepage = "https://github.com/DimitryAndric/i7z";
52 license = licenses.gpl2;
53 maintainers = with maintainers; [ bluescreen303 ];
54 # broken on ARM
55 platforms = [ "x86_64-linux" ];
56 };
57}