mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-13 17:23:08 +00:00
Merge pull request #321615 from NixOS/backport-321301-to-release-24.05
[Backport release-24.05] netbsd.libc: Create from constituent pkgs not hack
This commit is contained in:
commit
101e023ad1
@ -1,5 +1,6 @@
|
||||
{
|
||||
lib,
|
||||
crossLibcStdenv,
|
||||
stdenvNoCC,
|
||||
makeScopeWithSplicing',
|
||||
generateSplicesForMkScope,
|
||||
@ -31,6 +32,16 @@ makeScopeWithSplicing' {
|
||||
|
||||
compatIfNeeded = lib.optional (!stdenvNoCC.hostPlatform.isNetBSD) self.compat;
|
||||
|
||||
stdenvLibcMinimal = crossLibcStdenv.override (old: {
|
||||
cc = old.cc.override {
|
||||
libc = self.libcMinimal;
|
||||
bintools = old.cc.bintools.override {
|
||||
libc = self.libcMinimal;
|
||||
sharedLibraryLoader = null;
|
||||
};
|
||||
};
|
||||
});
|
||||
|
||||
# The manual callPackages below should in principle be unnecessary because
|
||||
# they're just selecting arguments that would be selected anyway. However,
|
||||
# if we don't perform these manual calls, we get infinite recursion issues
|
||||
@ -53,7 +64,6 @@ makeScopeWithSplicing' {
|
||||
compat = self.callPackage ./pkgs/compat/package.nix {
|
||||
inherit (buildPackages) coreutils;
|
||||
inherit (buildPackages.darwin) cctools-port;
|
||||
inherit (buildPackages.buildPackages) rsync;
|
||||
inherit (buildPackages.netbsd) makeMinimal;
|
||||
inherit (self) install;
|
||||
};
|
||||
@ -65,32 +75,23 @@ makeScopeWithSplicing' {
|
||||
make
|
||||
compatIfNeeded
|
||||
;
|
||||
inherit (buildPackages.buildPackages) rsync;
|
||||
inherit (buildPackages.netbsd) makeMinimal;
|
||||
};
|
||||
|
||||
# See note in pkgs/stat/package.nix
|
||||
stat = self.callPackage ./pkgs/stat/package.nix {
|
||||
inherit (buildPackages.netbsd) makeMinimal install;
|
||||
inherit (buildPackages.buildPackages) rsync;
|
||||
};
|
||||
|
||||
# See note in pkgs/stat/hook.nix
|
||||
statHook = self.callPackage ./pkgs/stat/hook.nix { inherit (self) stat; };
|
||||
|
||||
tsort = self.callPackage ./pkgs/tsort.nix {
|
||||
inherit (buildPackages.netbsd) makeMinimal install;
|
||||
inherit (buildPackages.buildPackages) rsync;
|
||||
};
|
||||
tsort = self.callPackage ./pkgs/tsort.nix { inherit (buildPackages.netbsd) makeMinimal install; };
|
||||
|
||||
lorder = self.callPackage ./pkgs/lorder.nix {
|
||||
inherit (buildPackages.netbsd) makeMinimal install;
|
||||
inherit (buildPackages.buildPackages) rsync;
|
||||
};
|
||||
lorder = self.callPackage ./pkgs/lorder.nix { inherit (buildPackages.netbsd) makeMinimal install; };
|
||||
|
||||
config = self.callPackage ./pkgs/config.nix {
|
||||
inherit (buildPackages.netbsd) makeMinimal install;
|
||||
inherit (buildPackages.buildPackages) rsync;
|
||||
inherit (self) cksum;
|
||||
};
|
||||
|
||||
@ -102,7 +103,6 @@ makeScopeWithSplicing' {
|
||||
rpcgen
|
||||
;
|
||||
inherit (buildPackages) stdenv;
|
||||
inherit (buildPackages.buildPackages) rsync;
|
||||
};
|
||||
|
||||
sys-headers = self.callPackage ./pkgs/sys/headers.nix {
|
||||
@ -116,10 +116,18 @@ makeScopeWithSplicing' {
|
||||
config
|
||||
genassym
|
||||
;
|
||||
inherit (buildPackages.buildPackages) rsync;
|
||||
};
|
||||
|
||||
libutil = self.callPackage ./pkgs/libutil.nix { inherit (self) libc sys; };
|
||||
libutil = self.callPackage ./pkgs/libutil.nix {
|
||||
inherit (buildPackages.netbsd)
|
||||
netbsdSetupHook
|
||||
makeMinimal
|
||||
install
|
||||
lorder
|
||||
tsort
|
||||
statHook
|
||||
;
|
||||
};
|
||||
|
||||
libpthread-headers = self.callPackage ./pkgs/libpthread/headers.nix { };
|
||||
|
||||
@ -135,25 +143,10 @@ makeScopeWithSplicing' {
|
||||
tsort
|
||||
statHook
|
||||
;
|
||||
inherit (buildPackages.buildPackages) rsync;
|
||||
};
|
||||
|
||||
_mainLibcExtraPaths = [
|
||||
"common"
|
||||
"lib/i18n_module"
|
||||
"lib/libcrypt"
|
||||
"lib/libm"
|
||||
"lib/libpthread"
|
||||
"lib/libresolv"
|
||||
"lib/librpcsvc"
|
||||
"lib/librt"
|
||||
"lib/libutil"
|
||||
"libexec/ld.elf_so"
|
||||
"sys"
|
||||
];
|
||||
|
||||
libc = self.callPackage ./pkgs/libc.nix {
|
||||
inherit (self) headers csu librt;
|
||||
libcMinimal = self.callPackage ./pkgs/libcMinimal.nix {
|
||||
inherit (self) headers csu;
|
||||
inherit (buildPackages.netbsd)
|
||||
netbsdSetupHook
|
||||
makeMinimal
|
||||
@ -165,7 +158,18 @@ makeScopeWithSplicing' {
|
||||
statHook
|
||||
rpcgen
|
||||
;
|
||||
inherit (buildPackages.buildPackages) rsync;
|
||||
};
|
||||
|
||||
librpcsvc = self.callPackage ./pkgs/librpcsvc.nix {
|
||||
inherit (buildPackages.netbsd)
|
||||
netbsdSetupHook
|
||||
makeMinimal
|
||||
install
|
||||
lorder
|
||||
tsort
|
||||
statHook
|
||||
rpcgen
|
||||
;
|
||||
};
|
||||
|
||||
mtree = self.callPackage ./pkgs/mtree.nix { inherit (self) mknod; };
|
||||
|
@ -1,7 +1,7 @@
|
||||
prefix=@out@
|
||||
exec_prefix=${prefix}
|
||||
libdir=${exec_prefix}/lib
|
||||
includedir=${prefix}/include
|
||||
includedir=@includedir@
|
||||
|
||||
Name: nbcompat
|
||||
Description: NetBSD compatibility framework
|
||||
|
@ -10,8 +10,6 @@
|
||||
bsdSetupHook,
|
||||
netbsdSetupHook,
|
||||
makeMinimal,
|
||||
rsync,
|
||||
_mainLibcExtraPaths,
|
||||
version,
|
||||
}:
|
||||
|
||||
@ -22,6 +20,11 @@ mkDerivation (
|
||||
{
|
||||
path = "tools/compat";
|
||||
|
||||
outputs = [
|
||||
"out"
|
||||
"dev"
|
||||
];
|
||||
|
||||
setupHooks = [
|
||||
../../../../../build-support/setup-hooks/role.bash
|
||||
./compat-setup-hook.sh
|
||||
@ -49,7 +52,6 @@ mkDerivation (
|
||||
bsdSetupHook
|
||||
netbsdSetupHook
|
||||
makeMinimal
|
||||
rsync
|
||||
];
|
||||
|
||||
buildInputs = commonDeps;
|
||||
@ -60,7 +62,7 @@ mkDerivation (
|
||||
defaultMakeFlags
|
||||
++ [
|
||||
"INSTALL=${coreutils}/bin/install"
|
||||
"DATADIR=$(out)/share"
|
||||
"DATADIR=$(dev)/share"
|
||||
# Can't sort object files yet
|
||||
"LORDER=echo"
|
||||
"TSORT=cat"
|
||||
@ -93,37 +95,38 @@ mkDerivation (
|
||||
postInstall =
|
||||
''
|
||||
# why aren't these installed by netbsd?
|
||||
install -D compat_defs.h $out/include/compat_defs.h
|
||||
install -D $BSDSRCDIR/include/cdbw.h $out/include/cdbw.h
|
||||
install -D $BSDSRCDIR/sys/sys/cdbr.h $out/include/cdbr.h
|
||||
install -D compat_defs.h $dev/include/compat_defs.h
|
||||
install -D $BSDSRCDIR/include/cdbw.h $dev/include/cdbw.h
|
||||
install -D $BSDSRCDIR/sys/sys/cdbr.h $dev/include/cdbr.h
|
||||
install -D $BSDSRCDIR/sys/sys/featuretest.h \
|
||||
$out/include/sys/featuretest.h
|
||||
install -D $BSDSRCDIR/sys/sys/md5.h $out/include/md5.h
|
||||
install -D $BSDSRCDIR/sys/sys/rmd160.h $out/include/rmd160.h
|
||||
install -D $BSDSRCDIR/sys/sys/sha1.h $out/include/sha1.h
|
||||
install -D $BSDSRCDIR/sys/sys/sha2.h $out/include/sha2.h
|
||||
install -D $BSDSRCDIR/sys/sys/queue.h $out/include/sys/queue.h
|
||||
install -D $BSDSRCDIR/include/vis.h $out/include/vis.h
|
||||
install -D $BSDSRCDIR/include/db.h $out/include/db.h
|
||||
install -D $BSDSRCDIR/include/netconfig.h $out/include/netconfig.h
|
||||
install -D $BSDSRCDIR/include/utmpx.h $out/include/utmpx.h
|
||||
install -D $BSDSRCDIR/include/tzfile.h $out/include/tzfile.h
|
||||
install -D $BSDSRCDIR/sys/sys/tree.h $out/include/sys/tree.h
|
||||
install -D $BSDSRCDIR/include/nl_types.h $out/include/nl_types.h
|
||||
install -D $BSDSRCDIR/include/stringlist.h $out/include/stringlist.h
|
||||
$dev/include/sys/featuretest.h
|
||||
install -D $BSDSRCDIR/sys/sys/md5.h $dev/include/md5.h
|
||||
install -D $BSDSRCDIR/sys/sys/rmd160.h $dev/include/rmd160.h
|
||||
install -D $BSDSRCDIR/sys/sys/sha1.h $dev/include/sha1.h
|
||||
install -D $BSDSRCDIR/sys/sys/sha2.h $dev/include/sha2.h
|
||||
install -D $BSDSRCDIR/sys/sys/queue.h $dev/include/sys/queue.h
|
||||
install -D $BSDSRCDIR/include/vis.h $dev/include/vis.h
|
||||
install -D $BSDSRCDIR/include/db.h $dev/include/db.h
|
||||
install -D $BSDSRCDIR/include/netconfig.h $dev/include/netconfig.h
|
||||
install -D $BSDSRCDIR/include/utmpx.h $dev/include/utmpx.h
|
||||
install -D $BSDSRCDIR/include/tzfile.h $dev/include/tzfile.h
|
||||
install -D $BSDSRCDIR/sys/sys/tree.h $dev/include/sys/tree.h
|
||||
install -D $BSDSRCDIR/include/nl_types.h $dev/include/nl_types.h
|
||||
install -D $BSDSRCDIR/include/stringlist.h $dev/include/stringlist.h
|
||||
|
||||
# Collapse includes slightly to fix dangling reference
|
||||
install -D $BSDSRCDIR/common/include/rpc/types.h $out/include/rpc/types.h
|
||||
sed -i '1s;^;#include "nbtool_config.h"\n;' $out/include/rpc/types.h
|
||||
install -D $BSDSRCDIR/common/include/rpc/types.h $dev/include/rpc/types.h
|
||||
sed -i '1s;^;#include "nbtool_config.h"\n;' $dev/include/rpc/types.h
|
||||
''
|
||||
+ lib.optionalString stdenv.isDarwin ''
|
||||
mkdir -p $out/include/ssp
|
||||
touch $out/include/ssp/ssp.h
|
||||
mkdir -p $dev/include/ssp
|
||||
touch $dev/include/ssp/ssp.h
|
||||
''
|
||||
+ ''
|
||||
mkdir -p $out/lib/pkgconfig
|
||||
substitute ${./libbsd-overlay.pc} $out/lib/pkgconfig/libbsd-overlay.pc \
|
||||
--subst-var-by out $out \
|
||||
mkdir -p $dev/lib/pkgconfig
|
||||
substitute ${./libbsd-overlay.pc} $dev/lib/pkgconfig/libbsd-overlay.pc \
|
||||
--subst-var-by out "$out" \
|
||||
--subst-var-by includedir "$dev/include" \
|
||||
--subst-var-by version ${version}
|
||||
'';
|
||||
extraPaths = [
|
||||
@ -132,8 +135,7 @@ mkDerivation (
|
||||
"lib/libc"
|
||||
"lib/libutil"
|
||||
"external/bsd/flex"
|
||||
"sys"
|
||||
"common/include/rpc/types.h"
|
||||
] ++ _mainLibcExtraPaths;
|
||||
"sys/sys"
|
||||
];
|
||||
}
|
||||
)
|
||||
|
@ -7,7 +7,6 @@
|
||||
mandoc,
|
||||
byacc,
|
||||
flex,
|
||||
rsync,
|
||||
compatIfNeeded,
|
||||
cksum,
|
||||
}:
|
||||
@ -22,7 +21,6 @@ mkDerivation {
|
||||
mandoc
|
||||
byacc
|
||||
flex
|
||||
rsync
|
||||
];
|
||||
buildInputs = compatIfNeeded;
|
||||
extraPaths = [ cksum.path ];
|
||||
|
@ -14,7 +14,6 @@
|
||||
lorder,
|
||||
tsort,
|
||||
statHook,
|
||||
rsync,
|
||||
headers,
|
||||
sys-headers,
|
||||
ld_elf_so,
|
||||
@ -38,7 +37,6 @@ mkDerivation {
|
||||
lorder
|
||||
tsort
|
||||
statHook
|
||||
rsync
|
||||
];
|
||||
buildInputs = [ headers ];
|
||||
extraPaths = [
|
||||
|
@ -2,7 +2,6 @@
|
||||
mkDerivation,
|
||||
bsdSetupHook,
|
||||
netbsdSetupHook,
|
||||
rsync,
|
||||
compatIfNeeded,
|
||||
}:
|
||||
|
||||
@ -12,7 +11,6 @@ mkDerivation {
|
||||
nativeBuildInputs = [
|
||||
bsdSetupHook
|
||||
netbsdSetupHook
|
||||
rsync
|
||||
];
|
||||
propagatedBuildInputs = compatIfNeeded;
|
||||
extraPaths = [
|
||||
|
@ -1,11 +1,20 @@
|
||||
{
|
||||
lib,
|
||||
stdenvLibcMinimal,
|
||||
mkDerivation,
|
||||
libc,
|
||||
libcMinimal,
|
||||
}:
|
||||
|
||||
mkDerivation {
|
||||
path = "lib/i18n_module";
|
||||
|
||||
libcMinimal = true;
|
||||
|
||||
# Hack around GCC's limits.h missing the include_next we want See
|
||||
# https://gcc.gnu.org/legacy-ml/gcc/2003-10/msg01278.html
|
||||
NIX_CFLAGS_COMPILE_BEFORE = "-isystem ${stdenvLibcMinimal.cc.libc.dev}/include";
|
||||
|
||||
extraPaths = [ libcMinimal.path ];
|
||||
|
||||
meta.platforms = lib.platforms.netbsd;
|
||||
extraPaths = [ libc.path ];
|
||||
}
|
||||
|
@ -7,7 +7,6 @@
|
||||
install,
|
||||
mandoc,
|
||||
groff,
|
||||
rsync,
|
||||
nbperf,
|
||||
rpcgen,
|
||||
defaultMakeFlags,
|
||||
@ -24,7 +23,6 @@ mkDerivation {
|
||||
install
|
||||
mandoc
|
||||
groff
|
||||
rsync
|
||||
nbperf
|
||||
rpcgen
|
||||
];
|
||||
|
@ -8,7 +8,6 @@
|
||||
makeMinimal,
|
||||
mandoc,
|
||||
groff,
|
||||
rsync,
|
||||
compatIfNeeded,
|
||||
fts,
|
||||
|
||||
@ -36,7 +35,6 @@ mkDerivation {
|
||||
makeMinimal
|
||||
mandoc
|
||||
groff
|
||||
rsync
|
||||
];
|
||||
skipIncludesPhase = true;
|
||||
buildInputs =
|
||||
|
@ -1,7 +1,7 @@
|
||||
{
|
||||
lib,
|
||||
mkDerivation,
|
||||
libc,
|
||||
libcMinimal,
|
||||
defaultMakeFlags,
|
||||
}:
|
||||
|
||||
@ -9,13 +9,16 @@ mkDerivation {
|
||||
noLibc = true;
|
||||
path = "libexec/ld.elf_so";
|
||||
meta.platforms = lib.platforms.netbsd;
|
||||
LIBC_PIC = "${libc}/lib/libc_pic.a";
|
||||
LIBC_PIC = "${libcMinimal}/lib/libc_pic.a";
|
||||
# Hack to prevent a symlink being installed here for compatibility.
|
||||
SHLINKINSTALLDIR = "/usr/libexec";
|
||||
USE_FORT = "yes";
|
||||
makeFlags = defaultMakeFlags ++ [
|
||||
"BINDIR=$(out)/libexec"
|
||||
"CLIBOBJ=${libc}/lib"
|
||||
"CLIBOBJ=${libcMinimal}/lib"
|
||||
];
|
||||
extraPaths = [
|
||||
libcMinimal.path
|
||||
"sys"
|
||||
];
|
||||
extraPaths = [ libc.path ] ++ libc.extraPaths;
|
||||
}
|
||||
|
@ -1,102 +1,52 @@
|
||||
{
|
||||
lib,
|
||||
mkDerivation,
|
||||
defaultMakeFlags,
|
||||
_mainLibcExtraPaths,
|
||||
bsdSetupHook,
|
||||
netbsdSetupHook,
|
||||
makeMinimal,
|
||||
install,
|
||||
mandoc,
|
||||
groff,
|
||||
flex,
|
||||
byacc,
|
||||
genassym,
|
||||
gencat,
|
||||
lorder,
|
||||
tsort,
|
||||
statHook,
|
||||
rsync,
|
||||
rpcgen,
|
||||
csu,
|
||||
headers,
|
||||
symlinkJoin,
|
||||
libcMinimal,
|
||||
libpthread,
|
||||
libm,
|
||||
libresolv,
|
||||
librpcsvc,
|
||||
i18n_module,
|
||||
libutil,
|
||||
librt,
|
||||
libcrypt,
|
||||
version,
|
||||
}:
|
||||
|
||||
mkDerivation {
|
||||
noLibc = true;
|
||||
path = "lib/libc";
|
||||
USE_FORT = "yes";
|
||||
MKPROFILE = "no";
|
||||
extraPaths = _mainLibcExtraPaths ++ [ "external/bsd/jemalloc" ];
|
||||
nativeBuildInputs = [
|
||||
bsdSetupHook
|
||||
netbsdSetupHook
|
||||
makeMinimal
|
||||
install
|
||||
mandoc
|
||||
groff
|
||||
flex
|
||||
byacc
|
||||
genassym
|
||||
gencat
|
||||
lorder
|
||||
tsort
|
||||
statHook
|
||||
rsync
|
||||
rpcgen
|
||||
symlinkJoin rec {
|
||||
name = "${pname}-${version}";
|
||||
pname = "libc-netbsd";
|
||||
inherit version;
|
||||
|
||||
outputs = [
|
||||
"out"
|
||||
"dev"
|
||||
"man"
|
||||
];
|
||||
buildInputs = [
|
||||
headers
|
||||
csu
|
||||
];
|
||||
env.NIX_CFLAGS_COMPILE = "-B${csu}/lib -fcommon";
|
||||
|
||||
paths =
|
||||
lib.concatMap
|
||||
(p: [
|
||||
(lib.getDev p)
|
||||
(lib.getLib p)
|
||||
(lib.getMan p)
|
||||
])
|
||||
[
|
||||
libcMinimal
|
||||
libm
|
||||
libpthread
|
||||
libresolv
|
||||
librpcsvc
|
||||
i18n_module
|
||||
libutil
|
||||
librt
|
||||
libcrypt
|
||||
];
|
||||
|
||||
postBuild = ''
|
||||
rm -r "$out/nix-support"
|
||||
fixupPhase
|
||||
'';
|
||||
|
||||
meta.platforms = lib.platforms.netbsd;
|
||||
SHLIBINSTALLDIR = "$(out)/lib";
|
||||
MKPICINSTALL = "yes";
|
||||
NLSDIR = "$(out)/share/nls";
|
||||
makeFlags = defaultMakeFlags ++ [ "FILESDIR=$(out)/var/db" ];
|
||||
postInstall = ''
|
||||
pushd ${headers}
|
||||
find . -type d -exec mkdir -p $out/\{} \;
|
||||
find . \( -type f -o -type l \) -exec cp -pr \{} $out/\{} \;
|
||||
popd
|
||||
|
||||
pushd ${csu}
|
||||
find . -type d -exec mkdir -p $out/\{} \;
|
||||
find . \( -type f -o -type l \) -exec cp -pr \{} $out/\{} \;
|
||||
popd
|
||||
|
||||
NIX_CFLAGS_COMPILE+=" -B$out/lib"
|
||||
NIX_CFLAGS_COMPILE+=" -I$out/include"
|
||||
NIX_LDFLAGS+=" -L$out/lib"
|
||||
|
||||
make -C $BSDSRCDIR/lib/libpthread $makeFlags
|
||||
make -C $BSDSRCDIR/lib/libpthread $makeFlags install
|
||||
|
||||
make -C $BSDSRCDIR/lib/libm $makeFlags
|
||||
make -C $BSDSRCDIR/lib/libm $makeFlags install
|
||||
|
||||
make -C $BSDSRCDIR/lib/libresolv $makeFlags
|
||||
make -C $BSDSRCDIR/lib/libresolv $makeFlags install
|
||||
|
||||
make -C $BSDSRCDIR/lib/librpcsvc $makeFlags
|
||||
make -C $BSDSRCDIR/lib/librpcsvc $makeFlags install
|
||||
|
||||
make -C $BSDSRCDIR/lib/i18n_module $makeFlags
|
||||
make -C $BSDSRCDIR/lib/i18n_module $makeFlags install
|
||||
|
||||
make -C $BSDSRCDIR/lib/libutil $makeFlags
|
||||
make -C $BSDSRCDIR/lib/libutil $makeFlags install
|
||||
|
||||
make -C $BSDSRCDIR/lib/librt $makeFlags
|
||||
make -C $BSDSRCDIR/lib/librt $makeFlags install
|
||||
|
||||
make -C $BSDSRCDIR/lib/libcrypt $makeFlags
|
||||
make -C $BSDSRCDIR/lib/libcrypt $makeFlags install
|
||||
'';
|
||||
postPatch = ''
|
||||
sed -i 's,/usr\(/include/sys/syscall.h\),${headers}\1,g' \
|
||||
$BSDSRCDIR/lib/{libc,librt}/sys/Makefile.inc
|
||||
'';
|
||||
}
|
||||
|
85
pkgs/os-specific/bsd/netbsd/pkgs/libcMinimal.nix
Normal file
85
pkgs/os-specific/bsd/netbsd/pkgs/libcMinimal.nix
Normal file
@ -0,0 +1,85 @@
|
||||
{
|
||||
lib,
|
||||
mkDerivation,
|
||||
defaultMakeFlags,
|
||||
bsdSetupHook,
|
||||
netbsdSetupHook,
|
||||
makeMinimal,
|
||||
install,
|
||||
mandoc,
|
||||
groff,
|
||||
flex,
|
||||
byacc,
|
||||
genassym,
|
||||
gencat,
|
||||
lorder,
|
||||
tsort,
|
||||
statHook,
|
||||
rpcgen,
|
||||
csu,
|
||||
headers,
|
||||
}:
|
||||
|
||||
mkDerivation {
|
||||
noLibc = true;
|
||||
path = "lib/libc";
|
||||
pname = "libcMinimal-netbsd";
|
||||
outputs = [
|
||||
"out"
|
||||
"dev"
|
||||
"man"
|
||||
"tags"
|
||||
];
|
||||
USE_FORT = "yes";
|
||||
MKPROFILE = "no";
|
||||
extraPaths = [
|
||||
"common"
|
||||
"lib/i18n_module"
|
||||
"libexec/ld.elf_so"
|
||||
"sys"
|
||||
"external/bsd/jemalloc"
|
||||
];
|
||||
nativeBuildInputs = [
|
||||
bsdSetupHook
|
||||
netbsdSetupHook
|
||||
makeMinimal
|
||||
install
|
||||
mandoc
|
||||
groff
|
||||
flex
|
||||
byacc
|
||||
genassym
|
||||
gencat
|
||||
lorder
|
||||
tsort
|
||||
statHook
|
||||
rpcgen
|
||||
];
|
||||
buildInputs = [
|
||||
headers
|
||||
csu
|
||||
];
|
||||
env.NIX_CFLAGS_COMPILE = "-B${csu}/lib -fcommon";
|
||||
meta.platforms = lib.platforms.netbsd;
|
||||
SHLIBINSTALLDIR = "$(out)/lib";
|
||||
MKPICINSTALL = "yes";
|
||||
NLSDIR = "$(out)/share/nls";
|
||||
makeFlags = defaultMakeFlags ++ [ "FILESDIR=$(out)/var/db" ];
|
||||
postInstall = ''
|
||||
pushd ${headers}
|
||||
find include -type d -exec mkdir -p "$dev/{}" ';'
|
||||
find include '(' -type f -o -type l ')' -exec cp -pr "{}" "$dev/{}" ';'
|
||||
popd
|
||||
|
||||
pushd ${csu}
|
||||
find lib -type d -exec mkdir -p "$out/{}" ';'
|
||||
find lib '(' -type f -o -type l ')' -exec cp -pr "{}" "$out/{}" ';'
|
||||
popd
|
||||
|
||||
moveToOutput var/db/libc.tags "$tags"
|
||||
'';
|
||||
|
||||
postPatch = ''
|
||||
sed -i 's,/usr\(/include/sys/syscall.h\),${headers}\1,g' lib/lib*/sys/Makefile.inc
|
||||
'';
|
||||
}
|
@ -2,6 +2,14 @@
|
||||
|
||||
mkDerivation {
|
||||
path = "lib/libcrypt";
|
||||
|
||||
libcMinimal = true;
|
||||
|
||||
outputs = [
|
||||
"out"
|
||||
"man"
|
||||
];
|
||||
|
||||
SHLIBINSTALLDIR = "$(out)/lib";
|
||||
meta.platforms = lib.platforms.netbsd;
|
||||
}
|
||||
|
@ -1,12 +1,18 @@
|
||||
{
|
||||
lib,
|
||||
mkDerivation,
|
||||
sys,
|
||||
}:
|
||||
{ lib, mkDerivation }:
|
||||
|
||||
mkDerivation {
|
||||
path = "lib/libm";
|
||||
|
||||
libcMinimal = true;
|
||||
|
||||
outputs = [
|
||||
"out"
|
||||
"man"
|
||||
];
|
||||
|
||||
SHLIBINSTALLDIR = "$(out)/lib";
|
||||
|
||||
extraPaths = [ "sys" ];
|
||||
|
||||
meta.platforms = lib.platforms.netbsd;
|
||||
extraPaths = [ sys.path ];
|
||||
}
|
||||
|
@ -1,27 +1,37 @@
|
||||
{
|
||||
lib,
|
||||
stdenvLibcMinimal,
|
||||
mkDerivation,
|
||||
headers,
|
||||
libc,
|
||||
libcMinimal,
|
||||
librt,
|
||||
sys,
|
||||
}:
|
||||
|
||||
mkDerivation (
|
||||
import ./base.nix
|
||||
// {
|
||||
pname = "libpthread";
|
||||
installPhase = null;
|
||||
noCC = false;
|
||||
dontBuild = false;
|
||||
buildInputs = [ headers ];
|
||||
|
||||
libcMinimal = true;
|
||||
|
||||
outputs = [
|
||||
"out"
|
||||
"dev"
|
||||
"man"
|
||||
];
|
||||
|
||||
SHLIBINSTALLDIR = "$(out)/lib";
|
||||
|
||||
# Hack around GCC's limits.h missing the include_next we want See
|
||||
# https://gcc.gnu.org/legacy-ml/gcc/2003-10/msg01278.html
|
||||
NIX_CFLAGS_COMPILE_BEFORE = "-isystem ${stdenvLibcMinimal.cc.libc.dev}/include";
|
||||
|
||||
extraPaths = [
|
||||
"common"
|
||||
libc.path
|
||||
libcMinimal.path
|
||||
librt.path
|
||||
sys.path
|
||||
"sys"
|
||||
];
|
||||
|
||||
meta.platforms = lib.platforms.netbsd;
|
||||
}
|
||||
)
|
||||
|
@ -1,11 +1,15 @@
|
||||
{
|
||||
lib,
|
||||
mkDerivation,
|
||||
libc,
|
||||
libcMinimal,
|
||||
}:
|
||||
|
||||
mkDerivation {
|
||||
path = "lib/libresolv";
|
||||
|
||||
libcMinimal = true;
|
||||
|
||||
extraPaths = [ libcMinimal.path ];
|
||||
|
||||
meta.platforms = lib.platforms.netbsd;
|
||||
extraPaths = [ libc.path ];
|
||||
}
|
||||
|
@ -14,8 +14,14 @@
|
||||
|
||||
mkDerivation {
|
||||
path = "lib/librpcsvc";
|
||||
makeFlags = defaultMakeFlags ++ [ "INCSDIR=$(out)/include/rpcsvc" ];
|
||||
meta.platforms = lib.platforms.netbsd;
|
||||
|
||||
libcMinimal = true;
|
||||
|
||||
outputs = [
|
||||
"out"
|
||||
"dev"
|
||||
];
|
||||
|
||||
nativeBuildInputs = [
|
||||
bsdSetupHook
|
||||
netbsdSetupHook
|
||||
@ -26,4 +32,8 @@ mkDerivation {
|
||||
rpcgen
|
||||
statHook
|
||||
];
|
||||
|
||||
makeFlags = defaultMakeFlags ++ [ "INCSDIR=$(dev)/include/rpcsvc" ];
|
||||
|
||||
meta.platforms = lib.platforms.netbsd;
|
||||
}
|
||||
|
@ -1,13 +1,22 @@
|
||||
{
|
||||
lib,
|
||||
mkDerivation,
|
||||
libc,
|
||||
headers,
|
||||
libcMinimal,
|
||||
}:
|
||||
|
||||
mkDerivation {
|
||||
path = "lib/librt";
|
||||
|
||||
libcMinimal = true;
|
||||
|
||||
outputs = [
|
||||
"out"
|
||||
"man"
|
||||
];
|
||||
|
||||
extraPaths = [ libcMinimal.path ] ++ libcMinimal.extraPaths;
|
||||
|
||||
inherit (libcMinimal) postPatch;
|
||||
|
||||
meta.platforms = lib.platforms.netbsd;
|
||||
extraPaths = [ libc.path ] ++ libc.extraPaths;
|
||||
inherit (libc) postPatch;
|
||||
}
|
||||
|
@ -10,7 +10,6 @@
|
||||
statHook,
|
||||
nbperf,
|
||||
tic,
|
||||
rsync,
|
||||
compatIfNeeded,
|
||||
}:
|
||||
|
||||
@ -27,7 +26,6 @@ mkDerivation {
|
||||
statHook
|
||||
nbperf
|
||||
tic
|
||||
rsync
|
||||
];
|
||||
buildInputs = compatIfNeeded;
|
||||
SHLIBINSTALLDIR = "$(out)/lib";
|
||||
|
@ -1,7 +1,7 @@
|
||||
{
|
||||
lib,
|
||||
stdenvLibcMinimal,
|
||||
mkDerivation,
|
||||
libc,
|
||||
sys,
|
||||
bsdSetupHook,
|
||||
netbsdSetupHook,
|
||||
makeMinimal,
|
||||
@ -11,17 +11,19 @@
|
||||
lorder,
|
||||
mandoc,
|
||||
statHook,
|
||||
rsync,
|
||||
headers,
|
||||
}:
|
||||
|
||||
mkDerivation {
|
||||
path = "lib/libutil";
|
||||
extraPaths = [
|
||||
"common"
|
||||
"lib/libc"
|
||||
"sys"
|
||||
|
||||
libcMinimal = true;
|
||||
|
||||
outputs = [
|
||||
"out"
|
||||
"man"
|
||||
];
|
||||
|
||||
nativeBuildInputs = [
|
||||
bsdSetupHook
|
||||
netbsdSetupHook
|
||||
@ -32,8 +34,19 @@ mkDerivation {
|
||||
lorder
|
||||
mandoc
|
||||
statHook
|
||||
rsync
|
||||
];
|
||||
buildInputs = [ headers ];
|
||||
|
||||
SHLIBINSTALLDIR = "$(out)/lib";
|
||||
|
||||
# Hack around GCC's limits.h missing the include_next we want See
|
||||
# https://gcc.gnu.org/legacy-ml/gcc/2003-10/msg01278.html
|
||||
NIX_CFLAGS_COMPILE_BEFORE = "-isystem ${stdenvLibcMinimal.cc.libc.dev}/include";
|
||||
|
||||
extraPaths = [
|
||||
"common"
|
||||
"lib/libc"
|
||||
"sys"
|
||||
];
|
||||
|
||||
meta.platforms = lib.platforms.netbsd;
|
||||
}
|
||||
|
@ -6,7 +6,6 @@
|
||||
install,
|
||||
mandoc,
|
||||
groff,
|
||||
rsync,
|
||||
}:
|
||||
|
||||
mkDerivation {
|
||||
@ -18,6 +17,5 @@ mkDerivation {
|
||||
install
|
||||
mandoc
|
||||
groff
|
||||
rsync
|
||||
];
|
||||
}
|
||||
|
@ -4,7 +4,6 @@
|
||||
stdenv,
|
||||
bsdSetupHook,
|
||||
netbsdSetupHook,
|
||||
rsync,
|
||||
}:
|
||||
|
||||
mkDerivation {
|
||||
@ -15,7 +14,6 @@ mkDerivation {
|
||||
nativeBuildInputs = [
|
||||
bsdSetupHook
|
||||
netbsdSetupHook
|
||||
rsync
|
||||
];
|
||||
|
||||
dontBuild = true;
|
||||
|
@ -2,7 +2,6 @@
|
||||
mkDerivation,
|
||||
bsdSetupHook,
|
||||
netbsdSetupHook,
|
||||
rsync,
|
||||
make,
|
||||
make-rules,
|
||||
}:
|
||||
@ -14,7 +13,6 @@ mkDerivation {
|
||||
nativeBuildInputs = [
|
||||
bsdSetupHook
|
||||
netbsdSetupHook
|
||||
rsync
|
||||
];
|
||||
|
||||
skipIncludesPhase = true;
|
||||
|
@ -3,6 +3,7 @@
|
||||
stdenv,
|
||||
stdenvNoCC,
|
||||
crossLibcStdenv,
|
||||
stdenvLibcMinimal,
|
||||
runCommand,
|
||||
rsync,
|
||||
source,
|
||||
@ -28,6 +29,8 @@ lib.makeOverridable (
|
||||
stdenvNoCC
|
||||
else if attrs.noLibc or false then
|
||||
crossLibcStdenv
|
||||
else if attrs.libcMinimal or false then
|
||||
stdenvLibcMinimal
|
||||
else
|
||||
stdenv;
|
||||
in
|
||||
@ -59,7 +62,6 @@ lib.makeOverridable (
|
||||
mandoc
|
||||
groff
|
||||
statHook
|
||||
rsync
|
||||
];
|
||||
buildInputs = compatIfNeeded;
|
||||
|
||||
|
@ -6,7 +6,6 @@
|
||||
install,
|
||||
mandoc,
|
||||
groff,
|
||||
rsync,
|
||||
}:
|
||||
|
||||
# Don't add this to nativeBuildInputs directly.
|
||||
@ -21,6 +20,5 @@ mkDerivation {
|
||||
install
|
||||
mandoc
|
||||
groff
|
||||
rsync
|
||||
];
|
||||
}
|
||||
|
@ -9,7 +9,6 @@
|
||||
tsort,
|
||||
lorder,
|
||||
statHook,
|
||||
rsync,
|
||||
uudecode,
|
||||
config,
|
||||
genassym,
|
||||
@ -53,7 +52,6 @@
|
||||
tsort
|
||||
lorder
|
||||
statHook
|
||||
rsync
|
||||
uudecode
|
||||
config
|
||||
genassym
|
||||
|
@ -9,7 +9,6 @@
|
||||
tsort,
|
||||
lorder,
|
||||
statHook,
|
||||
rsync,
|
||||
uudecode,
|
||||
config,
|
||||
genassym,
|
||||
@ -28,7 +27,6 @@ let
|
||||
tsort
|
||||
lorder
|
||||
statHook
|
||||
rsync
|
||||
uudecode
|
||||
config
|
||||
genassym
|
||||
|
@ -9,7 +9,6 @@
|
||||
tsort,
|
||||
lorder,
|
||||
statHook,
|
||||
rsync,
|
||||
uudecode,
|
||||
config,
|
||||
genassym,
|
||||
@ -28,7 +27,6 @@ let
|
||||
tsort
|
||||
lorder
|
||||
statHook
|
||||
rsync
|
||||
uudecode
|
||||
config
|
||||
genassym
|
||||
|
@ -7,7 +7,6 @@
|
||||
mandoc,
|
||||
groff,
|
||||
nbperf,
|
||||
rsync,
|
||||
compatIfNeeded,
|
||||
defaultMakeFlags,
|
||||
libterminfo,
|
||||
@ -25,7 +24,6 @@ mkDerivation {
|
||||
mandoc
|
||||
groff
|
||||
nbperf
|
||||
rsync
|
||||
];
|
||||
makeFlags = defaultMakeFlags ++ [ "TOOLDIR=$(out)" ];
|
||||
extraPaths = [
|
||||
|
@ -6,7 +6,6 @@
|
||||
install,
|
||||
mandoc,
|
||||
groff,
|
||||
rsync,
|
||||
}:
|
||||
|
||||
mkDerivation {
|
||||
@ -18,6 +17,5 @@ mkDerivation {
|
||||
install
|
||||
mandoc
|
||||
groff
|
||||
rsync
|
||||
];
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user