about summary refs log tree commit diff
path: root/pkgs/tools/system
diff options
context:
space:
mode:
authorBjørn Forsman <bjorn.forsman@gmail.com>2017-02-01 21:03:02 +0100
committerBjørn Forsman <bjorn.forsman@gmail.com>2017-02-01 21:12:59 +0100
commit3e5022c787c2581aa3fc5685a3c0e08a2a0314a0 (patch)
tree2358023eef110f66e983031e7de6ffec2d701bf1 /pkgs/tools/system
parentc34cfa21d4f195c0b3e8ee6d466127ffa2884a51 (diff)
downloadnixlib-3e5022c787c2581aa3fc5685a3c0e08a2a0314a0.tar
nixlib-3e5022c787c2581aa3fc5685a3c0e08a2a0314a0.tar.gz
nixlib-3e5022c787c2581aa3fc5685a3c0e08a2a0314a0.tar.bz2
nixlib-3e5022c787c2581aa3fc5685a3c0e08a2a0314a0.tar.lz
nixlib-3e5022c787c2581aa3fc5685a3c0e08a2a0314a0.tar.xz
nixlib-3e5022c787c2581aa3fc5685a3c0e08a2a0314a0.tar.zst
nixlib-3e5022c787c2581aa3fc5685a3c0e08a2a0314a0.zip
hardinfo: init at 0.5.1
Display information about your hardware and operating system.
Diffstat (limited to 'pkgs/tools/system')
-rw-r--r--pkgs/tools/system/hardinfo/default.nix45
1 files changed, 45 insertions, 0 deletions
diff --git a/pkgs/tools/system/hardinfo/default.nix b/pkgs/tools/system/hardinfo/default.nix
new file mode 100644
index 000000000000..11236b7a9d10
--- /dev/null
+++ b/pkgs/tools/system/hardinfo/default.nix
@@ -0,0 +1,45 @@
+{ stdenv, fetchurl, which, pkgconfig, gtk2, pcre, glib, libxml2
+, libsoup ? null
+}:
+
+stdenv.mkDerivation rec {
+  name = "hardinfo-${version}";
+  version = "0.5.1";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/project/hardinfo.berlios/hardinfo-${version}.tar.bz2";
+    sha256 = "0yhvfc5icam3i4mphlz0m9d9d2irjw8mbsxq203x59wjgh6nrpx0";
+  };
+
+  # Not adding 'hostname' command, the build shouldn't depend on what the build
+  # host is called.
+  buildInputs = [ which pkgconfig gtk2 pcre glib libxml2 libsoup ];
+
+  # Fixes '#error You must compile this program without "-O"'
+  hardeningDisable = [ "all" ];
+
+  preConfigure = ''
+    patchShebangs configure
+
+    # -std=gnu89 fixes build error, copied from
+    # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=757525
+    sed -i -e "s/^CFLAGS = \(.*\)/CFLAGS = \1 -std=gnu89/" Makefile.in
+
+    substituteInPlace ./arch/linux/common/modules.h --replace /sbin/modinfo modinfo
+  '';
+
+  # Makefile supports DESTDIR but not PREFIX (it hardcodes $DESTDIR/usr/).
+  installFlags = [ "DESTDIR=$(out)" ];
+  postInstall = ''
+    mv "$out/usr/"* "$out"
+    rmdir "$out/usr"
+  '';
+
+  meta = with stdenv.lib; {
+    homepage = http://hardinfo.org/;
+    description = "Display information about your hardware and operating system";
+    license = licenses.gpl2;
+    maintainers = with maintainers; [ bjornfor ];
+    platforms = platforms.linux;
+  };
+}