forked from mirrors/nixpkgs
4a7f99d55d
Part of: https://github.com/NixOS/nixpkgs/issues/108938 meta = with stdenv.lib; is a widely used pattern. We want to slowly remove the `stdenv.lib` indirection and encourage people to use `lib` directly. Thus let’s start with the meta field. This used a rewriting script to mostly automatically replace all occurances of this pattern, and add the `lib` argument to the package header if it doesn’t exist yet. The script in its current form is available at https://cs.tvl.fyi/depot@2f807d7f141068d2d60676a89213eaa5353ca6e0/-/blob/users/Profpatsch/nixpkgs-rewriter/default.nix
48 lines
1.2 KiB
Nix
48 lines
1.2 KiB
Nix
{ lib, stdenv, fetchFromGitHub, fetchpatch, libbfd, zlib, libiberty }:
|
|
|
|
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 = [
|
|
# Fix for newer binutils
|
|
(fetchpatch {
|
|
url =
|
|
"https://github.com/ipxe/wimboot/commit/91be50c17d4d9f463109d5baafd70f9fdadd86db.patch";
|
|
sha256 = "113448n49hmk8nz1dxbhxiciwl281zwalvb8z5p9xfnjvibj8274";
|
|
})
|
|
];
|
|
|
|
# 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
|
|
'';
|
|
|
|
meta = with lib; {
|
|
homepage = "https://ipxe.org/wimboot";
|
|
description = "Windows Imaging Format bootloader";
|
|
license = licenses.gpl2;
|
|
maintainers = with maintainers; [ das_j ajs124 ];
|
|
platforms = platforms.x86; # Fails on aarch64
|
|
};
|
|
}
|