1{ lib, stdenv, fetchFromGitHub, fetchurl
2, pkg-config, autoreconfHook, help2man, gettext, libxml2, perl, python3, doxygen
3}:
4
5stdenv.mkDerivation rec {
6 pname = "libsmbios";
7 version = "2.4.3";
8
9 src = fetchFromGitHub {
10 owner = "dell";
11 repo = "libsmbios";
12 rev = "v${version}";
13 sha256 = "0krwwydyvb9224r884y1mlmzyxhlfrcqw73vi1j8787rl0gl5a2i";
14 };
15
16 patches = [
17 (fetchurl {
18 name = "musl.patch";
19 url = "https://git.alpinelinux.org/aports/plain/community/libsmbios/fixes.patch?id=bdc4f67889c958c1266fa5d0cab71c3cd639122f";
20 sha256 = "aVVc52OovDYvqWRyKcRAi62daa9AalkKvnVOGvrTmRk=";
21 })
22 ];
23
24 nativeBuildInputs = [ autoreconfHook doxygen gettext libxml2 help2man perl pkg-config ];
25
26 buildInputs = [ python3 ];
27
28 configureFlags = [ "--disable-graphviz" ];
29
30 enableParallelBuilding = true;
31
32 postInstall = ''
33 mkdir -p $out/include
34 cp -a src/include/smbios_c $out/include/
35 cp -a out/public-include/smbios_c $out/include/
36 '';
37
38 # remove forbidden reference to $TMPDIR
39 preFixup = ''
40 patchelf --shrink-rpath --allowed-rpath-prefixes "$NIX_STORE" "$out/sbin/smbios-sys-info-lite"
41 '';
42
43 meta = with lib; {
44 homepage = "https://github.com/dell/libsmbios";
45 description = "A library to obtain BIOS information";
46 license = with licenses; [ osl21 gpl2Plus ];
47 maintainers = with maintainers; [ ];
48 platforms = [ "i686-linux" "x86_64-linux" ];
49 };
50}