2021-01-11 07:54:33 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, fetchpatch, libbfd, zlib, libiberty }:
|
2020-02-01 16:24:41 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "wimboot";
|
|
|
|
version = "2.6.0";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "ipxe";
|
|
|
|
repo = "wimboot";
|
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "134wqqr147az5vbj4szd0xffwa99b4rar7w33zm3119zsn7sd79k";
|
|
|
|
};
|
|
|
|
|
|
|
|
NIX_CFLAGS_COMPILE = "-Wno-address-of-packed-member"; # Fails on gcc9
|
|
|
|
|
|
|
|
patches = [
|
2021-01-31 01:34:22 +00:00
|
|
|
# Fixes for newer binutils
|
|
|
|
# Add R_X86_64_PLT32 as known reloc target
|
2020-02-01 16:24:41 +00:00
|
|
|
(fetchpatch {
|
2021-01-31 01:34:22 +00:00
|
|
|
url = "https://github.com/ipxe/wimboot/commit/91be50c17d4d9f463109d5baafd70f9fdadd86db.patch";
|
2020-02-01 16:24:41 +00:00
|
|
|
sha256 = "113448n49hmk8nz1dxbhxiciwl281zwalvb8z5p9xfnjvibj8274";
|
|
|
|
})
|
2021-01-31 01:34:22 +00:00
|
|
|
# Fix building with binutils 2.34 (bfd_get_section_* removed in favour of bfd_section_*)
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/ipxe/wimboot/commit/2f97e681703d30b33a4d5032a8025ab8b9f2de75.patch";
|
|
|
|
sha256 = "0476mp74jaq3k099b654al6yi2yhgn37d9biz0wv3ln2q1gy94yf";
|
|
|
|
})
|
2020-02-01 16:24:41 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
# We cannot use sourceRoot because the patch wouldn't apply
|
|
|
|
postPatch = ''
|
|
|
|
cd src
|
|
|
|
'';
|
|
|
|
|
|
|
|
hardeningDisable = [ "pic" ];
|
|
|
|
|
|
|
|
buildInputs = [ libbfd zlib libiberty ];
|
|
|
|
makeFlags = [ "wimboot.x86_64.efi" ];
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/share/wimboot/
|
|
|
|
cp wimboot.x86_64.efi $out/share/wimboot
|
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2020-02-01 16:24:41 +00:00
|
|
|
homepage = "https://ipxe.org/wimboot";
|
|
|
|
description = "Windows Imaging Format bootloader";
|
2021-01-31 01:34:22 +00:00
|
|
|
license = licenses.gpl2Plus;
|
2020-02-01 16:24:41 +00:00
|
|
|
maintainers = with maintainers; [ das_j ajs124 ];
|
|
|
|
platforms = platforms.x86; # Fails on aarch64
|
|
|
|
};
|
|
|
|
}
|