2021-01-11 07:54:33 +00:00
|
|
|
{ lib, stdenv, buildPackages, fetchFromGitHub, fetchurl, pkgconfig, popt }:
|
2014-06-11 00:13:28 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "efivar";
|
2018-12-16 07:57:16 +00:00
|
|
|
version = "37";
|
2014-06-11 00:13:28 +01:00
|
|
|
|
2018-05-23 17:28:14 +01:00
|
|
|
outputs = [ "bin" "out" "dev" "man" ];
|
|
|
|
|
2015-06-19 06:03:00 +01:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "rhinstaller";
|
|
|
|
repo = "efivar";
|
|
|
|
rev = version;
|
2018-12-16 07:57:16 +00:00
|
|
|
sha256 = "1z2dw5x74wgvqgd8jvibfff0qhwkc53kxg54v12pzymyibagwf09";
|
2014-06-11 00:13:28 +01:00
|
|
|
};
|
2019-08-13 04:21:31 +01:00
|
|
|
patches = [
|
|
|
|
(fetchurl {
|
|
|
|
name = "r13y.patch";
|
|
|
|
url = "https://patch-diff.githubusercontent.com/raw/rhboot/efivar/pull/133.patch";
|
|
|
|
sha256 = "038cwldb8sqnal5l6mhys92cqv8x7j8rgsl8i4fiv9ih9znw26i6";
|
|
|
|
})
|
2019-11-02 17:00:17 +00:00
|
|
|
(fetchurl {
|
|
|
|
name = "fix-misaligned-pointer.patch";
|
|
|
|
url = "https://github.com/rhboot/efivar/commit/b98ba8921010d03f46704a476c69861515deb1ca.patch";
|
|
|
|
sha256 = "0ni9mz7y40a2wf1d1q5n9y5dhcbydxvfdhqic7zsmgnaxs3a0p27";
|
|
|
|
})
|
|
|
|
(fetchurl {
|
|
|
|
name = "fix-gcc9-error.patch";
|
|
|
|
url = "https://github.com/rhboot/efivar/commit/c3c553db85ff10890209d0fe48fb4856ad68e4e0.patch";
|
|
|
|
sha256 = "0lc38npydp069nlcga25wzzm204ww9l6mpjfn6wmhdfhn0pgjwky";
|
|
|
|
})
|
2020-05-31 15:30:28 +01:00
|
|
|
(fetchurl {
|
|
|
|
name = "remove_unused_variable.patch";
|
|
|
|
url = "https://github.com/rhboot/efivar/commit/fdb803402fb32fa6d020bac57a40c7efe4aabb7d.patch";
|
|
|
|
sha256 = "1xhy8v8ff9lyxb830n9hci2fbh7rfps6rwsqrjh4lw7316gwllsd";
|
|
|
|
})
|
|
|
|
(fetchurl {
|
|
|
|
name = "check_string_termination.patch";
|
|
|
|
url = "https://github.com/rhboot/efivar/commit/4e04afc2df9bbc26e5ab524b53a6f4f1e61d7c9e.patch";
|
|
|
|
sha256 = "1ajj11wwsvamfspq4naanvw08h63gr0g71q0dfbrrywrhc0jlmdw";
|
|
|
|
})
|
2019-08-13 04:21:31 +01:00
|
|
|
];
|
2021-01-04 16:50:29 +00:00
|
|
|
# We have no LTO here since commit 22284b07. With GCC 10 that triggers a warning.
|
2020-02-17 20:04:32 +00:00
|
|
|
postPatch = if stdenv.isi686 then "sed '/^OPTIMIZE /s/-flto//' -i Make.defaults" else null;
|
2021-01-04 16:50:29 +00:00
|
|
|
NIX_CFLAGS_COMPILE = if stdenv.isi686 then "-Wno-error=stringop-truncation" else null;
|
2014-06-11 00:13:28 +01:00
|
|
|
|
2016-05-03 02:50:13 +01:00
|
|
|
nativeBuildInputs = [ pkgconfig ];
|
2016-05-15 18:30:39 +01:00
|
|
|
buildInputs = [ popt ];
|
2018-11-28 12:06:23 +00:00
|
|
|
depsBuildBuild = [ buildPackages.stdenv.cc ];
|
2014-06-11 00:13:28 +01:00
|
|
|
|
2017-12-17 08:08:05 +00:00
|
|
|
makeFlags = [
|
|
|
|
"prefix=$(out)"
|
2014-06-11 00:13:28 +01:00
|
|
|
"libdir=$(out)/lib"
|
2018-05-23 17:28:14 +01:00
|
|
|
"bindir=$(bin)/bin"
|
|
|
|
"mandir=$(man)/share/man"
|
|
|
|
"includedir=$(dev)/include"
|
|
|
|
"PCDIR=$(dev)/lib/pkgconfig"
|
2014-06-11 00:13:28 +01:00
|
|
|
];
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2016-05-03 02:50:13 +01:00
|
|
|
inherit (src.meta) homepage;
|
2014-06-11 00:13:28 +01:00
|
|
|
description = "Tools and library to manipulate EFI variables";
|
|
|
|
platforms = platforms.linux;
|
|
|
|
license = licenses.lgpl21;
|
|
|
|
};
|
|
|
|
}
|