diff options
Diffstat (limited to 'pkgs/os-specific/bsd/freebsd/pkgs/sys')
3 files changed, 83 insertions, 123 deletions
diff --git a/pkgs/os-specific/bsd/freebsd/pkgs/sys/package.nix b/pkgs/os-specific/bsd/freebsd/pkgs/sys/package.nix index 81cf4114e8737..86f847cbd45cf 100644 --- a/pkgs/os-specific/bsd/freebsd/pkgs/sys/package.nix +++ b/pkgs/os-specific/bsd/freebsd/pkgs/sys/package.nix @@ -1,67 +1,85 @@ -{ lib, stdenv, mkDerivation, freebsd-lib -, buildPackages -, bsdSetupHook, freebsdSetupHook -, makeMinimal, install, mandoc, groff -, config, rpcgen, file2c, gawk, uudecode, xargs-j #, ctfconvert +{ + stdenv, + mkDerivation, + freebsd-lib, + buildPackages, + bsdSetupHook, + freebsdSetupHook, + makeMinimal, + install, + mandoc, + groff, + config, + rpcgen, + file2c, + gawk, + uudecode, + xargs-j, }: -mkDerivation (let - cfg = "MINIMAL"; -in rec { - path = "sys"; - - nativeBuildInputs = [ - bsdSetupHook freebsdSetupHook - makeMinimal install mandoc groff - - config rpcgen file2c gawk uudecode xargs-j - #ctfconvert - ]; - - patches = [ - ./sys-gnu-date.patch - ./sys-no-explicit-intrinsics-dep.patch - ]; - - # --dynamic-linker /red/herring is used when building the kernel. - NIX_ENFORCE_PURITY = 0; - - AWK = "${buildPackages.gawk}/bin/awk"; - - CWARNEXTRA = "-Wno-error=shift-negative-value -Wno-address-of-packed-member"; - - MK_CTF = "no"; - - KODIR = "${builtins.placeholder "out"}/kernel"; - KMODDIR = "${builtins.placeholder "out"}/kernel"; - DTBDIR = "${builtins.placeholder"out"}/dbt"; - - KERN_DEBUGDIR = "${builtins.placeholder "out"}/debug"; - KERN_DEBUGDIR_KODIR = "${KERN_DEBUGDIR}/kernel"; - KERN_DEBUGDIR_KMODDIR = "${KERN_DEBUGDIR}/kernel"; - - skipIncludesPhase = true; - - configurePhase = '' - runHook preConfigure - - for f in conf/kmod.mk contrib/dev/acpica/acpica_prep.sh; do - substituteInPlace "$f" --replace 'xargs -J' 'xargs-j ' - done - - for f in conf/*.mk; do - substituteInPlace "$f" --replace 'KERN_DEBUGDIR}''${' 'KERN_DEBUGDIR_' - done - - cd ${freebsd-lib.mkBsdArch stdenv}/conf - sed -i ${cfg} \ - -e 's/WITH_CTF=1/WITH_CTF=0/' \ - -e '/KDTRACE/d' - config ${cfg} - - runHook postConfigure - ''; - preBuild = '' - cd ../compile/${cfg} - ''; -}) +mkDerivation ( + let + cfg = "MINIMAL"; + in + rec { + path = "sys"; + + nativeBuildInputs = [ + bsdSetupHook + freebsdSetupHook + makeMinimal + install + mandoc + groff + + config + rpcgen + file2c + gawk + uudecode + xargs-j + ]; + + # --dynamic-linker /red/herring is used when building the kernel. + NIX_ENFORCE_PURITY = 0; + + AWK = "${buildPackages.gawk}/bin/awk"; + + CWARNEXTRA = "-Wno-error=shift-negative-value -Wno-address-of-packed-member"; + + MK_CTF = "no"; + + KODIR = "${builtins.placeholder "out"}/kernel"; + KMODDIR = "${builtins.placeholder "out"}/kernel"; + DTBDIR = "${builtins.placeholder "out"}/dbt"; + + KERN_DEBUGDIR = "${builtins.placeholder "out"}/debug"; + KERN_DEBUGDIR_KODIR = "${KERN_DEBUGDIR}/kernel"; + KERN_DEBUGDIR_KMODDIR = "${KERN_DEBUGDIR}/kernel"; + + skipIncludesPhase = true; + + configurePhase = '' + runHook preConfigure + + for f in conf/kmod.mk contrib/dev/acpica/acpica_prep.sh; do + substituteInPlace "$f" --replace 'xargs -J' 'xargs-j ' + done + + for f in conf/*.mk; do + substituteInPlace "$f" --replace 'KERN_DEBUGDIR}''${' 'KERN_DEBUGDIR_' + done + + cd ${freebsd-lib.mkBsdArch stdenv}/conf + sed -i ${cfg} \ + -e 's/WITH_CTF=1/WITH_CTF=0/' \ + -e '/KDTRACE/d' + config ${cfg} + + runHook postConfigure + ''; + preBuild = '' + cd ../compile/${cfg} + ''; + } +) diff --git a/pkgs/os-specific/bsd/freebsd/pkgs/sys/sys-gnu-date.patch b/pkgs/os-specific/bsd/freebsd/pkgs/sys/sys-gnu-date.patch deleted file mode 100644 index 2356446baf853..0000000000000 --- a/pkgs/os-specific/bsd/freebsd/pkgs/sys/sys-gnu-date.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh -index c594724d814..d5287c7b992 100644 ---- a/sys/conf/newvers.sh -+++ b/sys/conf/newvers.sh -@@ -177,7 +177,7 @@ u=${USER:-root} - d=$(pwd) - h=${HOSTNAME:-$(hostname)} - if [ -n "$SOURCE_DATE_EPOCH" ]; then -- if ! t=$(date -r $SOURCE_DATE_EPOCH 2>/dev/null); then -+ if ! t=$(date -d @$SOURCE_DATE_EPOCH 2>/dev/null); then - echo "Invalid SOURCE_DATE_EPOCH" >&2 - exit 1 - fi diff --git a/pkgs/os-specific/bsd/freebsd/pkgs/sys/sys-no-explicit-intrinsics-dep.patch b/pkgs/os-specific/bsd/freebsd/pkgs/sys/sys-no-explicit-intrinsics-dep.patch deleted file mode 100644 index edf44de5bb0d7..0000000000000 --- a/pkgs/os-specific/bsd/freebsd/pkgs/sys/sys-no-explicit-intrinsics-dep.patch +++ /dev/null @@ -1,45 +0,0 @@ -diff --git a/sys/modules/aesni/Makefile b/sys/modules/aesni/Makefile -index cb8c744adde..1c327331890 100644 ---- a/sys/modules/aesni/Makefile -+++ b/sys/modules/aesni/Makefile -@@ -1,7 +1,6 @@ - # $FreeBSD$ - - .PATH: ${SRCTOP}/sys/crypto/aesni --.PATH: ${SRCTOP}/contrib/llvm-project/clang/lib/Headers - - KMOD= aesni - SRCS= aesni.c -@@ -40,8 +39,8 @@ intel_sha256.o: intel_sha256.c - aesni_ghash.o: aesni.h - aesni_wrap.o: aesni.h - aesni_ccm.o: aesni.h --intel_sha1.o: sha_sse.h immintrin.h shaintrin.h tmmintrin.h xmmintrin.h --intel_sha256.o: sha_sse.h immintrin.h shaintrin.h tmmintrin.h xmmintrin.h -+intel_sha1.o: sha_sse.h -+intel_sha256.o: sha_sse.h - - .include <bsd.kmod.mk> - -diff --git a/sys/modules/blake2/Makefile b/sys/modules/blake2/Makefile -index e4b3fb9f126..5bfd9c2ae02 100644 ---- a/sys/modules/blake2/Makefile -+++ b/sys/modules/blake2/Makefile -@@ -3,7 +3,6 @@ - .PATH: ${SRCTOP}/sys/contrib/libb2 - .PATH: ${SRCTOP}/sys/crypto/blake2 - .PATH: ${SRCTOP}/sys/opencrypto --.PATH: ${SRCTOP}/contrib/llvm-project/clang/lib/Headers - - KMOD = blake2 - -@@ -64,8 +63,7 @@ ${src:S/.c/.o/}: ${src} - -D_MM_MALLOC_H_INCLUDED -Wno-unused-function ${.IMPSRC} - ${CTFCONVERT_CMD} - --${src:S/.c/.o/}: intrin.h emmintrin.h tmmintrin.h smmintrin.h immintrin.h \ -- x86intrin.h ${SRCS:M*.h} -+${src:S/.c/.o/}: ${SRCS:M*.h} - .endfor - - # FreeBSD-specific sources: |