push sheeet
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s

This commit is contained in:
Dark Steveneq
2025-10-09 14:15:47 +02:00
commit 646b892680
49168 changed files with 5897842 additions and 0 deletions

View File

@@ -0,0 +1,51 @@
{
makeScopeWithSplicing',
generateSplicesForMkScope,
callPackage,
attributePathToSplice ? [ "freebsd" ],
branch ? "release/14.2.0",
}:
let
versions = builtins.fromJSON (builtins.readFile ./versions.json);
badBranchError =
branch:
throw ''
Unknown FreeBSD branch ${branch}!
FreeBSD branches normally look like one of:
* `release/<major>.<minor>.0` for tagged releases without security updates
* `releng/<major>.<minor>` for release update branches with security updates
* `stable/<major>` for stable versions working towards the next minor release
* `main` for the latest development version
Branches can be selected by overriding the `branch` attribute on the freebsd package set.
'';
# we do not include the branch in the splice here because the branch
# parameter to this file will only ever take on one value - more values
# are provided through overrides.
otherSplices = generateSplicesForMkScope attributePathToSplice;
in
# `./package-set.nix` should never know the name of the package set we
# are constructing; just this function is allowed to know that. This
# is why we:
#
# - do the splicing for cross compilation here
#
# - construct the *anonymized* `buildFreebsd` attribute to be passed
# to `./package-set.nix`.
makeScopeWithSplicing' {
inherit otherSplices;
f =
self:
{
inherit branch;
}
// callPackage ./package-set.nix {
sourceData = versions.${self.branch} or (throw (badBranchError self.branch));
versionData = self.sourceData.version;
buildFreebsd = otherSplices.selfBuildHost;
patchesRoot = ./patches + "/${self.versionData.revision}";
} self;
}

View File

