mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-22 15:03:28 +00:00
openbsd.stand: init
This stand package builds all variants of OpenBSD's `stand` bootloader, including both UEFI and BIOS versions. This package will likely need changes if we ever support `aarch64-openbsd`, but that isn't even a target yet. Co-Authored-By: Audrey Dutcher <audrey@rhelmot.io>
This commit is contained in:
parent
02dadff685
commit
80d9fe945b
32
pkgs/os-specific/bsd/openbsd/pkgs/stand.nix
Normal file
32
pkgs/os-specific/bsd/openbsd/pkgs/stand.nix
Normal file
@ -0,0 +1,32 @@
|
||||
{
|
||||
mkDerivation,
|
||||
stdenv,
|
||||
pkgsBuildTarget,
|
||||
}:
|
||||
|
||||
mkDerivation {
|
||||
path = "sys/arch/amd64/stand";
|
||||
extraPaths = [ "sys" ];
|
||||
|
||||
# gcc compat
|
||||
postPatch = ''
|
||||
find $BSDSRCDIR -name Makefile -print0 | xargs -0 sed -E -i -e 's/-nopie/-no-pie/g'
|
||||
substituteInPlace $BSDSRCDIR/sys/arch/*/stand/boot/check-boot.pl --replace-fail /usr/bin/objdump objdump
|
||||
substituteInPlace $BSDSRCDIR/sys/arch/*/stand/Makefile --replace-quiet " boot " " " --replace-quiet " fdboot " " "
|
||||
'';
|
||||
|
||||
# expects to be able to use unprefixed programs
|
||||
# needs gnu assembler + objdump + objcopy
|
||||
# this is really not designed for cross...
|
||||
preBuild = ''
|
||||
mkdir $TMP/bin
|
||||
export PATH=$TMP/bin:$PATH
|
||||
ln -s ${stdenv.cc}/bin/${stdenv.cc.targetPrefix}size $TMP/bin/size
|
||||
ln -s ${pkgsBuildTarget.binutils}/bin/${pkgsBuildTarget.binutils.targetPrefix}as $TMP/bin/as
|
||||
ln -s ${pkgsBuildTarget.binutils}/bin/${pkgsBuildTarget.binutils.targetPrefix}objdump $TMP/bin/objdump
|
||||
ln -s ${pkgsBuildTarget.binutils}/bin/${pkgsBuildTarget.binutils.targetPrefix}objcopy $TMP/bin/objcopy
|
||||
ln -s ${pkgsBuildTarget.binutils}/bin/${pkgsBuildTarget.binutils.targetPrefix}objcopy $TMP/bin/
|
||||
|
||||
export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -Wno-pointer-sign"
|
||||
'';
|
||||
}
|
Loading…
Reference in New Issue
Block a user