summary refs log tree commit diff
path: root/pkgs/os-specific
diff options
context:
space:
mode:
authorYegor Timoshenko <yegortimoshenko@riseup.net>2018-05-16 09:09:47 +0300
committerGitHub <noreply@github.com>2018-05-16 09:09:47 +0300
commit7d842f3b499d2a29cd36cc2d9078f6a6090410eb (patch)
treee5a31f3835bc58df9aa93c14ea95f5598b53b068 /pkgs/os-specific
parent4592ed6e439b7a5a54b1679cb2f00cf08e1c0d4a (diff)
parent389691a42c0b73764d1e3bfe25771dac7147d8ff (diff)
downloadnixlib-7d842f3b499d2a29cd36cc2d9078f6a6090410eb.tar
nixlib-7d842f3b499d2a29cd36cc2d9078f6a6090410eb.tar.gz
nixlib-7d842f3b499d2a29cd36cc2d9078f6a6090410eb.tar.bz2
nixlib-7d842f3b499d2a29cd36cc2d9078f6a6090410eb.tar.lz
nixlib-7d842f3b499d2a29cd36cc2d9078f6a6090410eb.tar.xz
nixlib-7d842f3b499d2a29cd36cc2d9078f6a6090410eb.tar.zst
nixlib-7d842f3b499d2a29cd36cc2d9078f6a6090410eb.zip
Merge pull request #40540 from peterhoeg/f/i7z
i7z: do not build the GUI by default
Diffstat (limited to 'pkgs/os-specific')
-rw-r--r--pkgs/os-specific/linux/i7z/default.nix44
1 files changed, 31 insertions, 13 deletions
diff --git a/pkgs/os-specific/linux/i7z/default.nix b/pkgs/os-specific/linux/i7z/default.nix
index 6d0c5ae82bcc..48d28036aa4f 100644
--- a/pkgs/os-specific/linux/i7z/default.nix
+++ b/pkgs/os-specific/linux/i7z/default.nix
@@ -1,4 +1,5 @@
-{ stdenv, fetchurl, qt4, ncurses }:
+{ stdenv, lib, fetchurl, ncurses
+, withGui ? false, qt4 ? null }:
 
 stdenv.mkDerivation rec {
   name = "i7z-0.27.2";
@@ -8,29 +9,46 @@ stdenv.mkDerivation rec {
     sha256 = "1wa7ix6m75wl3k2n88sz0x8cckvlzqklja2gvzqfw5rcfdjjvxx7";
   };
 
-  buildInputs = [ qt4 ncurses ];
+  buildInputs = [ ncurses ] ++ lib.optional withGui qt4;
+
+  enableParallelBuilding = true;
 
   buildPhase = ''
+    runHook preBuild
+
     make
-    cd GUI
-    qmake
-    make clean
-    make
-    cd ..
+    ${lib.optionalString withGui ''
+      cd GUI
+      qmake
+      make clean
+      make
+      cd ..
+    ''}
+
+    runHook postBuild
   '';
 
   installPhase = ''
-    mkdir -p $out/sbin
+    runHook preInstall
+
+    mkdir -p $out/{bin,sbin}
     make install prefix=$out
-    install -Dm755 GUI/i7z_GUI $out/sbin/i7z-gui
+    ${lib.optionalString withGui ''
+      install -Dm755 GUI/i7z_GUI $out/bin/i7z-gui
+    ''}
+    mv $out/sbin/* $out/bin/
+    rmdir $out/sbin
+
+    runHook postInstall
   '';
 
-  meta = {
+  meta = with lib; {
     description = "A better i7 (and now i3, i5) reporting tool for Linux";
     homepage = https://github.com/ajaiantilal/i7z;
     repositories.git = https://github.com/ajaiantilal/i7z.git;
-    license = stdenv.lib.licenses.gpl2;
-    maintainers = [ stdenv.lib.maintainers.bluescreen303 ];
-    platforms = stdenv.lib.platforms.linux;
+    license = licenses.gpl2;
+    maintainers = with maintainers; [ bluescreen303 ];
+    # broken on ARM
+    platforms = [ "x86_64-linux" ];
   };
 }