@@ -0,0 +1,123 @@
{
version,
lib,
writeText,
}:
{
inherit version;
mkBsdArch =
stdenv':
{
x86_64 = "amd64";
aarch64 = "aarch64";
i486 = "i386";
i586 = "i386";
i686 = "i386";
armv6l = "armv6";
armv7l = "armv7";
powerpc = "powerpc";
powerpc64 = "powerpc64";
powerpc64le = "powerpc64le";
riscv64 = "riscv64";
}
.${stdenv'.hostPlatform.parsed.cpu.name} or stdenv'.hostPlatform.parsed.cpu.name;
mkBsdCpuArch =
stdenv':
{
x86_64 = "amd64";
aarch64 = "aarch64";
i486 = "i386";
i586 = "i386";
i686 = "i386";
armv6l = "arm";
armv7l = "arm";
powerpc = "powerpc";
powerpc64 = "powerpc";
powerpc64le = "powerpc";
riscv64 = "riscv";
}
.${stdenv'.hostPlatform.parsed.cpu.name} or stdenv'.hostPlatform.parsed.cpu.name;
mkBsdMachine =
stdenv':
{
x86_64 = "amd64";
aarch64 = "arm64";
i486 = "i386";
i586 = "i386";
i686 = "i386";
armv6l = "arm";
armv7l = "arm";
powerpc = "powerpc";
powerpc64 = "powerpc";
powerpc64le = "powerpc";
riscv64 = "riscv";
}
.${stdenv'.hostPlatform.parsed.cpu.name} or stdenv'.hostPlatform.parsed.cpu.name;
install-wrapper = builtins.readFile ../../lib/install-wrapper.sh;
# this function takes a list of patches and a list of paths and returns a list of derivations,
# one per file that is patched, containing the actual patch contents. This allows us to have
# extract only the patches that are relevant for a given subset of the source tree.
# note: the "list of patches" input can be a directory containing patch files, a path or a list of valid inputs to this argument, recursively.
filterPatches =
patches: paths:
let
isDir =
file:
let
base = baseNameOf file;
type = (builtins.readDir (dirOf file)).${base} or null;
in
file == /. || type == "directory";
consolidatePatches =
patches:
if (lib.isDerivation patches) then
[ patches ]
else if (builtins.isPath patches) then
(if (isDir patches) then (lib.filesystem.listFilesRecursive patches) else [ patches ])
else if (builtins.isList patches) then
(lib.flatten (map consolidatePatches patches))
else
throw "Bad patches - must be path or derivation or list thereof";
consolidated = consolidatePatches patches;
splitPatch =
patchFile:
let
allLines' = lib.strings.splitString "\n" (builtins.readFile patchFile);
allLines = builtins.filter (
line: !((lib.strings.hasPrefix "diff --git" line) || (lib.strings.hasPrefix "index " line))
) allLines';
foldFunc =
a: b:
if ((lib.strings.hasPrefix "--- " b) || (lib.strings.hasPrefix "diff --git " b)) then
(a ++ [ [ b ] ])
else
((lib.lists.init a) ++ (lib.lists.singleton ((lib.lists.last a) ++ [ b ])));
partitionedPatches' = lib.lists.foldl foldFunc [ [ ] ] allLines;
partitionedPatches =
if (builtins.length partitionedPatches' > 1) then
(lib.lists.drop 1 partitionedPatches')
else
(throw "${patchFile} does not seem to be a unified patch (diff -u). this is required for FreeBSD.");
filterFunc =
patchLines:
let
prefixedPath = builtins.elemAt (builtins.split " |\t" (builtins.elemAt patchLines 1)) 2;
unfixedPath = lib.path.subpath.join (lib.lists.drop 1 (lib.path.subpath.components prefixedPath));
in
lib.lists.any (
included: lib.path.hasPrefix (/. + ("/" + included)) (/. + ("/" + unfixedPath))
) paths;
filteredLines = builtins.filter filterFunc partitionedPatches;
derive = patchLines: writeText "freebsd-patch" (lib.concatLines patchLines);
derivedPatches = map derive filteredLines;
in
derivedPatches;
in
lib.lists.concatMap splitPatch consolidated;
}

View File

@@ -0,0 +1,115 @@
{
stdenv,
lib,
stdenvNoCC,
fetchgit,
sourceData,
versionData,
buildFreebsd,
patchesRoot,
writeText,
buildPackages,
}:
self:
lib.packagesFromDirectoryRecursive {
callPackage = self.callPackage;
directory = ./pkgs;
}
// {
inherit sourceData patchesRoot versionData;
# Keep the crawled portion of Nixpkgs finite.
buildFreebsd = lib.dontRecurseIntoAttrs buildFreebsd;
ports = fetchgit {
url = "https://git.FreeBSD.org/ports.git";
rev = "dde3b2b456c3a4bdd217d0bf3684231cc3724a0a";
sha256 = "BpHqJfnGOeTE7tkFJBx0Wk8ryalmf4KNTit/Coh026E=";
};
compatIsNeeded = !stdenvNoCC.hostPlatform.isFreeBSD;
compatIfNeeded = lib.optional self.compatIsNeeded self.compat;
freebsd-lib = import ./lib {
version = lib.concatStringsSep "." (
map toString (
lib.filter (x: x != null) [
self.versionData.major
self.versionData.minor
self.versionData.patch or null
]
)
);
inherit lib writeText;
};
# The manual callPackages below should in principle be unnecessary, but are
# necessary. See note in ../netbsd/default.nix
compat = self.callPackage ./pkgs/compat/package.nix {
inherit stdenv;
inherit (buildFreebsd) makeMinimal;
};
csu = self.callPackage ./pkgs/csu.nix {
inherit (buildFreebsd) makeMinimal install gencat;
inherit (self) include;
};
include = self.callPackage ./pkgs/include/package.nix { inherit (buildFreebsd) rpcgen mtree; };
install = self.callPackage ./pkgs/install.nix {
inherit (buildFreebsd) makeMinimal;
inherit (self) libmd libnetbsd;
};
libcMinimal = self.callPackage ./pkgs/libcMinimal.nix {
inherit (buildFreebsd)
rpcgen
gencat
;
inherit (buildPackages)
flex
byacc
;
};
libc = self.callPackage ./pkgs/libc/package.nix {
inherit (self) libcMinimal librpcsvc libelf;
};
librpcsvc = self.callPackage ./pkgs/librpcsvc.nix {
inherit (buildFreebsd) rpcgen;
};
i18n = self.callPackage ./pkgs/i18n.nix { inherit (buildFreebsd) mkcsmapper mkesdb; };
libelf = self.callPackage ./pkgs/libelf.nix { inherit (buildPackages) m4; };
rtld-elf = self.callPackage ./pkgs/rtld-elf.nix {
inherit (buildFreebsd) rpcgen;
inherit (buildPackages) flex byacc;
};
libnetbsd = self.callPackage ./pkgs/libnetbsd/package.nix { inherit (buildFreebsd) makeMinimal; };
libmd = self.callPackage ./pkgs/libmd.nix { inherit (buildFreebsd) makeMinimal; };
mkDerivation = self.callPackage ./pkgs/mkDerivation.nix {
inherit stdenv;
inherit (buildFreebsd)
freebsdSetupHook
makeMinimal
install
tsort
lorder
;
};
makeMinimal = self.callPackage ./pkgs/makeMinimal.nix { inherit (self) make; };
mtree = self.callPackage ./pkgs/mtree.nix { inherit (self) libnetbsd libmd; };
tsort = self.callPackage ./pkgs/tsort.nix { inherit (buildFreebsd) makeMinimal install; };
}

View File

@@ -0,0 +1,32 @@
--- a/tools/build/cross-build/include/common/sys/_types.h
+++ b/tools/build/cross-build/include/common/sys/_types.h
@@ -47,3 +47,6 @@
* Neither GLibc nor macOS define __va_list but many FreeBSD headers require it.
*/
typedef __builtin_va_list __va_list;
+
+typedef __UINTPTR_TYPE__ __uintptr_t;
+typedef __INTPTR_TYPE__ __intptr_t;
--- a/tools/build/cross-build/include/common/sys/types.h
+++ b/tools/build/cross-build/include/common/sys/types.h
@@ -49,9 +49,6 @@
#include <sys/sysmacros.h>
#endif
-typedef __UINTPTR_TYPE__ __uintptr_t;
-typedef __INTPTR_TYPE__ __intptr_t;
-
/* needed for gencat */
typedef int __nl_item;
--- a/tools/build/cross-build/include/linux/sys/types.h
+++ b/tools/build/cross-build/include/linux/sys/types.h
@@ -39,6 +39,8 @@
#include_next <sys/types.h>
+#include <sys/_types.h>
+
#ifndef __size_t
typedef __SIZE_TYPE__ __size_t;
#endif

View File

@@ -0,0 +1,40 @@
diff --git a/tools/build/Makefile b/tools/build/Makefile
index 948a5f9dfdb..592af84eeae 100644
--- a/tools/build/Makefile
+++ b/tools/build/Makefile
@@ -327,14 +327,14 @@ host-symlinks:
# and cross-tools stages. We do this here using mkdir since mtree may not exist
# yet (this happens if we are crossbuilding from Linux/Mac).
INSTALLDIR_LIST= \
- bin \
- lib/geom \
- usr/include/casper \
- usr/include/private/ucl \
- usr/include/private/zstd \
- usr/lib \
- usr/libdata/pkgconfig \
- usr/libexec
+ ${BINDIR} \
+ ${LIBDIR}/geom \
+ ${INCLUDEDIR}/casper \
+ ${INCLUDEDIR}/private/ucl \
+ ${INCLUDEDIR}/private/zstd \
+ ${LIBDIR} \
+ ${LIBDIR}/libdata/pkgconfig \
+ ${LIBEXECDIR}
installdirs:
mkdir -p ${INSTALLDIR_LIST:S,^,${DESTDIR}/,}
@@ -352,9 +352,9 @@ installdirs:
rm -rf "${DESTDIR}/${_dir}"; \
fi
.endfor
- ln -sfn bin ${DESTDIR}/sbin
- ln -sfn ../bin ${DESTDIR}/usr/bin
- ln -sfn ../bin ${DESTDIR}/usr/sbin
+ ln -sfn bin ${DESTDIR}/${SBINDIR}
+ ln -sfn ../bin ${DESTDIR}/${BINDIR}
+ ln -sfn ../bin ${DESTDIR}/${SBINDIR}
.for _group in ${INCSGROUPS:NINCS}
mkdir -p "${DESTDIR}/${${_group}DIR}"
.endfor

View File

@@ -0,0 +1,11 @@
--- a/lib/libc/Makefile
+++ b/lib/libc/Makefile
@@ -194,7 +194,7 @@ SUBDIR.${MK_TESTS}+= tests
# recording a build dependency
CFLAGS+= -I${SRCTOP}/lib/libutil
# Same issue with libm
-MSUN_ARCH_SUBDIR != ${MAKE} -B -C ${SRCTOP}/lib/msun -V ARCH_SUBDIR
+MSUN_ARCH_SUBDIR = ${MACHINE_CPUARCH:S/i386/i387/}
# unfortunately msun/src contains both private and public headers
CFLAGS+= -I${SRCTOP}/lib/msun/${MSUN_ARCH_SUBDIR}
.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"

View File

@@ -0,0 +1,10 @@
--- a/lib/libc/Makefile
+++ b/lib/libc/Makefile
@@ -58,7 +58,6 @@ CFLAGS+=${CANCELPOINTS_CFLAGS}
# Link with static libcompiler_rt.a.
#
LDFLAGS+= -nodefaultlibs
-LIBADD+= compiler_rt
.if ${MK_SSP} != "no" && \
(${LIBC_ARCH} == "i386" || ${MACHINE_ARCH:Mpower*} != "")

View File

@@ -0,0 +1,32 @@
diff --git a/Makefile b/Makefile
index 22710f3d933..22effc848cf 100644
--- a/lib/libnetbsd/Makefile
+++ b/lib/libnetbsd/Makefile
@@ -9,6 +9,26 @@ CFLAGS+= -I${.CURDIR}
SRCS+= efun.c sockaddr_snprintf.c strsuftoll.c util.c util.h
-INTERNALLIB=
+INCSGROUPS= INCS SYSINCS NETINETINCS
+
+INCS+= \
+ glob.h \
+ pthread.h \
+ rmd160.h \
+ sha1.h \
+ sha2.h \
+ stdlib.h \
+ util.h
+
+SYSINCSDIR= ${INCLUDEDIR}/sys
+SYSINCS+= \
+ sys/cdefs.h \
+ sys/event.h \
+ sys/types.h \
+ sys/wait.h
+
+NETINETINCSDIR= ${INCLUDEDIR}/netinet
+NETINETINCS+= \
+ netinet/in.h
.include <bsd.lib.mk>

View File

@@ -0,0 +1,11 @@
--- a/lib/librpcsvc/Makefile
+++ b/lib/librpcsvc/Makefile
@@ -20,7 +20,7 @@ OTHERSRCS+= yp_passwd.c yp_update.c
RPCCOM= RPCGEN_CPP=${CPP:Q} rpcgen -C
-INCDIRS= -I${SYSROOT:U${DESTDIR}}/usr/include/rpcsvc
+INCDIRS= -I${INCLUDEDIR}/rpcsvc
CFLAGS+= -DYP ${INCDIRS}

View File

@@ -0,0 +1,13 @@
--- a/contrib/mtree/Makefile 2023-12-04 23:02:13.919144141 -0700
+++ b/contrib/mtree/Makefile 2023-12-04 23:02:58.371810109 -0700
@@ -10,8 +10,8 @@
SRCS= compare.c crc.c create.c excludes.c misc.c mtree.c spec.c specspec.c \
verify.c getid.c pack_dev.c only.c
.if (${HOSTPROG:U} == "")
-DPADD+= ${LIBUTIL}
-LDADD+= -lutil
+LIBADD+= ${LIBUTIL}
+#LIBADD+= -lutil
.endif
CPPFLAGS+= -I${NETBSDSRCDIR}/sbin/mknod

View File

@@ -0,0 +1,11 @@
--- a/etc/mtree/BSD.include.dist
+++ b/etc/mtree/BSD.include.dist
@@ -3,7 +3,7 @@
# Please see the file src/etc/mtree/README before making changes to this file.
#
-/set type=dir uname=root gname=wheel mode=0755
+/set type=dir
.
arpa
..

View File

@@ -0,0 +1,13 @@
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

View File

@@ -0,0 +1,45 @@
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:

View File

@@ -0,0 +1,11 @@
--- a/share/mk/src.libnames.mk 2023-12-21 23:56:50.767042385 -0800
+++ b/share/mk/src.libnames.mk 2023-12-21 23:56:39.671089506 -0800
@@ -392,7 +392,7 @@
_DP_ztest= geom m nvpair umem zpool pthread avl zfs_core spl zutil zfs uutil icp
# The libc dependencies are not strictly needed but are defined to make the
# assert happy.
-_DP_c= compiler_rt
+_DP_c=
# Use libssp_nonshared only on i386 and power*. Other archs emit direct calls
# to __stack_chk_fail, not __stack_chk_fail_local provided by libssp_nonshared.
.if ${MK_SSP} != "no" && \

View File

@@ -0,0 +1,32 @@
--- a/tools/build/cross-build/include/common/sys/_types.h
+++ b/tools/build/cross-build/include/common/sys/_types.h
@@ -47,3 +47,6 @@
* Neither GLibc nor macOS define __va_list but many FreeBSD headers require it.
*/
typedef __builtin_va_list __va_list;
+
+typedef __UINTPTR_TYPE__ __uintptr_t;
+typedef __INTPTR_TYPE__ __intptr_t;
--- a/tools/build/cross-build/include/common/sys/types.h
+++ b/tools/build/cross-build/include/common/sys/types.h
@@ -49,9 +49,6 @@
#include <sys/sysmacros.h>
#endif
-typedef __UINTPTR_TYPE__ __uintptr_t;
-typedef __INTPTR_TYPE__ __intptr_t;
-
/* needed for gencat */
typedef int __nl_item;
--- a/tools/build/cross-build/include/linux/sys/types.h
+++ b/tools/build/cross-build/include/linux/sys/types.h
@@ -39,6 +39,8 @@
#include_next <sys/types.h>
+#include <sys/_types.h>
+
#ifndef __size_t
typedef __SIZE_TYPE__ __size_t;
#endif

View File

@@ -0,0 +1,40 @@
diff --git a/tools/build/Makefile b/tools/build/Makefile
index 948a5f9dfdb..592af84eeae 100644
--- a/tools/build/Makefile
+++ b/tools/build/Makefile
@@ -327,14 +327,14 @@ host-symlinks:
# and cross-tools stages. We do this here using mkdir since mtree may not exist
# yet (this happens if we are crossbuilding from Linux/Mac).
INSTALLDIR_LIST= \
- bin \
- lib/geom \
- usr/include/casper \
- usr/include/private/ucl \
- usr/include/private/zstd \
- usr/lib \
- usr/libdata/pkgconfig \
- usr/libexec
+ ${BINDIR} \
+ ${LIBDIR}/geom \
+ ${INCLUDEDIR}/casper \
+ ${INCLUDEDIR}/private/ucl \
+ ${INCLUDEDIR}/private/zstd \
+ ${LIBDIR} \
+ ${LIBDIR}/libdata/pkgconfig \
+ ${LIBEXECDIR}
installdirs:
mkdir -p ${INSTALLDIR_LIST:S,^,${DESTDIR}/,}
@@ -352,9 +352,9 @@ installdirs:
rm -rf "${DESTDIR}/${_dir}"; \
fi
.endfor
- ln -sfn bin ${DESTDIR}/sbin
- ln -sfn ../bin ${DESTDIR}/usr/bin
- ln -sfn ../bin ${DESTDIR}/usr/sbin
+ ln -sfn bin ${DESTDIR}/${SBINDIR}
+ ln -sfn ../bin ${DESTDIR}/${BINDIR}
+ ln -sfn ../bin ${DESTDIR}/${SBINDIR}
.for _group in ${INCSGROUPS:NINCS}
mkdir -p "${DESTDIR}/${${_group}DIR}"
.endfor

View File

@@ -0,0 +1,18 @@
diff --git a/sbin/fsck/fsck.c b/sbin/fsck/fsck.c
index 3757ed062ba5..584ada116386 100644
--- a/sbin/fsck/fsck.c
+++ b/sbin/fsck/fsck.c
@@ -375,11 +375,8 @@ checkfs(const char *pvfstype, const char *spec, const char *mntpt,
_exit(0);
/* Go find an executable. */
- execvP(execbase, _PATH_SYSPATH, __DECONST(char * const *, argv));
- if (spec)
- warn("exec %s for %s in %s", execbase, spec, _PATH_SYSPATH);
- else
- warn("exec %s in %s", execbase, _PATH_SYSPATH);
+ execvp(execbase, __DECONST(char * const *, argv));
+ warn("exec %s not found", execbase);
_exit(1);
/* NOTREACHED */

View File

@@ -0,0 +1,11 @@
--- a/usr.bin/xinstall/Makefile 2023-09-23 19:18:49.165192183 -0700
+++ b/usr.bin/xinstall/Makefile 2023-12-06 17:06:57.836888028 -0700
@@ -14,7 +14,7 @@
CFLAGS+= -I${SRCTOP}/lib/libnetbsd
LIBADD= md
-CFLAGS+= -DWITH_MD5 -DWITH_RIPEMD160
+CFLAGS+= -I${BSDSRCDIR}/contrib/libc-vis -I${BSDSRCDIR}/lib/libnetbsd
.ifdef BOOTSTRAPPING
# For the bootstrap we disable copy_file_range()

View File

@@ -0,0 +1,112 @@
In a NixOS-like system, it doesn't make sense to hardcode these absolute paths.
They even already use execvp!
diff --git a/usr.sbin/jail/command.c b/usr.sbin/jail/command.c
index 9004b4729fec..669e85ed847e 100644
--- a/usr.sbin/jail/command.c
+++ b/usr.sbin/jail/command.c
@@ -363,7 +363,7 @@ run_command(struct cfjail *j)
}
argv = alloca((8 + argc) * sizeof(char *));
- argv[0] = _PATH_IFCONFIG;
+ argv[0] = "ifconfig";
if ((cs = strchr(val, '|'))) {
argv[1] = acs = alloca(cs - val + 1);
strlcpy(acs, val, cs - val + 1);
@@ -420,7 +420,7 @@ run_command(struct cfjail *j)
}
argv = alloca((8 + argc) * sizeof(char *));
- argv[0] = _PATH_IFCONFIG;
+ argv[0] = "ifconfig";
if ((cs = strchr(val, '|'))) {
argv[1] = acs = alloca(cs - val + 1);
strlcpy(acs, val, cs - val + 1);
@@ -454,7 +454,7 @@ run_command(struct cfjail *j)
case IP_VNET_INTERFACE:
argv = alloca(5 * sizeof(char *));
- argv[0] = _PATH_IFCONFIG;
+ argv[0] = "ifconfig";
argv[1] = comstring->s;
argv[2] = down ? "-vnet" : "vnet";
jidstr = string_param(j->intparams[KP_JID]);
@@ -490,7 +490,7 @@ run_command(struct cfjail *j)
if (down) {
argv[4] = NULL;
argv[3] = argv[1];
- argv[0] = "/sbin/umount";
+ argv[0] = "umount";
} else {
if (argc == 4) {
argv[7] = NULL;
@@ -503,7 +503,7 @@ run_command(struct cfjail *j)
argv[4] = argv[1];
argv[3] = argv[0];
}
- argv[0] = _PATH_MOUNT;
+ argv[0] = "mount";
}
argv[1] = "-t";
break;
@@ -521,11 +521,11 @@ run_command(struct cfjail *j)
down ? "devfs" : NULL) < 0)
return -1;
if (down) {
- argv[0] = "/sbin/umount";
+ argv[0] = "umount";
argv[1] = devpath;
argv[2] = NULL;
} else {
- argv[0] = _PATH_MOUNT;
+ argv[0] = "mount";
argv[1] = "-t";
argv[2] = "devfs";
ruleset = string_param(j->intparams[KP_DEVFS_RULESET]);
@@ -552,11 +552,11 @@ run_command(struct cfjail *j)
down ? "fdescfs" : NULL) < 0)
return -1;
if (down) {
- argv[0] = "/sbin/umount";
+ argv[0] = "umount";
argv[1] = devpath;
argv[2] = NULL;
} else {
- argv[0] = _PATH_MOUNT;
+ argv[0] = "mount";
argv[1] = "-t";
argv[2] = "fdescfs";
argv[3] = ".";
@@ -578,11 +578,11 @@ run_command(struct cfjail *j)
down ? "procfs" : NULL) < 0)
return -1;
if (down) {
- argv[0] = "/sbin/umount";
+ argv[0] = "umount";
argv[1] = devpath;
argv[2] = NULL;
} else {
- argv[0] = _PATH_MOUNT;
+ argv[0] = "mount";
argv[1] = "-t";
argv[2] = "procfs";
argv[3] = ".";
@@ -610,7 +610,7 @@ run_command(struct cfjail *j)
if ((cs = strpbrk(comstring->s, "!\"$&'()*;<>?[\\]`{|}~")) &&
!(cs[0] == '&' && cs[1] == '\0')) {
argv = alloca(4 * sizeof(char *));
- argv[0] = _PATH_BSHELL;
+ argv[0] = "sh";
argv[1] = "-c";
argv[2] = comstring->s;
argv[3] = NULL;
@@ -763,7 +763,7 @@ run_command(struct cfjail *j)
setenv("USER", pwd->pw_name, 1);
setenv("HOME", pwd->pw_dir, 1);
setenv("SHELL",
- *pwd->pw_shell ? pwd->pw_shell : _PATH_BSHELL, 1);
+ *pwd->pw_shell ? pwd->pw_shell : "sh", 1);
if (clean && username && chdir(pwd->pw_dir) < 0) {
jail_warnx(j, "chdir %s: %s",
pwd->pw_dir, strerror(errno));

View File

@@ -0,0 +1,11 @@
--- a/lib/libc/Makefile
+++ b/lib/libc/Makefile
@@ -194,7 +194,7 @@ SUBDIR.${MK_TESTS}+= tests
# recording a build dependency
CFLAGS+= -I${SRCTOP}/lib/libutil
# Same issue with libm
-MSUN_ARCH_SUBDIR != ${MAKE} -B -C ${SRCTOP}/lib/msun -V ARCH_SUBDIR
+MSUN_ARCH_SUBDIR = ${MACHINE_CPUARCH:S/i386/i387/}
# unfortunately msun/src contains both private and public headers
CFLAGS+= -I${SRCTOP}/lib/msun/${MSUN_ARCH_SUBDIR}
.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"

View File

@@ -0,0 +1,10 @@
--- a/lib/libc/Makefile
+++ b/lib/libc/Makefile
@@ -58,7 +58,6 @@ CFLAGS+=${CANCELPOINTS_CFLAGS}
# Link with static libcompiler_rt.a.
#
LDFLAGS+= -nodefaultlibs
-LIBADD+= compiler_rt
.if ${MK_SSP} != "no" && \
(${LIBC_ARCH} == "i386" || ${MACHINE_ARCH:Mpower*} != "")

View File

@@ -0,0 +1,11 @@
--- freebsd/lib/libcxxrt/Makefile 2024-05-30 14:27:42.328086005 -0700
+++ freebsd/lib/libcxxrt/Makefile.mod 2024-05-30 14:27:48.048014581 -0700
@@ -19,6 +19,8 @@
SRCS+= terminate.cc
SRCS+= typeinfo.cc
+INCS+=cxxabi.h
+
WARNS?= 0
CFLAGS+= -isystem ${SRCDIR} -nostdinc++
CXXSTD?= c++14

View File

@@ -0,0 +1,13 @@
diff --git a/lib/libelf/Makefile b/lib/libelf/Makefile
index c15ce2798a91..d6d8754e2b4f 100644
--- a/lib/libelf/Makefile
+++ b/lib/libelf/Makefile
@@ -80,7 +80,7 @@ INCS= libelf.h gelf.h
SRCS+= sys/elf32.h sys/elf64.h sys/elf_common.h
# Allow bootstrapping elftoolchain on Linux:
-.if defined(BOOTSTRAPPING) && ${.MAKE.OS} == "Linux"
+.if defined(BOOTSTRAPPING)
native-elf-format.h:
${ELFTCDIR}/common/native-elf-format > ${.TARGET} || rm ${.TARGET}
SRCS+= native-elf-format.h

View File

@@ -0,0 +1,36 @@
diff --git a/lib/libifconfig/Makefile b/lib/libifconfig/Makefile
index 6bdb202bec1d..ebc626901cfc 100644
--- a/lib/libifconfig/Makefile
+++ b/lib/libifconfig/Makefile
@@ -1,7 +1,6 @@
PACKAGE= lib${LIB}
LIB= ifconfig
-INTERNALLIB= true
LIBADD= m
@@ -36,8 +35,8 @@ SRCS+= ${GEN}
CLEANFILES+= ${GEN}
# If libifconfig become public uncomment those two lines
-#INCSDIR= ${INCLUDEDIR}
-#INCS= libifconfig.h libifconfig_sfp.h libifconfig_sfp_tables.h
+INCSDIR= ${INCLUDEDIR}
+INCS= libifconfig.h libifconfig_sfp.h libifconfig_sfp_tables.h
#MAN= libifconfig.3
diff --git a/lib/libifconfig/Symbol.map b/lib/libifconfig/Symbol.map
index 2d80fb31652a..8b08947112e5 100644
--- a/lib/libifconfig/Symbol.map
+++ b/lib/libifconfig/Symbol.map
@@ -2,6 +2,8 @@ FBSD_1.6 {
ifconfig_bridge_get_bridge_status;
ifconfig_bridge_free_bridge_status;
ifconfig_carp_get_info;
+ ifconfig_carp_get_vhid;
+ ifconfig_carp_set_info;
ifconfig_close;
ifconfig_create_interface;
ifconfig_create_interface_vlan;

View File

@@ -0,0 +1,32 @@
diff --git a/Makefile b/Makefile
index 22710f3d933..22effc848cf 100644
--- a/lib/libnetbsd/Makefile
+++ b/lib/libnetbsd/Makefile
@@ -9,6 +9,26 @@ CFLAGS+= -I${.CURDIR}
SRCS+= efun.c sockaddr_snprintf.c strsuftoll.c util.c util.h
-INTERNALLIB=
+INCSGROUPS= INCS SYSINCS NETINETINCS
+
+INCS+= \
+ glob.h \
+ pthread.h \
+ rmd160.h \
+ sha1.h \
+ sha2.h \
+ stdlib.h \
+ util.h
+
+SYSINCSDIR= ${INCLUDEDIR}/sys
+SYSINCS+= \
+ sys/cdefs.h \
+ sys/event.h \
+ sys/types.h \
+ sys/wait.h
+
+NETINETINCSDIR= ${INCLUDEDIR}/netinet
+NETINETINCS+= \
+ netinet/in.h
.include <bsd.lib.mk>

View File

@@ -0,0 +1,11 @@
--- a/lib/librpcsvc/Makefile
+++ b/lib/librpcsvc/Makefile
@@ -20,7 +20,7 @@ OTHERSRCS+= yp_passwd.c yp_update.c
RPCCOM= RPCGEN_CPP=${CPP:Q} rpcgen -C
-INCDIRS= -I${SYSROOT:U${DESTDIR}}/usr/include/rpcsvc
+INCDIRS= -I${INCLUDEDIR}/rpcsvc
CFLAGS+= -DYP ${INCDIRS}

View File

@@ -0,0 +1,158 @@
diff --git a/include/_ctype.h b/include/_ctype.h
index 91e6b1d14f6b..a6896b598da3 100644
--- a/include/_ctype.h
+++ b/include/_ctype.h
@@ -44,7 +44,7 @@
#define __CTYPE_H_
#include <sys/cdefs.h>
-#include <sys/_types.h>
+#include <sys/types.h>
#define _CTYPE_A 0x00000100L /* Alpha */
#define _CTYPE_C 0x00000200L /* Control */
diff --git a/lib/libc/locale/collate.h b/lib/libc/locale/collate.h
index 2d3723b49f5b..6bbff732b9d7 100644
--- a/lib/libc/locale/collate.h
+++ b/lib/libc/locale/collate.h
@@ -36,6 +36,7 @@
#ifndef _COLLATE_H_
#define _COLLATE_H_
+#include <stdint.h>
#include <sys/types.h>
#include <limits.h>
#include "xlocale_private.h"
diff --git a/usr.bin/localedef/charmap.c b/usr.bin/localedef/charmap.c
index 44b7e3292eae..79c30b7cf372 100644
--- a/usr.bin/localedef/charmap.c
+++ b/usr.bin/localedef/charmap.c
@@ -31,6 +31,7 @@
/*
* CHARMAP file handling for localedef.
*/
+#include <stdint.h>
#include <sys/cdefs.h>
#include <sys/types.h>
#include <sys/tree.h>
diff --git a/usr.bin/localedef/collate.c b/usr.bin/localedef/collate.c
index 2a080773a95e..3f0030c638f5 100644
--- a/usr.bin/localedef/collate.c
+++ b/usr.bin/localedef/collate.c
@@ -31,6 +31,7 @@
/*
* LC_COLLATE database generation routines for localedef.
*/
+#include <stdint.h>
#include <sys/cdefs.h>
#include <sys/types.h>
#include <sys/tree.h>
diff --git a/usr.bin/localedef/ctype.c b/usr.bin/localedef/ctype.c
index ab7b76e57b2d..846c6d6480a8 100644
--- a/usr.bin/localedef/ctype.c
+++ b/usr.bin/localedef/ctype.c
@@ -32,6 +32,7 @@
/*
* LC_CTYPE database generation routines for localedef.
*/
+#include <stdint.h>
#include <sys/cdefs.h>
#include <sys/tree.h>
diff --git a/usr.bin/localedef/localedef.c b/usr.bin/localedef/localedef.c
index 5ff146d6f655..ed69aa1f0c0e 100644
--- a/usr.bin/localedef/localedef.c
+++ b/usr.bin/localedef/localedef.c
@@ -32,7 +32,7 @@
* POSIX localedef.
*/
#include <sys/cdefs.h>
-#include <sys/endian.h>
+#include <endian.h>
#include <sys/stat.h>
#include <sys/types.h>
diff --git a/usr.bin/localedef/messages.c b/usr.bin/localedef/messages.c
index 6b8eb9d684dd..0155821d0e56 100644
--- a/usr.bin/localedef/messages.c
+++ b/usr.bin/localedef/messages.c
@@ -31,6 +31,7 @@
/*
* LC_MESSAGES database generation routines for localedef.
*/
+#include <stdint.h>
#include <sys/cdefs.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/usr.bin/localedef/monetary.c b/usr.bin/localedef/monetary.c
index 7a77ac7e256c..7636c4deca1f 100644
--- a/usr.bin/localedef/monetary.c
+++ b/usr.bin/localedef/monetary.c
@@ -31,6 +31,7 @@
/*
* LC_MONETARY database generation routines for localedef.
*/
+#include <stdint.h>
#include <sys/cdefs.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/usr.bin/localedef/numeric.c b/usr.bin/localedef/numeric.c
index 5533b7c10e1a..9c47494f815c 100644
--- a/usr.bin/localedef/numeric.c
+++ b/usr.bin/localedef/numeric.c
@@ -31,6 +31,7 @@
/*
* LC_NUMERIC database generation routines for localedef.
*/
+#include <stdint.h>
#include <sys/cdefs.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/usr.bin/localedef/parser.y b/usr.bin/localedef/parser.y
index 23b3b54f8a6e..e01330f0152d 100644
--- a/usr.bin/localedef/parser.y
+++ b/usr.bin/localedef/parser.y
@@ -33,6 +33,7 @@
* POSIX localedef grammar.
*/
+#include <stdint.h>
#include <wchar.h>
#include <stdio.h>
#include <limits.h>
diff --git a/usr.bin/localedef/scanner.c b/usr.bin/localedef/scanner.c
index c6d45a993f28..b17670ef4b4a 100644
--- a/usr.bin/localedef/scanner.c
+++ b/usr.bin/localedef/scanner.c
@@ -32,6 +32,7 @@
* This file contains the "scanner", which tokenizes the input files
* for localedef for processing by the higher level grammar processor.
*/
+#include <stdint.h>
#include <sys/cdefs.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/usr.bin/localedef/time.c b/usr.bin/localedef/time.c
index 7a56e244c921..0e409a742d0a 100644
--- a/usr.bin/localedef/time.c
+++ b/usr.bin/localedef/time.c
@@ -31,6 +31,7 @@
/*
* LC_TIME database generation routines for localedef.
*/
+#include <stdint.h>
#include <sys/cdefs.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/usr.bin/localedef/wide.c b/usr.bin/localedef/wide.c
index 062e120e6912..a199cddb198d 100644
--- a/usr.bin/localedef/wide.c
+++ b/usr.bin/localedef/wide.c
@@ -34,6 +34,7 @@
* to the wide character forms used internally by libc. Unfortunately,
* this approach means that we need a method for each and every encoding.
*/
+#include <stdint.h>
#include <sys/cdefs.h>
#include <ctype.h>
#include <stdlib.h>

View File

@@ -0,0 +1,30 @@
The freebsd makefs code is imported directly from netbsd, with minor changes.
One of these changes is commenting out a piece of code we need in order to
cross-build filesystem images for openbsd with nix: the ability to copy device
node information from an mtree. This is especially important in nix because the
only other way to generate device nodes is to have them be resident on the
build system's filesystem, which is not possible without root, and openbsd does
not have a devfs and requires that all device nodes are simply present on the
root filesystem in order to boot.
Uncomment it.
diff --git a/usr.sbin/makefs/walk.c b/usr.sbin/makefs/walk.c
index 56e2d19c6f00..c3bf8faac2aa 100644
--- a/usr.sbin/makefs/walk.c
+++ b/usr.sbin/makefs/walk.c
@@ -540,12 +540,12 @@ apply_specentry(const char *dir, NODE *specnode, fsnode *dirnode)
dirnode->inode->st.st_flags = specnode->st_flags;
}
#endif
-/* if (specnode->flags & F_DEV) {
+ if (specnode->flags & F_DEV) {
ASEPRINT("rdev", "%#llx",
(unsigned long long)dirnode->inode->st.st_rdev,
(unsigned long long)specnode->st_rdev);
dirnode->inode->st.st_rdev = specnode->st_rdev;
- }*/
+ }
#undef ASEPRINT
dirnode->flags |= FSNODE_F_HASSPEC;

View File

@@ -0,0 +1,154 @@
diff --git a/share/mk/bsd.incs.mk b/share/mk/bsd.incs.mk
index df4cf4641141..a87c7f9db03a 100644
--- a/share/mk/bsd.incs.mk
+++ b/share/mk/bsd.incs.mk
@@ -63,8 +63,8 @@ stage_includes: stage_as.${header:T}
installincludes: _${group}INS_${header:T}
_${group}INS_${header:T}: ${header}
- ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},dev} -C -o ${${group}OWN_${.ALLSRC:T}} \
- -g ${${group}GRP_${.ALLSRC:T}} -m ${${group}MODE_${.ALLSRC:T}} \
+ ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},dev} -C \
+ -m ${${group}MODE_${.ALLSRC:T}} \
${.ALLSRC} \
${DESTDIR}${${group}DIR_${.ALLSRC:T}}/${${group}NAME_${.ALLSRC:T}}
.else
@@ -78,10 +78,10 @@ stage_includes: stage_files.${group}
installincludes: _${group}INS
_${group}INS: ${_${group}INCS}
.if defined(${group}NAME)
- ${INSTALL} ${${group}TAG_ARGS} -C -o ${${group}OWN} -g ${${group}GRP} -m ${${group}MODE} \
+ ${INSTALL} ${${group}TAG_ARGS} -C -m ${${group}MODE} \
${.ALLSRC} ${DESTDIR}${${group}DIR}/${${group}NAME}
.else
- ${INSTALL} ${${group}TAG_ARGS} -C -o ${${group}OWN} -g ${${group}GRP} -m ${${group}MODE} \
+ ${INSTALL} ${${group}TAG_ARGS} -C -m ${${group}MODE} \
${.ALLSRC} ${DESTDIR}${${group}DIR}/
.endif
.endif # !empty(_${group}INCS)
diff --git a/share/mk/bsd.lib.mk b/share/mk/bsd.lib.mk
index 5f328d5378ca..264bbcc84ffb 100644
--- a/share/mk/bsd.lib.mk
+++ b/share/mk/bsd.lib.mk
@@ -242,7 +242,7 @@ PO_FLAG=-pg
_LIBDIR:=${LIBDIR}
_SHLIBDIR:=${SHLIBDIR}
-.if defined(SHLIB_NAME)
+.if defined(SHLIB_NAME) && !empty(SHLIB_NAME)
.if ${MK_DEBUG_FILES} != "no"
SHLIB_NAME_FULL=${SHLIB_NAME}.full
# Use ${DEBUGDIR} for base system debug files, else .debug subdirectory
@@ -277,7 +277,7 @@ LDFLAGS+= -Wl,--undefined-version
.endif
.endif
-.if defined(LIB) && !empty(LIB) || defined(SHLIB_NAME)
+.if defined(LIB) && !empty(LIB) || (defined(SHLIB_NAME) && !empty(SHLIB_NAME))
OBJS+= ${SRCS:N*.h:${OBJS_SRCS_FILTER:ts:}:S/$/.o/}
BCOBJS+= ${SRCS:N*.[hsS]:N*.asm:${OBJS_SRCS_FILTER:ts:}:S/$/.bco/g}
LLOBJS+= ${SRCS:N*.[hsS]:N*.asm:${OBJS_SRCS_FILTER:ts:}:S/$/.llo/g}
@@ -320,14 +320,14 @@ lib${LIB_PRIVATE}${LIB}.ll: ${LLOBJS}
CLEANFILES+= lib${LIB_PRIVATE}${LIB}.bc lib${LIB_PRIVATE}${LIB}.ll
.endif
-.if defined(SHLIB_NAME) || \
+.if (defined(SHLIB_NAME) && !empty(SHLIB_NAME)) || \
defined(INSTALL_PIC_ARCHIVE) && defined(LIB) && !empty(LIB)
SOBJS+= ${OBJS:.o=.pico}
DEPENDOBJS+= ${SOBJS}
CLEANFILES+= ${SOBJS}
.endif
-.if defined(SHLIB_NAME)
+.if defined(SHLIB_NAME) && !empty(SHLIB_NAME)
_LIBS+= ${SHLIB_NAME}
SOLINKOPTS+= -shared -Wl,-x
@@ -435,7 +435,7 @@ all: all-man
CLEANFILES+= ${_LIBS}
_EXTRADEPEND:
-.if !defined(NO_EXTRADEPEND) && defined(SHLIB_NAME)
+.if !defined(NO_EXTRADEPEND) && defined(SHLIB_NAME) && !empty(SHLIB_NAME)
.if defined(DPADD) && !empty(DPADD)
echo ${SHLIB_NAME_FULL}: ${DPADD} >> ${DEPENDFILE}
.endif
@@ -482,7 +482,7 @@ _SHLINSTALLFLAGS:= ${_SHLINSTALLFLAGS${ie}}
installpcfiles: installpcfiles-${pcfile}
installpcfiles-${pcfile}: ${pcfile}
- ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},dev} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
+ ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},dev} -m ${LIBMODE} \
${_INSTALLFLAGS} \
${.ALLSRC} ${DESTDIR}${LIBDATADIR}/pkgconfig/
.endfor
@@ -494,28 +494,28 @@ realinstall: _libinstall installpcfiles
.ORDER: beforeinstall _libinstall
_libinstall:
.if defined(LIB) && !empty(LIB) && ${MK_INSTALLLIB} != "no"
- ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},dev} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
+ ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},dev} -m ${LIBMODE} \
${_INSTALLFLAGS} lib${LIB_PRIVATE}${LIB}${_STATICLIB_SUFFIX}.a ${DESTDIR}${_LIBDIR}/
.if ${MK_PROFILE} != "no"
- ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},dev} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
+ ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},dev} -m ${LIBMODE} \
${_INSTALLFLAGS} lib${LIB_PRIVATE}${LIB}_p.a ${DESTDIR}${_LIBDIR}/
.endif
.endif
-.if defined(SHLIB_NAME)
- ${INSTALL} ${TAG_ARGS} ${STRIP} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
+.if defined(SHLIB_NAME) && !empty(SHLIB_NAME)
+ ${INSTALL} ${TAG_ARGS} ${STRIP} -m ${LIBMODE} \
${_INSTALLFLAGS} ${_SHLINSTALLFLAGS} \
${SHLIB_NAME} ${DESTDIR}${_SHLIBDIR}/
.if ${MK_DEBUG_FILES} != "no"
.if defined(DEBUGMKDIR)
${INSTALL} ${TAG_ARGS:D${TAG_ARGS},dbg} -d ${DESTDIR}${DEBUGFILEDIR}/
.endif
- ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},dbg} -o ${LIBOWN} -g ${LIBGRP} -m ${DEBUGMODE} \
+ ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},dbg} -m ${DEBUGMODE} \
${_INSTALLFLAGS} \
${SHLIB_NAME}.debug ${DESTDIR}${DEBUGFILEDIR}/
.endif
.if defined(SHLIB_LINK)
.if commands(${SHLIB_LINK:R}.ld)
- ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},dev} -S -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
+ ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},dev} -S -m ${LIBMODE} \
${_INSTALLFLAGS} ${SHLIB_LINK:R}.ld \
${DESTDIR}${_LIBDIR}/${SHLIB_LINK}
.for _SHLIB_LINK_LINK in ${SHLIB_LDSCRIPT_LINKS}
@@ -548,7 +548,7 @@ _libinstall:
.endif # SHLIB_LINK
.endif # SHIB_NAME
.if defined(INSTALL_PIC_ARCHIVE) && defined(LIB) && !empty(LIB)
- ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},dev} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
+ ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},dev} -m ${LIBMODE} \
${_INSTALLFLAGS} lib${LIB}_pic.a ${DESTDIR}${_LIBDIR}/
.endif
.endif # !defined(INTERNALLIB)
@@ -588,7 +588,7 @@ OBJS_DEPEND_GUESS+= ${SRCS:M*.h}
OBJS_DEPEND_GUESS.${_S:${OBJS_SRCS_FILTER:ts:}}.po+= ${_S}
.endfor
.endif
-.if defined(SHLIB_NAME) || \
+.if (defined(SHLIB_NAME) && !empty(SHLIB_NAME)) || \
defined(INSTALL_PIC_ARCHIVE) && defined(LIB) && !empty(LIB)
.for _S in ${SRCS:N*.[hly]}
OBJS_DEPEND_GUESS.${_S:${OBJS_SRCS_FILTER:ts:}}.pico+= ${_S}
diff --git a/share/mk/bsd.man.mk b/share/mk/bsd.man.mk
index 04316c46b705..9ad3c8ce70e7 100644
--- a/share/mk/bsd.man.mk
+++ b/share/mk/bsd.man.mk
@@ -50,9 +50,9 @@
.endif
.if ${MK_MANSPLITPKG} == "no"
-MINSTALL?= ${INSTALL} ${TAG_ARGS} -o ${MANOWN} -g ${MANGRP} -m ${MANMODE}
+MINSTALL?= ${INSTALL} ${TAG_ARGS} -m ${MANMODE}
.else
-MINSTALL?= ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},man} -o ${MANOWN} -g ${MANGRP} -m ${MANMODE}
+MINSTALL?= ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},man} -m ${MANMODE}
.endif
CATDIR= ${MANDIR:H:S/$/\/cat/}

