2021-01-11 08:54:33 +01:00
|
|
|
{ lib, stdenv, fetchurl, which, pkgconfig, gtk2, pcre, glib, libxml2
|
2017-02-01 21:03:02 +01:00
|
|
|
, libsoup ? null
|
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 14:41:18 +02:00
|
|
|
pname = "hardinfo";
|
2017-02-01 21:03:02 +01:00
|
|
|
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.
|
2017-09-05 23:26:13 +02:00
|
|
|
nativeBuildInputs = [ pkgconfig ];
|
|
|
|
buildInputs = [ which gtk2 pcre glib libxml2 libsoup ];
|
2017-02-01 21:03:02 +01:00
|
|
|
|
|
|
|
# Fixes '#error You must compile this program without "-O"'
|
|
|
|
hardeningDisable = [ "all" ];
|
|
|
|
|
2018-10-17 09:18:22 +02:00
|
|
|
# Ignore undefined references to a bunch of libsoup symbols
|
|
|
|
NIX_LDFLAGS = "--unresolved-symbol=ignore-all";
|
|
|
|
|
2017-02-01 21:03:02 +01:00
|
|
|
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
|
2019-03-16 15:55:24 +01:00
|
|
|
substituteInPlace ./arch/linux/common/os.h --replace /lib/libc.so.6 ${stdenv.glibc.out}/lib/libc.so.6
|
2017-02-01 21:03:02 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
# Makefile supports DESTDIR but not PREFIX (it hardcodes $DESTDIR/usr/).
|
|
|
|
installFlags = [ "DESTDIR=$(out)" ];
|
|
|
|
postInstall = ''
|
|
|
|
mv "$out/usr/"* "$out"
|
|
|
|
rmdir "$out/usr"
|
|
|
|
'';
|
|
|
|
|
2021-01-11 08:54:33 +01:00
|
|
|
meta = with lib; {
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "http://hardinfo.org/";
|
2017-02-01 21:03:02 +01:00
|
|
|
description = "Display information about your hardware and operating system";
|
|
|
|
license = licenses.gpl2;
|
|
|
|
maintainers = with maintainers; [ bjornfor ];
|
2019-11-16 16:25:07 +01:00
|
|
|
platforms = [ "x86_64-linux" "i686-linux" ]; # ARMv7 and AArch64 are unsupported
|
2017-02-01 21:03:02 +01:00
|
|
|
};
|
|
|
|
}
|