2022-11-21 17:40:18 +00:00
|
|
|
{ lib, stdenv, buildPackages, fetchFromGitHub, fetchpatch, pkg-config, popt, mandoc }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "efivar";
|
2022-11-21 17:40:18 +00:00
|
|
|
version = "38";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
outputs = [ "bin" "out" "dev" "man" ];
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "rhinstaller";
|
|
|
|
repo = "efivar";
|
|
|
|
rev = version;
|
2022-11-21 17:40:18 +00:00
|
|
|
hash = "sha256-A38BKGMK3Vo+85wzgxmzTjzZXtpcY9OpbZaONWnMYNk=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
2022-11-21 17:40:18 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
patches = [
|
2022-11-21 17:40:18 +00:00
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/rhboot/efivar/commit/15622b7e5761f3dde3f0e42081380b2b41639a48.patch";
|
|
|
|
sha256 = "sha256-SjZXj0hA2eQu2MfBoNjFPtd2DMYadtL7ZqwjKSf2cmI=";
|
2020-04-24 23:36:52 +00:00
|
|
|
})
|
2022-11-21 17:40:18 +00:00
|
|
|
# src/Makefile: build util.c separately for makeguids
|
|
|
|
# util.c needs to be built twice when cross-compiling
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/rhboot/efivar/commit/ca48d3964d26f5e3b38d73655f19b1836b16bd2d.patch";
|
|
|
|
hash = "sha256-DkNFIK4i7Eypyf2UeK7qHW36N2FSVRJ2rnOVLriWi5c=";
|
2020-06-18 07:06:33 +00:00
|
|
|
})
|
2023-02-02 18:25:31 +00:00
|
|
|
(fetchpatch {
|
|
|
|
name = "musl-backport.patch";
|
|
|
|
url = "https://github.com/rhboot/efivar/commit/cece3ffd5be2f8641eb694513f2b73e5eb97ffd3.patch";
|
|
|
|
sha256 = "7/E0gboU0A45/BY6jGPLuvds6qKtNjzpgKgdNTaVaZQ=";
|
|
|
|
})
|
2024-02-29 20:09:43 +00:00
|
|
|
|
|
|
|
# Fix build against gcc-13: https://github.com/rhboot/efivar/pull/242
|
|
|
|
(fetchpatch {
|
|
|
|
name = "gcc-13.patch";
|
|
|
|
url = "https://github.com/rhboot/efivar/commit/52fece47d4f3ebd588bd85598bfc7a0142365f7e.patch";
|
|
|
|
hash = "sha256-tOmxbY7kD6kzbBZ2RhQ5gCCpHtu+2gRNa7VUAWdCKu0=";
|
|
|
|
})
|
2021-12-06 16:07:01 +00:00
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-11-21 17:40:18 +00:00
|
|
|
nativeBuildInputs = [ pkg-config mandoc ];
|
2020-04-24 23:36:52 +00:00
|
|
|
buildInputs = [ popt ];
|
|
|
|
depsBuildBuild = [ buildPackages.stdenv.cc ];
|
|
|
|
|
|
|
|
makeFlags = [
|
|
|
|
"prefix=$(out)"
|
|
|
|
"libdir=$(out)/lib"
|
|
|
|
"bindir=$(bin)/bin"
|
|
|
|
"mandir=$(man)/share/man"
|
|
|
|
"includedir=$(dev)/include"
|
|
|
|
"PCDIR=$(dev)/lib/pkgconfig"
|
|
|
|
];
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Tools and library to manipulate EFI variables";
|
2022-11-21 17:40:18 +00:00
|
|
|
homepage = "https://github.com/rhboot/efivar";
|
2020-04-24 23:36:52 +00:00
|
|
|
platforms = platforms.linux;
|
2022-11-21 17:40:18 +00:00
|
|
|
license = licenses.lgpl21Only;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|