View File

@@ -0,0 +1,44 @@
diff --git a/usr.bin/mkimg/gpt.c b/usr.bin/mkimg/gpt.c
index ed3f008c394f..b4fb98682a4c 100644
--- a/usr.bin/mkimg/gpt.c
+++ b/usr.bin/mkimg/gpt.c
@@ -50,6 +50,7 @@ static mkimg_uuid_t gpt_uuid_freebsd_zfs = GPT_ENT_TYPE_FREEBSD_ZFS;
static mkimg_uuid_t gpt_uuid_mbr = GPT_ENT_TYPE_MBR;
static mkimg_uuid_t gpt_uuid_ms_basic_data = GPT_ENT_TYPE_MS_BASIC_DATA;
static mkimg_uuid_t gpt_uuid_prep_boot = GPT_ENT_TYPE_PREP_BOOT;
+static mkimg_uuid_t gpt_uuid_openbsd_ufs = GPT_ENT_TYPE_OPENBSD_DATA;
static struct mkimg_alias gpt_aliases[] = {
{ ALIAS_EFI, ALIAS_PTR2TYPE(&gpt_uuid_efi) },
@@ -63,6 +64,7 @@ static struct mkimg_alias gpt_aliases[] = {
{ ALIAS_MBR, ALIAS_PTR2TYPE(&gpt_uuid_mbr) },
{ ALIAS_NTFS, ALIAS_PTR2TYPE(&gpt_uuid_ms_basic_data) },
{ ALIAS_PPCBOOT, ALIAS_PTR2TYPE(&gpt_uuid_prep_boot) },
+ { ALIAS_OPENBSD_UFS, ALIAS_PTR2TYPE(&gpt_uuid_openbsd_ufs) },
{ ALIAS_NONE, 0 } /* Keep last! */
};
diff --git a/usr.bin/mkimg/scheme.c b/usr.bin/mkimg/scheme.c
index 85ed94013e8d..00a3432c5328 100644
--- a/usr.bin/mkimg/scheme.c
+++ b/usr.bin/mkimg/scheme.c
@@ -56,6 +56,7 @@ static struct {
{ "mbr", ALIAS_MBR },
{ "ntfs", ALIAS_NTFS },
{ "prepboot", ALIAS_PPCBOOT },
+ { "openbsd-ufs", ALIAS_OPENBSD_UFS },
{ NULL, ALIAS_NONE } /* Keep last! */
};
diff --git a/usr.bin/mkimg/scheme.h b/usr.bin/mkimg/scheme.h
index 52614255595f..0c44f8653af2 100644
--- a/usr.bin/mkimg/scheme.h
+++ b/usr.bin/mkimg/scheme.h
@@ -45,6 +45,7 @@ enum alias {
ALIAS_MBR,
ALIAS_NTFS,
ALIAS_PPCBOOT,
+ ALIAS_OPENBSD_UFS,
/* end */
ALIAS_COUNT /* Keep last! */
};

View File

@@ -0,0 +1,18 @@
diff --git a/sbin/mount/mount.c b/sbin/mount/mount.c
index 2fcc94e40818..7de6da1bb20e 100644
--- a/sbin/mount/mount.c
+++ b/sbin/mount/mount.c
@@ -155,12 +155,9 @@ exec_mountprog(const char *name, const char *execname, char *const argv[])
EXIT(1);
case 0: /* Child. */
/* Go find an executable. */
- execvP(execname, _PATH_SYSPATH, argv);
+ execvp(execname, argv);
if (errno == ENOENT) {
xo_warn("exec %s not found", execname);
- if (execname[0] != '/') {
- xo_warnx("in path: %s", _PATH_SYSPATH);
- }
}
EXIT(1);
default: /* Parent. */

View File

@@ -0,0 +1,13 @@
--- a/contrib/mtree/Makefile 2023-12-04 23:02:13.919144141 -0700
+++ b/contrib/mtree/Makefile 2023-12-04 23:02:58.371810109 -0700
@@ -10,8 +10,8 @@
SRCS= compare.c crc.c create.c excludes.c misc.c mtree.c spec.c specspec.c \
verify.c getid.c pack_dev.c only.c
.if (${HOSTPROG:U} == "")
-DPADD+= ${LIBUTIL}
-LDADD+= -lutil
+LIBADD+= ${LIBUTIL}
+#LIBADD+= -lutil
.endif
CPPFLAGS+= -I${NETBSDSRCDIR}/sbin/mknod

View File

@@ -0,0 +1,11 @@
--- a/etc/mtree/BSD.include.dist
+++ b/etc/mtree/BSD.include.dist
@@ -3,7 +3,7 @@
# Please see the file src/etc/mtree/README before making changes to this file.
#
-/set type=dir uname=root gname=wheel mode=0755
+/set type=dir
.
arpa
..

View File

@@ -0,0 +1,17 @@
diff --git a/libexec/rc/rc b/libexec/rc/rc
index 0ea61a4b2c0a..d9bfb228224c 100644
--- a/libexec/rc/rc
+++ b/libexec/rc/rc
@@ -87,6 +87,12 @@ if ! [ -e ${firstboot_sentinel} ]; then
skip_firstboot="-s firstboot"
fi
+if [ -z "$USER_LOGIN" ]; then
+ skip="$skip -s user"
+else
+ skip="$skip -k user"
+fi
+
# Do a first pass to get everything up to $early_late_divider so that
# we can do a second pass that includes $local_startup directories
#

View File

@@ -0,0 +1,13 @@
diff --git a/libexec/rtld-elf/Makefile b/libexec/rtld-elf/Makefile
index 0dbd2b8aa935..241d7a78e208 100644
--- a/libexec/rtld-elf/Makefile
+++ b/libexec/rtld-elf/Makefile
@@ -54,7 +54,7 @@ NO_WCAST_ALIGN= yes
INSTALLFLAGS= -C -b
PRECIOUSPROG=
BINDIR= /libexec
-SYMLINKS= ../..${BINDIR}/${PROG} ${LIBEXECDIR}/${PROG}
+SYMLINKS= ${BINDIR}/${PROG} ${LIBEXECDIR}/${PROG}
MLINKS?= rtld.1 ld-elf.so.1.1 \
rtld.1 ld.so.1

View File

@@ -0,0 +1,10 @@
--- a/libexec/rtld-elf/Makefile
+++ b/libexec/rtld-elf/Makefile
@@ -86,7 +86,6 @@
# Some of the required math functions (div & mod) are implemented in
# libcompiler_rt on some architectures.
-LIBADD+= compiler_rt
.include <bsd.prog.mk>
${PROG_FULL}: ${VERSION_MAP}

View File

@@ -0,0 +1,13 @@
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

View File

@@ -0,0 +1,42 @@
--- a/sys/modules/aesni/Makefile 2023-12-16 09:19:28.454892154 -0700
+++ b/sys/Modules/aesni/Makefile 2023-12-16 09:19:41.975047684 -0700
@@ -1,6 +1,5 @@
.PATH: ${SRCTOP}/sys/crypto/aesni
-.PATH: ${SRCTOP}/contrib/llvm-project/clang/lib/Headers
KMOD= aesni
SRCS= aesni.c
@@ -39,8 +38,8 @@
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:

View File

@@ -0,0 +1,15 @@
--- a/lib/ncurses/tinfo/Makefile 2023-12-26 23:02:07.827892619 -0800
+++ b/lib/ncurses/tinfo/Makefile 2023-12-26 23:01:24.175546100 -0800
@@ -282,10 +282,10 @@
build-tools: make_hash make_keys
make_keys: make_keys.c names.c ncurses_def.h ${HEADERS} ${BUILD_TOOLS_META}
- ${CC:N${CCACHE_BIN}} -o $@ ${CFLAGS} ${NCURSES_DIR}/ncurses/tinfo/make_keys.c
+ ${CC_HOST:N${CCACHE_BIN}} -o $@ ${CFLAGS} ${NCURSES_DIR}/ncurses/tinfo/make_keys.c
make_hash: make_hash.c hashsize.h ncurses_def.h ${HEADERS} ${BUILD_TOOLS_META}
- ${CC:N${CCACHE_BIN}} -o $@ ${CFLAGS} -DMAIN_PROGRAM \
+ ${CC_HOST:N${CCACHE_BIN}} -o $@ ${CFLAGS} -DMAIN_PROGRAM \
${NCURSES_DIR}/ncurses/tinfo/make_hash.c
.endif
.if ${MK_DIRDEPS_BUILD} == "yes" && ${MACHINE} != "host"

View File

@@ -0,0 +1,88 @@
{
mkDerivation,
pkgsBuildBuild,
libjail,
libnetbsd,
libcapsicum,
libcasper,
libxo,
libncurses-tinfo,
libedit,
lib,
stdenv,
bsdSetupHook,
freebsdSetupHook,
makeMinimal,
install,
tsort,
lorder,
mandoc,
groff,
byacc,
gencat,
}:
mkDerivation {
pname = "bins";
path = "bin";
extraPaths = [
"sys/conf"
"sys/sys/param.h"
"contrib/sendmail"
"contrib/tcsh"
"usr.bin/printf"
"lib/libsm"
];
buildInputs = [
libjail
libnetbsd
libcapsicum
libcasper
libxo
libncurses-tinfo
libedit
];
nativeBuildInputs = [
bsdSetupHook
freebsdSetupHook
makeMinimal
install
tsort
lorder
mandoc
groff
byacc
gencat
];
MK_TESTS = "no";
postPatch = ''
sed -E -i -e '/#define\tBSD.*/d' $BSDSRCDIR/sys/sys/param.h
sed -E -i -e '/^SYMLINKS.*/d' $BSDSRCDIR/bin/*/Makefile
sed -E -i -e 's/mktemp -t ka/mktemp -t kaXXXXXX/' $BSDSRCDIR/bin/sh/mkbuiltins $BSDSRCDIR/bin/sh/mktokens
'';
preBuild = ''
export NIX_CFLAGS_COMPILE="-I$BSDSRCDIR/sys $NIX_CFLAGS_COMPILE"
make -C $BSDSRCDIR/lib/libsm $makeFlags
make -C $BSDSRCDIR/bin/sh $makeFlags "CC=${pkgsBuildBuild.stdenv.cc}/bin/cc" CFLAGS="-D__unused= -D__printf0like\(a,b\)= -D__dead2=" ${
lib.optionalString (!stdenv.buildPlatform.isFreeBSD) "MK_PIE=no "
}mkbuiltins mksyntax mktokens mknodes
make -C $BSDSRCDIR/bin/csh $makeFlags "CC=${pkgsBuildBuild.stdenv.cc}/bin/cc" CFLAGS="-D__unused= -D__printf0like\(a,b\)= -D__dead2= -I$BSDSRCDIR/contrib/tcsh -I." ${
lib.optionalString (!stdenv.buildPlatform.isFreeBSD) "MK_PIE=no "
}gethost
'';
preInstall = ''
appendToVar makeFlags "ROOTDIR=$out/root"
'';
outputs = [
"out"
"man"
"debug"
];
}

View File

@@ -0,0 +1,5 @@
{ mkDerivation }:
mkDerivation {
path = "usr.bin/bintrans";
MK_TESTS = "no";
}

View File

@@ -0,0 +1,23 @@
{ buildPackages, freebsd-lib }:
# Wrap GNU coreutils' install
# The -l flag causes a symlink instead of a copy to be installed, so
# it is safe to discard during bootstrap since coreutils does not support it.
buildPackages.writeShellScriptBin "boot-install" (
freebsd-lib.install-wrapper
+ ''
fixed_args=()
while [[ ''${#args[0]} > 0 ]]; do
case "''${args[0]}" in
-l)
args=("''${args[@]:2}")
continue
esac
fixed_args+=("''${args[0]}")
args=("''${args[@]:1}")
done
${buildPackages.coreutils}/bin/install "''${fixed_args[@]}"
''
)

View File

@@ -0,0 +1,6 @@
{ mkDerivation, libgeom }:
mkDerivation {
path = "sbin/bsdlabel";
extraPaths = [ "sys/geom" ];
buildInputs = [ libgeom ];
}

View File

@@ -0,0 +1,6 @@
{ mkDerivation }:
mkDerivation {
path = "usr.bin/cap_mkdb";
MK_TESTS = "no";
}

View File

@@ -0,0 +1,6 @@
# See pkgs/build-support/setup-hooks/role.bash
getHostRole
export NIX_LDFLAGS${role_post}+=" -legacy"
export NIX_CFLAGS_COMPILE${role_post}+=" -isystem @out@/0-include"
export NIX_CFLAGS_COMPILE${role_post}+=" -isystem @out@/1-include"

View File

@@ -0,0 +1,178 @@
{
lib,
stdenv,
mkDerivation,
versionData,
bsdSetupHook,
freebsdSetupHook,
makeMinimal,
boot-install,
which,
freebsd-lib,
expat,
zlib,
extraSrc ? [ ],
}:
let
inherit (freebsd-lib) mkBsdMachine;
in
mkDerivation {
pname = "compat";
path = "tools/build";
extraPaths = [
"lib/libc/db"
"lib/libc/stdlib" # getopt
"lib/libc/gen" # getcap
"lib/libc/locale" # rpmatch
]
++ lib.optionals stdenv.hostPlatform.isLinux [
"lib/libc/string" # strlcpy
"lib/libutil"
]
++ [
"contrib/libc-pwcache"
"contrib/libc-vis"
"sys/libkern"
"sys/kern/subr_capability.c"
# Take only individual headers, or else we will clobber native libc, etc.
"sys/rpc/types.h"
]
++ lib.optionals (versionData.major >= 14) [
"sys/sys/bitcount.h"
"sys/sys/linker_set.h"
"sys/sys/module.h"
]
++ [
# Listed in Makekfile as INC
"include/mpool.h"
"include/ndbm.h"
"include/err.h"
"include/stringlist.h"
"include/a.out.h"
"include/nlist.h"
"include/db.h"
"include/getopt.h"
"include/nl_types.h"
"include/elf.h"
"sys/sys/ctf.h"
]
++ lib.optionals (versionData.major >= 14) [
"include/bitstring.h"
"sys/sys/bitstring.h"
"sys/sys/nv_namespace.h"
]
++ [
# Listed in Makefile as SYSINCS
"sys/sys/capsicum.h"
"sys/sys/caprights.h"
"sys/sys/imgact_aout.h"
"sys/sys/nlist_aout.h"
"sys/sys/nv.h"
"sys/sys/dnv.h"
"sys/sys/cnv.h"
"sys/sys/elf32.h"
"sys/sys/elf64.h"
"sys/sys/elf_common.h"
"sys/sys/elf_generic.h"
"sys/${mkBsdMachine stdenv}/include"
]
++ lib.optionals stdenv.hostPlatform.isx86 [ "sys/x86/include" ]
++ [
"sys/sys/queue.h"
"sys/sys/md5.h"
"sys/sys/sbuf.h"
"sys/sys/tree.h"
"sys/sys/font.h"
"sys/sys/consio.h"
"sys/sys/fnv_hash.h"
#"sys/sys/cdefs.h"
#"sys/sys/param.h"
"sys/sys/_null.h"
#"sys/sys/types.h"
"sys/sys/_pthreadtypes.h"
"sys/sys/_stdint.h"
"sys/crypto/chacha20/_chacha.h"
"sys/crypto/chacha20/chacha.h"
# included too, despite ".c"
"sys/crypto/chacha20/chacha.c"
"sys/fs"
"sys/ufs"
"sys/sys/disk"
"lib/libcapsicum"
"lib/libcasper"
"lib/libmd"
# idk bro
"sys/sys/kbio.h"
]
++ extraSrc;
preBuild = ''
NIX_CFLAGS_COMPILE+=' -I../../include -I../../sys'
cp ../../sys/${mkBsdMachine stdenv}/include/elf.h ../../sys/sys
cp ../../sys/${mkBsdMachine stdenv}/include/elf.h ../../sys/sys/${mkBsdMachine stdenv}
''
+ lib.optionalString stdenv.hostPlatform.isx86 ''
cp ../../sys/x86/include/elf.h ../../sys/x86
'';
setupHooks = [
../../../../../build-support/setup-hooks/role.bash
./compat-setup-hook.sh
];
# This one has an ifdefed `#include_next` that makes it annoying.
postInstall = ''
rm ''${!outputDev}/0-include/libelf.h
'';
nativeBuildInputs = [
bsdSetupHook
freebsdSetupHook
makeMinimal
boot-install
which
];
buildInputs = [
expat
zlib
];
makeFlags = [
"STRIP=-s" # flag to install, not command
"MK_WERROR=no"
"HOST_INCLUDE_ROOT=${lib.getDev stdenv.cc.libc}/include"
"INSTALL=boot-install"
];
preIncludes = ''
mkdir -p $out/{0,1}-include
cp --no-preserve=mode -r cross-build/include/common/* $out/0-include
''
+ lib.optionalString stdenv.hostPlatform.isLinux ''
cp --no-preserve=mode -r cross-build/include/linux/* $out/1-include
''
+ lib.optionalString stdenv.hostPlatform.isDarwin ''
cp --no-preserve=mode -r cross-build/include/darwin/* $out/1-include
'';
# Compat is for making other platforms look like FreeBSD (e.g. to
# build build-time dependencies for building FreeBSD packages). It is
# not needed when building for FreeBSD.
meta.platforms = lib.platforms.linux;
alwaysKeepStatic = true;
}

View File

@@ -0,0 +1,35 @@
{
mkDerivation,
bsdSetupHook,
freebsdSetupHook,
makeMinimal,
install,
mandoc,
groff,
flex,
byacc,
file2c,
compatIfNeeded,
libnv,
libsbuf,
}:
mkDerivation {
path = "usr.sbin/config";
nativeBuildInputs = [
bsdSetupHook
freebsdSetupHook
makeMinimal
install
mandoc
groff
flex
byacc
file2c
];
buildInputs = compatIfNeeded ++ [
libnv
libsbuf
];
}

View File

@@ -0,0 +1,10 @@
{ mkDerivation }:
mkDerivation {
path = "bin/cp";
extraPaths = [ "sys" ];
postPatch = ''
substituteInPlace $BSDSRCDIR/bin/cp/Makefile --replace 'tests' ""
'';
}

View File

@@ -0,0 +1,36 @@
{
lib,
mkDerivation,
versionData,
bsdSetupHook,
freebsdSetupHook,
makeMinimal,
install,
flex,
byacc,
gencat,
include,
}:
mkDerivation {
noLibc = true;
path = "lib/csu";
extraPaths = [
"lib/Makefile.inc"
"lib/libc/include/libc_private.h"
]
++ lib.optionals (versionData.major >= 14) [ "sys/sys/param.h" ];
nativeBuildInputs = [
bsdSetupHook
freebsdSetupHook
makeMinimal
install
flex
byacc
gencat
];
buildInputs = [ include ];
MK_TESTS = "no";
meta.platforms = lib.platforms.freebsd;
}

View File

@@ -0,0 +1,35 @@
{
lib,
mkDerivation,
compatIfNeeded,
libdwarf,
zlib,
libspl,
}:
mkDerivation {
path = "cddl/usr.bin/ctfconvert";
extraPaths = [
"cddl/compat/opensolaris"
"cddl/contrib/opensolaris"
"sys/cddl/compat/opensolaris"
"sys/cddl/contrib/opensolaris"
"sys/contrib/openzfs"
];
OPENSOLARIS_USR_DISTDIR = "$(SRCTOP)/cddl/contrib/opensolaris";
OPENSOLARIS_SYS_DISTDIR = "$(SRCTOP)/sys/cddl/contrib/opensolaris";
makeFlags = [
"STRIP=-s"
"MK_WERROR=no"
"MK_TESTS=no"
];
buildInputs = compatIfNeeded ++ [
libdwarf
zlib
libspl
];
meta.license = lib.licenses.cddl;
}

View File

@@ -0,0 +1,5 @@
{ mkDerivation }:
mkDerivation {
path = "usr.sbin/daemon";
MK_TESTS = "no";
}

View File

@@ -0,0 +1,10 @@
{ mkDerivation }:
mkDerivation {
path = "sbin/devfs";
# These config files are mostly examples and not super useful
# in nixbsd
postPatch = ''
sed -i 's/^CONFS=.*$//' $BSDSRCDIR/sbin/devfs/Makefile
'';
}

View File

@@ -0,0 +1,6 @@
{ mkDerivation, lib }:
mkDerivation {
path = "sbin/dmesg";
meta.platforms = lib.platforms.freebsd;
}

View File

@@ -0,0 +1,54 @@
{
lib,
mkDerivation,
fetchFromGitHub,
buildFreebsd,
sys,
withAmd ? true,
withIntel ? true,
}:
mkDerivation rec {
pname =
"drm-kmod-firmware" + lib.optionalString withAmd "-amd" + lib.optionalString withIntel "-intel";
version = "20230625_8";
src = fetchFromGitHub {
owner = "freebsd";
repo = "drm-kmod-firmware";
rev = version;
hash = "sha256-Ly9B0zf+YODel/X1sZYVVUVWh38faNLhkcXcjEnQwII=";
};
extraNativeBuildInputs = [ buildFreebsd.xargs-j ];
hardeningDisable = [
"pic" # generates relocations the linker can't handle
"stackprotector" # generates stack protection for the function generating the stack canary
];
# hardeningDisable = stackprotector doesn't seem to be enough, put it in cflags too
NIX_CFLAGS_COMPILE = "-fno-stack-protector";
KMODS =
lib.optional withIntel "i915kmsfw"
++ lib.optionals withAmd [
"amdgpukmsfw"
"radeonkmsfw"
];
env = sys.passthru.env;
SYSDIR = "${sys.src}/sys";
KMODDIR = "${placeholder "out"}/kernel";
meta = {
description = "GPU firmware for FreeBSD drm-kmod";
platforms = lib.platforms.freebsd;
license =
lib.optional withAmd lib.licenses.unfreeRedistributableFirmware
# Intel license prohibits modification. this will wrap firmware files in an ELF
++ lib.optional withIntel lib.licenses.unfree;
sourceProvenance = [ lib.sourceTypes.binaryFirmware ];
};
}

View File

@@ -0,0 +1,56 @@
{
lib,
mkDerivation,
fetchFromGitHub,
xargs-j,
versionData,
sys,
}:
let
# Based off ports tree versions
reldate = lib.toIntBase10 versionData.reldate;
branch =
if reldate >= 1500008 then
"6.1-lts"
else if reldate >= 1400097 then
"5.15-lts"
else if reldate >= 1302000 then
"5.10-lts"
else
throw "drm-kmod not supported on FreeBSD version ${reldate}";
fetchOptions = (lib.importJSON ./versions.json).${branch};
in
mkDerivation {
# this derivation is tricky; it is not an in-tree FreeBSD build but it is meant to be built
# at the same time as the in-tree FreeBSD code, so it expects the same environment. Therefore,
# it is appropriate to use the freebsd mkDerivation.
pname = "drm-kmod";
version = branch;
src = fetchFromGitHub fetchOptions;
extraNativeBuildInputs = [ xargs-j ];
hardeningDisable = [
"pic" # generates relocations the linker can't handle
"stackprotector" # generates stack protection for the function generating the stack canary
];
# hardeningDisable = stackprotector doesn't seem to be enough, put it in cflags too
NIX_CFLAGS_COMPILE = "-fno-stack-protector";
env = sys.passthru.env;
SYSDIR = "${sys.src}/sys";
KMODDIR = "${placeholder "out"}/kernel";
meta = {
description = "Linux drm driver, ported to FreeBSD";
platforms = lib.platforms.freebsd;
license = with lib.licenses; [
bsd2
gpl2Only
];
};
}

View File

@@ -0,0 +1,21 @@
#!/usr/bin/env nix-shell
#!nix-shell -i python -p python3 nix-prefetch-github git
import subprocess
import json
import os.path
BRANCHES = ["5.10-lts", "5.15-lts", "6.1-lts"]
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
versions = dict()
for branch in BRANCHES:
text = subprocess.check_output(
["nix-prefetch-github", "freebsd", "drm-kmod", "--rev", branch, "--json"]
).decode("utf-8")
versions[branch] = json.loads(text)
with open(os.path.join(BASE_DIR, "versions.json"), "w") as out:
json.dump(versions, out, sort_keys=True, indent=2)
out.write("\n")

View File

@@ -0,0 +1,20 @@
{
"5.10-lts": {
"hash": "sha256-6v8FhaEch9fJfo0/1UXeo0bcZh5n4Y2TyAsyHmCBJgw=",
"owner": "freebsd",
"repo": "drm-kmod",
"rev": "e7950546196d44af502dd6abf162d1453f6f0dd0"
},
"5.15-lts": {
"hash": "sha256-i768QfnYo2hqxnoCEnfYqOurDSRwkAsC4qsP7TUalxc=",
"owner": "freebsd",
"repo": "drm-kmod",
"rev": "d7dc64fb8e63208afaca01e6d48284aa2305df35"
},
"6.1-lts": {
"hash": "sha256-+CsqQ0beJgoO3SSWzwLcAO8JP15oaDW9HR+bxwPaan4=",
"owner": "freebsd",
"repo": "drm-kmod",
"rev": "f2d6d4b58446fa45de575bae76d6435439b3ca8b"
}
}

View File

@@ -0,0 +1,6 @@
{ mkDerivation, libgeom }:
mkDerivation {
path = "sbin/fdisk";
buildInputs = [ libgeom ];
}

View File

@@ -0,0 +1,6 @@
{ mkDerivation }:
mkDerivation {
path = "usr.bin/file2c";
MK_TESTS = "no";
}

View File

@@ -0,0 +1,39 @@
{
lib,
pkgsBuildBuild,
runCommand,
writeText,
source,
}:
{
pname,
path,
extraPaths ? [ ],
}:
let
sortedPaths = lib.naturalSort ([ path ] ++ extraPaths);
filterText = writeText "${pname}-src-include" (
lib.concatMapStringsSep "\n" (path: "/${path}") sortedPaths
);
in
runCommand "${pname}-filtered-src"
{
nativeBuildInputs = [
(
(pkgsBuildBuild.rsync.override {
enableZstd = false;
enableXXHash = false;
enableOpenSSL = false;
enableLZ4 = false;
}).overrideAttrs
{
doCheck = false;
}
)
];
}
''
rsync -a -r --files-from=${filterText} ${source}/ $out
''

View File

@@ -0,0 +1,3 @@
{ makeSetupHook }:
makeSetupHook { name = "freebsd-setup-hook"; } ./setup-hook.sh

View File

@@ -0,0 +1,23 @@
setFreeBSDSrcTop() {
prependToVar makeFlags "SRCTOP=$BSDSRCDIR"
}
addFreeBSDMakeFlags() {
prependToVar makeFlags "SBINDIR=${!outputBin}/bin"
prependToVar makeFlags "LIBEXECDIR=${!outputLib}/libexec"
prependToVar makeFlags "LIBDATADIR=${!outputLib}/data"
prependToVar makeFlags "INCLUDEDIR=${!outputDev}/include"
prependToVar makeFlags "CONFDIR=${!outputBin}/etc"
prependToVar makeFlags "MANDIR=${!outputMan}/share/man/man"
if [ -n "$debug" ]; then
prependToVar makeFlags "DEBUGFILEDIR=${debug}/lib/debug"
else
prependToVar makeFlags "DEBUGFILEDIR=${out}/lib/debug"
fi
echoCmd 'FreeBSD makeFlags' "${makeFlags[@]}"
}
postUnpackHooks+=(setFreeBSDSrcTop)
preConfigureHooks+=(addFreeBSDMakeFlags)

View File

@@ -0,0 +1,7 @@
{ lib, mkDerivation }:
mkDerivation {
path = "sbin/fsck";
extraPaths = [ "sbin/mount" ];
meta.platforms = lib.platforms.freebsd;
}

View File

@@ -0,0 +1,13 @@
{
lib,
mkDerivation,
libufs,
}:
mkDerivation {
path = "sbin/fsck_ffs";
extraPaths = [ "sbin/mount" ];
buildInputs = [ libufs ];
meta.platforms = lib.platforms.freebsd;
}

View File

@@ -0,0 +1,10 @@
{ lib, mkDerivation }:
mkDerivation {
path = "sbin/fsck_msdosfs";
extraPaths = [
"sbin/mount"
"sbin/fsck"
];
meta.platforms = lib.platforms.freebsd;
}

View File

@@ -0,0 +1,16 @@
{
lib,
mkDerivation,
}:
mkDerivation {
path = "usr.bin/fstat";
outputs = [
"out"
"man"
"debug"
];
meta.mainProgram = "fstat";
meta.platforms = lib.platforms.freebsd;
}

View File

@@ -0,0 +1,3 @@
{ mkDerivation }:
mkDerivation { path = "usr.bin/gencat"; }

View File

@@ -0,0 +1,62 @@
{
lib,
mkDerivation,
libgeom,
libufs,
openssl,
}:
let
libs = mkDerivation {
name = "geom-class-libs";
path = "lib/geom";
extraPaths = [
"lib/Makefile.inc"
"sbin/geom"
"sys/geom"
# geli isn't okay with just libcrypt, it wants files in here
"sys/crypto/sha2"
"sys/opencrypto"
];
outputs = [
"out"
"man"
"debug"
];
# libgeom needs sbuf and bsdxml but linker doesn't know that
buildInputs = [
libgeom
libufs
openssl
];
# tools want geom headers but don't seem to declare it
preBuild = ''
export NIX_CFLAGS_COMPILE="-I$BSDSRCDIR/sys $NIX_CFLAGS_COMPILE";
'';
};
in
mkDerivation {
path = "sbin/geom";
extraPaths = [
"lib/Makefile.inc"
"lib/geom"
];
outputs = [
"out"
"man"
"debug"
];
GEOM_CLASS_DIR = "${libs}/lib";
# link in man pages from libs
postInstall = ''
mkdir -p $man/share/man/man8
ln -s ${lib.getMan libs}/share/man/man8/*.8* $man/share/man/man8/
'';
buildInputs = [ libgeom ];
}

View File

@@ -0,0 +1 @@
{ mkDerivation }: mkDerivation { path = "usr.bin/getent"; }

View File

@@ -0,0 +1,21 @@
{
mkDerivation,
login,
wrappedLogin ? null,
}:
mkDerivation {
path = "libexec/getty";
postPatch = ''
sed -E -i -e "s|/usr/bin/login|${
if (wrappedLogin != null) then wrappedLogin else "${login}/bin/login"
}|g" $BSDSRCDIR/libexec/getty/*.h
'';
MK_TESTS = "no";
postInstall = ''
mkdir -p $out/etc
cp $BSDSRCDIR/libexec/getty/gettytab $out/etc/gettytab
'';
}

View File

@@ -0,0 +1,20 @@
{
mkDerivation,
mkcsmapper,
mkesdb,
}:
mkDerivation {
path = "share/i18n";
noLibc = true;
extraNativeBuildInputs = [
mkcsmapper
mkesdb
];
preBuild = ''
export makeFlags="$makeFlags ESDBDIR=$out/share/i18n/esdb CSMAPPERDIR=$out/share/i18n/csmapper"
'';
}

View File

@@ -0,0 +1,12 @@
{
mkDerivation,
libcapsicum,
libcasper,
}:
mkDerivation {
path = "usr.bin/iconv";
buildInputs = [
libcapsicum
libcasper
];
}

View File

@@ -0,0 +1 @@
{ mkDerivation }: mkDerivation { path = "usr.bin/id"; }

View File

@@ -0,0 +1,24 @@
{
mkDerivation,
compatIfNeeded,
libifconfig,
lib80211,
libjail,
libnv,
}:
mkDerivation {
path = "sbin/ifconfig";
buildInputs = compatIfNeeded ++ [
libifconfig
lib80211
libjail
libnv
];
# ifconfig believes libifconfig is internal and thus PIE.
# We build libifconfig as an external library
MK_PIE = "no";
MK_TESTS = "no";
}

View File

@@ -0,0 +1,49 @@
{
lib,
mkDerivation,
buildPackages,
rpcgen,
mtree,
}:
mkDerivation {
noLibc = true;
path = "include";
extraPaths = [
"contrib/libc-vis"
"etc/mtree/BSD.include.dist"
"sys"
# Used for aarch64-freebsd
"lib/msun/arm"
];
extraNativeBuildInputs = [
rpcgen
mtree
];
# The makefiles define INCSDIR per subdirectory, so we have to set
# something else on the command line so those definitions aren't
# overridden.
postPatch = ''
find "$BSDSRCDIR" -name Makefile -exec \
sed -i -E \
-e 's_/usr/include_''${INCSDIR0}_' \
{} \;
sed -E -i -e "/_PATH_LOGIN/d" $BSDSRCDIR/include/paths.h
'';
makeFlags = [ "RPCGEN_CPP=${buildPackages.stdenv.cc.cc}/bin/cpp" ];
# multiple header dirs, see above
postConfigure = ''
makeFlags=''${makeFlags/INCSDIR/INCSDIR0}
'';
headersOnly = true;
MK_HESIOD = "yes";
meta.platforms = lib.platforms.freebsd;
}

View File

@@ -0,0 +1,16 @@
{
mkDerivation,
stdenv,
lib,
}:
mkDerivation {
path = "sbin/init";
extraPaths = [ "sbin/mount" ];
MK_TESTS = "no";
meta = {
broken = !stdenv.hostPlatform.isStatic;
platforms = lib.platforms.freebsd;
mainProgram = "init";
};
}

View File

@@ -0,0 +1,73 @@
{
lib,
stdenv,
mkDerivation,
writeShellScript,
freebsd-lib,
bsdSetupHook,
freebsdSetupHook,
makeMinimal,
mandoc,
groff,
boot-install,
install,
compatIfNeeded,
libmd,
libnetbsd,
}:
# HACK: to ensure parent directories exist. This emulates GNU
# installs -D option. No alternative seems to exist in BSD install.
let
binstall = writeShellScript "binstall" (
freebsd-lib.install-wrapper
+ ''
@out@/bin/xinstall "''${args[@]}"
''
);
libmd' = libmd.override {
bootstrapInstallation = true;
};
in
mkDerivation {
path = "usr.bin/xinstall";
extraPaths = [ "contrib/mtree" ];
nativeBuildInputs = [
bsdSetupHook
freebsdSetupHook
makeMinimal
mandoc
groff
(if stdenv.hostPlatform == stdenv.buildPlatform then boot-install else install)
];
skipIncludesPhase = true;
buildInputs =
compatIfNeeded
++ lib.optionals (!stdenv.hostPlatform.isFreeBSD) [
libmd'
]
++ [
libnetbsd
];
makeFlags = [
"STRIP=-s" # flag to install, not command
"MK_WERROR=no"
"TESTSDIR=${placeholder "test"}"
]
++ lib.optionals (stdenv.hostPlatform == stdenv.buildPlatform) [
"BOOTSTRAPPING=1"
"INSTALL=boot-install"
];
postInstall = ''
install -C -m 0550 ${binstall} $out/bin/binstall
substituteInPlace $out/bin/binstall --subst-var out
mv $out/bin/install $out/bin/xinstall
ln -s ./binstall $out/bin/install
'';
outputs = [
"out"
"man"
"test"
];
}

View File

@@ -0,0 +1,20 @@
{
lib,
mkDerivation,
flex,
byacc,
libjail,
}:
mkDerivation {
path = "usr.sbin/jail";
extraNativeBuildInputs = [
flex
byacc
];
buildInputs = [
libjail
];
MK_TESTS = "no";
meta.mainProgram = "jail";
meta.platforms = lib.platforms.freebsd;
}

View File

@@ -0,0 +1,13 @@
{
lib,
mkDerivation,
libjail,
}:
mkDerivation {
path = "usr.sbin/jexec";
buildInputs = [
libjail
];
meta.mainProgram = "jexec";
meta.platforms = lib.platforms.freebsd;
}

View File

@@ -0,0 +1,15 @@
{
lib,
mkDerivation,
libjail,
libxo,
}:
mkDerivation {
path = "usr.sbin/jls";
buildInputs = [
libjail
libxo
];
meta.mainProgram = "jls";
meta.platforms = lib.platforms.freebsd;
}

View File

@@ -0,0 +1,6 @@
{ mkDerivation, lib }:
mkDerivation {
path = "sbin/kldconfig";
meta.platforms = lib.platforms.freebsd;
}

View File

@@ -0,0 +1,6 @@
{ mkDerivation, lib }:
mkDerivation {
path = "sbin/kldload";
meta.platforms = lib.platforms.freebsd;
}

View File

@@ -0,0 +1,6 @@
{ mkDerivation, lib }:
mkDerivation {
path = "sbin/kldstat";
meta.platforms = lib.platforms.freebsd;
}

View File

@@ -0,0 +1,6 @@
{ mkDerivation, lib }:
mkDerivation {
path = "sbin/kldunload";
meta.platforms = lib.platforms.freebsd;
}

View File

@@ -0,0 +1,17 @@
{
lib,
stdenv,
mkDerivation,
compatIfNeeded,
libelf,
}:
mkDerivation {
path = "usr.sbin/kldxref";
buildInputs = lib.optionals (!stdenv.hostPlatform.isFreeBSD) [ libelf ] ++ compatIfNeeded;
# We symlink in our modules, make it follow symlinks
postPatch = ''
sed -i 's/FTS_PHYSICAL/FTS_LOGICAL/' $BSDSRCDIR/usr.sbin/kldxref/kldxref.c
'';
}

View File

@@ -0,0 +1,18 @@
{
lib,
stdenv,
mkDerivation,
}:
mkDerivation {
path = "usr.bin/ldd";
extraPaths = [
"libexec/rtld-elf"
"contrib/elftoolchain/libelf"
];
env = {
NIX_CFLAGS_COMPILE = "-D_RTLD_PATH=${lib.getLib stdenv.cc.libc}/libexec/ld-elf.so.1";
};
meta.platforms = lib.platforms.freebsd;
}

View File

@@ -0,0 +1,13 @@
{
mkDerivation,
libsbuf,
libbsdxml,
}:
mkDerivation {
path = "lib/lib80211";
buildInputs = [
libsbuf
libbsdxml
];
clangFixup = true;
}

View File

@@ -0,0 +1,10 @@
{ mkDerivation }:
mkDerivation {
path = "lib/libexpat";
extraPaths = [ "contrib/expat" ];
buildInputs = [ ];
outputs = [
"out"
"debug"
];
}

View File

@@ -0,0 +1,7 @@
{ mkDerivation, libpam }:
mkDerivation {
path = "lib/libbsm";
extraPaths = [ "contrib/openbsm" ];
buildInputs = [ libpam ];
MK_TESTS = "no";
}

View File

@@ -0,0 +1,56 @@
{
symlinkJoin,
include,
csu,
libcMinimal,
libssp_nonshared,
libgcc,
libmd,
libthr,
msun,
librpcsvc,
libutil,
librt,
libcrypt,
libelf,
libexecinfo,
libkvm,
libmemstat,
libprocstat,
libdevstat,
libiconvModules,
libdl,
i18n,
rtld-elf,
baseModules ? [
include
csu
libcMinimal
libssp_nonshared
libgcc
libmd
libthr
msun
librpcsvc
libutil
librt
libcrypt
libelf
libexecinfo
libkvm
libmemstat
libprocstat
libdevstat
libiconvModules
libdl
i18n
rtld-elf
],
extraModules ? [ ],
}:
symlinkJoin {
pname = "libc";
inherit (libcMinimal) version;
paths = baseModules ++ extraModules;
}

View File

@@ -0,0 +1,101 @@
{
mkDerivation,
include,
rpcgen,
flex,
byacc,
gencat,
csu,
i18n,
extraSrc ? [ ],
}:
mkDerivation {
pname = "libcMinimal";
path = "lib/libc";
extraPaths = [
"lib/libc_nonshared"
"lib/msun"
"lib/libmd"
"lib/libutil"
"libexec/rtld-elf"
"include/rpcsvc"
"contrib/libc-pwcache"
"contrib/libc-vis"
"contrib/tzcode"
"contrib/gdtoa"
"contrib/jemalloc"
"sys/sys"
"sys/kern"
"sys/libkern"
"sys/crypto"
"sys/opencrypto"
"etc/group"
"etc/master.passwd"
"etc/shells"
"include/paths.h"
]
++ extraSrc;
outputs = [
"out"
"man"
"debug"
];
noLibc = true;
buildInputs = [
include
];
extraNativeBuildInputs = [
rpcgen
flex
byacc
gencat
];
# this target is only used in the rtld-elf derivation. build it there instead.
#
# WE SHOULD REALLY BE REPLACING /usr/lib/i18n WITH THE libiconvModules DERIVATION
# but this causes some awful dependency loops which basically collapse the entire libc derivation
# instead, set the PATH_I18NMODULE environment variable whenever possible
postPatch = ''
sed -E -i -e '/BUILD_NOSSP_PIC_ARCHIVE=/d' $BSDSRCDIR/lib/libc/Makefile
substituteInPlace $BSDSRCDIR/include/paths.h --replace '/usr/share/i18n' '${i18n}/share/i18n'
'';
preBuild = ''
export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -B${csu}/lib"
'';
postBuild = ''
make -C $BSDSRCDIR/lib/libc_nonshared $makeFlags
'';
postInstall = ''
make -C $BSDSRCDIR/lib/libc_nonshared $makeFlags install
'';
alwaysKeepStatic = true;
env = {
MK_TESTS = "no";
MK_SYMVER = "yes";
MK_SSP = "yes";
MK_NLS = "yes";
MK_ICONV = "yes";
MK_NS_CACHING = "yes";
MK_INET6_SUPPORT = "yes";
MK_HESIOD = "yes";
MK_NIS = "yes";
MK_HYPERV = "yes";
MK_FP_LIBC = "yes";
MK_MALLOC_PRODUCTION = "yes";
MK_MACHDEP_OPTIMIZATIONS = "yes";
};
# definitely a bad idea to enable stack protection on the stack protection initializers
hardeningDisable = [ "stackprotector" ];
}

View File

@@ -0,0 +1,16 @@
{
lib,
libsbuf,
mkDerivation,
}:
mkDerivation {
path = "lib/libcam";
extraPaths = [
"sys/cam"
];
buildInputs = [
libsbuf
];
MK_TESTS = "no";
meta.platforms = lib.platforms.freebsd;
}

View File

@@ -0,0 +1 @@
{ mkDerivation }: mkDerivation { path = "lib/libcapsicum"; }

View File

@@ -0,0 +1,27 @@
{
lib,
stdenv,
mkDerivation,
libnv,
}:
mkDerivation {
path = "lib/libcasper/libcasper";
extraPaths = [
"lib/Makefile.inc"
"lib/libcasper"
];
buildInputs = [ libnv ];
MK_TESTS = "no";
makeFlags = [
"STRIP=-s" # flag to install, not command
"CFLAGS=-DWITH_CASPER"
]
++ lib.optional (!stdenv.hostPlatform.isFreeBSD) "MK_WERROR=no";
postInstall = ''
make -C $BSDSRCDIR/lib/libcasper/services $makeFlags CFLAGS="-DWITH_CASPER -I$out/include"
make -C $BSDSRCDIR/lib/libcasper/services $makeFlags install
'';
}

View File

@@ -0,0 +1,37 @@
{
mkDerivation,
include,
libcMinimal,
libgcc,
csu,
}:
mkDerivation {
path = "lib/libcrypt";
extraPaths = [
"sys/kern"
"sys/crypto"
"lib/libmd"
"secure/lib/libcrypt"
];
outputs = [
"out"
"man"
"debug"
];
noLibc = true;
buildInputs = [
include
libcMinimal
libgcc
];
preBuild = ''
export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -B${csu}/lib"
'';
env.MK_TESTS = "no";
}

View File

@@ -0,0 +1,27 @@
{
mkDerivation,
stdenv,
lib,
}:
# this package is quite different from stock libcxxrt.
# as of FreeBSD 14.0, it is vendored from APPROXIMATELY libcxxrt
# 5d8a15823a103bbc27f1bfdcf2b5aa008fab57dd, though the vendoring mechanism is
# extremely ad-hoc. Moreover, the build mechanism is totally custom, and adds
# symbol versions not specified on any version of libcxxrt.
mkDerivation {
pname = "libcxxrt";
path = "lib/libcxxrt";
extraPaths = [ "contrib/libcxxrt" ];
outputs = [
"out"
"dev"
"debug"
];
noLibcxx = true;
libName = "cxxrt";
# they already fixed the undefined symbols in the version map upstream. it'll be released probably in 15.0
preBuild = ''
export NIX_LDFLAGS="$NIX_LDFLAGS --undefined-version"
'';
}

View File

@@ -0,0 +1,15 @@
{
lib,
mkDerivation,
}:
mkDerivation {
path = "lib/libdevdctl";
clangFixup = false;
outputs = [
"out"
"debug"
];
meta.platforms = lib.platforms.freebsd;
}

View File

@@ -0,0 +1,44 @@
{
mkDerivation,
include,
libcMinimal,
libgcc,
libkvm,
libprocstat,
libutil,
libelf,
csu,
}:
mkDerivation {
path = "lib/libdevstat";
extraPaths = [
"lib/libc/Versions.def"
"sys/contrib/openzfs"
"sys/contrib/pcg-c"
"sys/opencrypto"
"sys/crypto"
];
outputs = [
"out"
"man"
"debug"
];
noLibc = true;
buildInputs = [
include
libcMinimal
libgcc
libkvm
libprocstat
libutil
libelf
];
preBuild = ''
export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -B${csu}/lib"
'';
}

View File

@@ -0,0 +1,34 @@
{
mkDerivation,
include,
libcMinimal,
libgcc,
csu,
}:
mkDerivation {
path = "lib/libdl";
extraPaths = [
"libexec/rtld-elf"
"lib/libc/gen"
"lib/libc/include"
"lib/libc/Versions.def"
];
outputs = [
"out"
"debug"
];
noLibc = true;
buildInputs = [
include
libcMinimal
libgcc
];
preBuild = ''
export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -B${csu}/lib"
'';
}

View File

@@ -0,0 +1,20 @@
{
mkDerivation,
m4,
compatIfNeeded,
zlib,
}:
mkDerivation {
path = "lib/libdwarf";
extraPaths = [
"contrib/elftoolchain/libdwarf"
"contrib/elftoolchain/common"
"sys/sys/elf32.h"
"sys/sys/elf64.h"
"sys/sys/elf_common.h"
];
extraNativeBuildInputs = [ m4 ];
buildInputs = compatIfNeeded ++ [ zlib ];
MK_TESTS = "no";
}

Some files were not shown because too many files have changed in this diff Show More