From 5cd3d0ef0fb09a2023e36aa1970e5a5707e625df Mon Sep 17 00:00:00 2001 From: Artemis Tosini Date: Tue, 5 Nov 2024 22:03:36 +0000 Subject: [PATCH] openbsd.boot-config: init Co-Authored-By: Audrey Dutcher --- .../bsd/openbsd/pkgs/boot-config.nix | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 pkgs/os-specific/bsd/openbsd/pkgs/boot-config.nix diff --git a/pkgs/os-specific/bsd/openbsd/pkgs/boot-config.nix b/pkgs/os-specific/bsd/openbsd/pkgs/boot-config.nix new file mode 100644 index 000000000000..23bd63e6d1ac --- /dev/null +++ b/pkgs/os-specific/bsd/openbsd/pkgs/boot-config.nix @@ -0,0 +1,32 @@ +{ + mkDerivation, + lib, + flex, + byacc, + compatHook, +}: +mkDerivation { + path = "usr.sbin/config"; + + extraNativeBuildInputs = [ + flex + byacc + compatHook + ]; + + postPatch = '' + rm $BSDSRCDIR/usr.sbin/config/ukc.c + rm $BSDSRCDIR/usr.sbin/config/ukcutil.c + rm $BSDSRCDIR/usr.sbin/config/cmd.c + rm $BSDSRCDIR/usr.sbin/config/exec_elf.c + ''; + + buildPhase = '' + for f in *.l; do flex $f; done + for f in *.y; do yacc -H ''${f%.y}.h $f; done + for f in *.c; do $CC -I$TMP/include -DMAKE_BOOTSTRAP -c $f; done + $CC *.o -o config + ''; + + meta.platforms = lib.platforms.linux; +}