3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/os-specific/linux/firmware/fwupdate/default.nix

62 lines
1.4 KiB
Nix
Raw Normal View History

2018-02-16 23:52:09 +00:00
{ efivar, fetchurl, gettext, gnu-efi, libsmbios, pkgconfig, popt, stdenv }:
let
2018-08-26 01:02:48 +01:00
version = "12";
2018-02-16 23:52:09 +00:00
in stdenv.mkDerivation {
2019-08-13 22:52:01 +01:00
pname = "fwupdate";
inherit version;
2018-02-16 23:52:09 +00:00
src = fetchurl {
url = "https://github.com/rhinstaller/fwupdate/releases/download/${version}/fwupdate-${version}.tar.bz2";
2018-08-26 01:02:48 +01:00
sha256 = "00w7jsg7wrlq4cpfz26m9rbv2jwyf0sansf343vfq02fy5lxars1";
2018-02-16 23:52:09 +00:00
};
patches = [
./do-not-create-sharedstatedir.patch
];
2019-10-30 01:29:30 +00:00
NIX_CFLAGS_COMPILE = "-I${gnu-efi}/include/efi -Wno-error=address-of-packed-member";
2018-02-16 23:52:09 +00:00
# TODO: Just apply the disable to the efi subdir
hardeningDisable = [ "stackprotector" ];
makeFlags = [
"EFIDIR=nixos"
"prefix=$(out)"
"LIBDIR=$(out)/lib"
"GNUEFIDIR=${gnu-efi}/lib"
"ESPMOUNTPOINT=$(out)/boot"
];
nativeBuildInputs = [
pkgconfig
gettext
];
buildInputs = [
gnu-efi
libsmbios
popt
];
propagatedBuildInputs = [
efivar
];
# TODO: fix wrt cross-compilation
preConfigure = ''
arch=$(cc -dumpmachine | cut -f1 -d- | sed 's,i[3456789]86,ia32,' )
export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I${gnu-efi}/include/efi/$arch"
'';
postInstall = ''
rm -rf $out/src
rm -rf $out/lib/debug
'';
meta = with stdenv.lib; {
description = "Tools for using the ESRT and UpdateCapsule() to apply firmware updates";
maintainers = with maintainers; [ ];
license = licenses.gpl2;
platforms = platforms.linux;
};
}