2020-03-09 06:10:06 +00:00
|
|
|
|
{ stdenv, lib, stdenvNoCC
|
2020-03-09 06:10:06 +00:00
|
|
|
|
, pkgsBuildBuild, pkgsBuildHost, pkgsBuildTarget, pkgsHostHost, pkgsTargetTarget
|
|
|
|
|
, buildPackages, splicePackages, newScope
|
2020-03-09 06:10:06 +00:00
|
|
|
|
, bsdSetupHook, makeSetupHook, fetchcvs, groff, mandoc, byacc, flex
|
|
|
|
|
, zlib
|
|
|
|
|
, writeText, symlinkJoin
|
|
|
|
|
}:
|
2018-04-12 06:14:15 +01:00
|
|
|
|
|
|
|
|
|
let
|
2021-04-19 23:23:30 +01:00
|
|
|
|
inherit (buildPackages.buildPackages) rsync;
|
|
|
|
|
|
2021-04-14 22:38:23 +01:00
|
|
|
|
fetchNetBSD = path: version: sha256: fetchcvs {
|
2018-04-12 06:14:15 +01:00
|
|
|
|
cvsRoot = ":pserver:anoncvs@anoncvs.NetBSD.org:/cvsroot";
|
|
|
|
|
module = "src/${path}";
|
|
|
|
|
inherit sha256;
|
2018-07-28 17:29:02 +01:00
|
|
|
|
tag = "netbsd-${lib.replaceStrings ["."] ["-"] version}-RELEASE";
|
2018-04-12 06:14:15 +01:00
|
|
|
|
};
|
|
|
|
|
|
2020-03-09 06:10:06 +00:00
|
|
|
|
netbsdSetupHook = makeSetupHook {
|
|
|
|
|
name = "netbsd-setup-hook";
|
|
|
|
|
} ./setup-hook.sh;
|
|
|
|
|
|
2020-03-09 06:10:06 +00:00
|
|
|
|
otherSplices = {
|
|
|
|
|
selfBuildBuild = pkgsBuildBuild.netbsd;
|
|
|
|
|
selfBuildHost = pkgsBuildHost.netbsd;
|
|
|
|
|
selfBuildTarget = pkgsBuildTarget.netbsd;
|
|
|
|
|
selfHostHost = pkgsHostHost.netbsd;
|
|
|
|
|
selfTargetTarget = pkgsTargetTarget.netbsd or {}; # might be missing
|
2018-07-28 17:29:02 +01:00
|
|
|
|
};
|
2018-10-06 20:40:09 +01:00
|
|
|
|
|
2021-09-03 15:02:58 +01:00
|
|
|
|
defaultMakeFlags = [
|
|
|
|
|
"MKSOFTFLOAT=${if stdenv.hostPlatform.gcc.float or (stdenv.hostPlatform.parsed.abi.float or "hard") == "soft"
|
|
|
|
|
then "yes"
|
|
|
|
|
else "no"}"
|
|
|
|
|
];
|
|
|
|
|
|
2020-03-09 06:10:06 +00:00
|
|
|
|
in lib.makeScopeWithSplicing
|
|
|
|
|
splicePackages
|
|
|
|
|
newScope
|
|
|
|
|
otherSplices
|
2021-05-06 20:48:25 +01:00
|
|
|
|
(_: {})
|
|
|
|
|
(_: {})
|
2020-03-09 06:10:06 +00:00
|
|
|
|
(self: let
|
|
|
|
|
inherit (self) mkDerivation;
|
|
|
|
|
in {
|
|
|
|
|
|
|
|
|
|
# Why do we have splicing and yet do `nativeBuildInputs = with self; ...`?
|
|
|
|
|
#
|
|
|
|
|
# We use `lib.makeScopeWithSplicing` because this should be used for all
|
|
|
|
|
# nested package sets which support cross, so the inner `callPackage` works
|
|
|
|
|
# correctly. But for the inline packages we don't bother to use
|
|
|
|
|
# `callPackage`.
|
|
|
|
|
#
|
|
|
|
|
# We still could have tried to `with` a big spliced packages set, but
|
|
|
|
|
# splicing is jank and causes a number of bootstrapping infinite recursions
|
|
|
|
|
# if one is not careful. Pulling deps out of the right package set directly
|
|
|
|
|
# side-steps splicing entirely and avoids those footguns.
|
|
|
|
|
#
|
|
|
|
|
# For non-bootstrap-critical packages, we might as well use `callPackage` for
|
|
|
|
|
# consistency with everything else, and maybe put in separate files too.
|
|
|
|
|
|
|
|
|
|
compatIfNeeded = lib.optional (!stdenvNoCC.hostPlatform.isNetBSD) self.compat;
|
2018-10-06 20:40:09 +01:00
|
|
|
|
|
2018-07-28 17:29:02 +01:00
|
|
|
|
mkDerivation = lib.makeOverridable (attrs: let
|
|
|
|
|
stdenv' = if attrs.noCC or false then stdenvNoCC else stdenv;
|
|
|
|
|
in stdenv'.mkDerivation ({
|
|
|
|
|
name = "${attrs.pname or (baseNameOf attrs.path)}-netbsd-${attrs.version}";
|
2021-04-19 20:49:22 +01:00
|
|
|
|
src = fetchNetBSD attrs.path attrs.version attrs.sha256;
|
2018-04-12 06:14:15 +01:00
|
|
|
|
|
|
|
|
|
extraPaths = [ ];
|
2018-07-28 17:29:02 +01:00
|
|
|
|
|
2020-03-09 06:10:06 +00:00
|
|
|
|
nativeBuildInputs = with buildPackages.netbsd; [
|
2020-03-09 06:10:06 +00:00
|
|
|
|
bsdSetupHook netbsdSetupHook
|
2020-03-09 06:10:06 +00:00
|
|
|
|
makeMinimal
|
2021-12-11 01:24:44 +00:00
|
|
|
|
install tsort lorder buildPackages.mandoc groff statHook rsync
|
2020-03-09 06:10:06 +00:00
|
|
|
|
];
|
2020-03-09 06:10:06 +00:00
|
|
|
|
buildInputs = with self; compatIfNeeded;
|
2018-07-28 17:29:02 +01:00
|
|
|
|
|
2020-03-09 06:10:06 +00:00
|
|
|
|
HOST_SH = stdenv'.shell;
|
2018-04-12 06:14:15 +01:00
|
|
|
|
|
2018-07-28 17:29:02 +01:00
|
|
|
|
MACHINE_ARCH = {
|
2021-06-05 02:17:46 +01:00
|
|
|
|
i486 = "i386";
|
|
|
|
|
i586 = "i386";
|
2019-08-13 22:52:01 +01:00
|
|
|
|
i686 = "i386";
|
2018-07-28 17:29:02 +01:00
|
|
|
|
}.${stdenv'.hostPlatform.parsed.cpu.name}
|
|
|
|
|
or stdenv'.hostPlatform.parsed.cpu.name;
|
2018-04-12 06:14:15 +01:00
|
|
|
|
|
2018-07-28 17:29:02 +01:00
|
|
|
|
MACHINE = {
|
2019-08-13 22:52:01 +01:00
|
|
|
|
x86_64 = "amd64";
|
|
|
|
|
aarch64 = "evbarm64";
|
2021-06-05 02:17:46 +01:00
|
|
|
|
i486 = "i386";
|
|
|
|
|
i586 = "i386";
|
2019-08-13 22:52:01 +01:00
|
|
|
|
i686 = "i386";
|
2018-07-28 17:29:02 +01:00
|
|
|
|
}.${stdenv'.hostPlatform.parsed.cpu.name}
|
|
|
|
|
or stdenv'.hostPlatform.parsed.cpu.name;
|
2018-04-12 06:14:15 +01:00
|
|
|
|
|
2020-03-09 06:10:06 +00:00
|
|
|
|
BSD_PATH = attrs.path;
|
2018-04-12 06:14:15 +01:00
|
|
|
|
|
2021-09-03 15:02:58 +01:00
|
|
|
|
makeFlags = defaultMakeFlags;
|
|
|
|
|
|
2020-03-09 06:10:06 +00:00
|
|
|
|
strictDeps = true;
|
|
|
|
|
|
2018-04-12 06:14:15 +01:00
|
|
|
|
meta = with lib; {
|
2021-04-18 13:30:22 +01:00
|
|
|
|
maintainers = with maintainers; [ matthewbauer qyliss ];
|
2018-04-12 06:14:15 +01:00
|
|
|
|
platforms = platforms.unix;
|
|
|
|
|
license = licenses.bsd2;
|
|
|
|
|
};
|
2021-09-03 15:02:58 +01:00
|
|
|
|
|
2020-03-09 06:10:06 +00:00
|
|
|
|
} // lib.optionalAttrs stdenv'.hasCC {
|
|
|
|
|
# TODO should CC wrapper set this?
|
|
|
|
|
CPP = "${stdenv'.cc.targetPrefix}cpp";
|
2019-04-10 22:35:08 +01:00
|
|
|
|
} // lib.optionalAttrs stdenv'.isDarwin {
|
|
|
|
|
MKRELRO = "no";
|
2018-07-28 17:29:02 +01:00
|
|
|
|
} // lib.optionalAttrs (stdenv'.cc.isClang or false) {
|
2019-09-24 10:24:13 +01:00
|
|
|
|
HAVE_LLVM = lib.versions.major (lib.getVersion stdenv'.cc.cc);
|
2018-07-28 17:29:02 +01:00
|
|
|
|
} // lib.optionalAttrs (stdenv'.cc.isGNU or false) {
|
2019-09-24 10:24:13 +01:00
|
|
|
|
HAVE_GCC = lib.versions.major (lib.getVersion stdenv'.cc.cc);
|
2021-06-01 15:58:28 +01:00
|
|
|
|
} // lib.optionalAttrs (stdenv'.isx86_32) {
|
|
|
|
|
USE_SSP = "no";
|
2018-07-28 17:29:02 +01:00
|
|
|
|
} // lib.optionalAttrs (attrs.headersOnly or false) {
|
|
|
|
|
installPhase = "includesPhase";
|
|
|
|
|
dontBuild = true;
|
pkgsStatic.netbsd: fix nbtool_config.h conflicts
In pkgsStatic, /all/ build inputs are propagated. This means that
netbsd.compat was propagated, along with its setup hook, which broke
static glib builds because glib defines a function with the same name
as one in nbtool_config.h, and nbtool_config.h was being automatically
included in every C file processed by the compiler, in any transitive
dependent of netbsd.compat's setup hook.
To fix this, rather than forcing nbtool_config.h to be included for
_every_ C file in a derivation that depends on netbsd.compat, modify
the NetBSD-specific mkDerivation to detect files that need the header,
and patch it in there where appropriate. That way, only files that
are part of NetBSD will be affected, not all transitive dependents.
2021-11-03 16:50:59 +00:00
|
|
|
|
} // attrs // {
|
|
|
|
|
postPatch = lib.optionalString (!stdenv'.hostPlatform.isNetBSD) ''
|
|
|
|
|
# Files that use NetBSD-specific macros need to have nbtool_config.h
|
|
|
|
|
# included ahead of them on non-NetBSD platforms.
|
|
|
|
|
set +e
|
|
|
|
|
grep -Zlr "^__RCSID
|
|
|
|
|
^__BEGIN_DECLS" | xargs -0r grep -FLZ nbtool_config.h |
|
|
|
|
|
xargs -0tr sed -i '0,/^#/s//#include <nbtool_config.h>\n\0/'
|
|
|
|
|
set -e
|
|
|
|
|
'' + attrs.postPatch or "";
|
|
|
|
|
}));
|
2018-04-12 06:14:15 +01:00
|
|
|
|
|
2018-05-01 01:59:33 +01:00
|
|
|
|
##
|
2018-07-28 17:29:02 +01:00
|
|
|
|
## START BOOTSTRAPPING
|
2018-05-01 01:59:33 +01:00
|
|
|
|
##
|
2019-08-13 22:52:01 +01:00
|
|
|
|
makeMinimal = mkDerivation {
|
2018-04-12 06:14:15 +01:00
|
|
|
|
path = "tools/make";
|
2021-04-29 22:01:23 +01:00
|
|
|
|
sha256 = "0fh0nrnk18m613m5blrliq2aydciv51qhc0ihsj4k63incwbk90n";
|
2021-05-15 11:02:05 +01:00
|
|
|
|
version = "9.2";
|
2018-04-12 06:14:15 +01:00
|
|
|
|
|
2020-03-09 06:10:06 +00:00
|
|
|
|
buildInputs = with self; [];
|
2020-03-09 06:10:06 +00:00
|
|
|
|
nativeBuildInputs = with buildPackages.netbsd; [ bsdSetupHook netbsdSetupHook rsync ];
|
2018-04-12 06:14:15 +01:00
|
|
|
|
|
2018-07-28 17:29:02 +01:00
|
|
|
|
skipIncludesPhase = true;
|
|
|
|
|
|
2018-05-01 01:59:33 +01:00
|
|
|
|
postPatch = ''
|
2018-04-12 06:14:15 +01:00
|
|
|
|
patchShebangs configure
|
2020-03-09 06:10:06 +00:00
|
|
|
|
${self.make.postPatch}
|
2018-05-01 01:59:33 +01:00
|
|
|
|
'';
|
2020-03-09 06:10:06 +00:00
|
|
|
|
|
2018-05-01 01:59:33 +01:00
|
|
|
|
buildPhase = ''
|
2018-05-02 04:19:33 +01:00
|
|
|
|
runHook preBuild
|
2018-05-01 01:59:33 +01:00
|
|
|
|
|
|
|
|
|
sh ./buildmake.sh
|
|
|
|
|
|
2018-05-02 04:19:33 +01:00
|
|
|
|
runHook postBuild
|
2018-04-12 06:14:15 +01:00
|
|
|
|
'';
|
2020-03-09 06:10:06 +00:00
|
|
|
|
|
2018-04-12 06:14:15 +01:00
|
|
|
|
installPhase = ''
|
2018-05-01 01:59:33 +01:00
|
|
|
|
runHook preInstall
|
|
|
|
|
|
2018-04-12 06:14:15 +01:00
|
|
|
|
install -D nbmake $out/bin/nbmake
|
|
|
|
|
ln -s $out/bin/nbmake $out/bin/make
|
|
|
|
|
mkdir -p $out/share
|
2020-03-09 06:10:06 +00:00
|
|
|
|
cp -r $BSDSRCDIR/share/mk $out/share/mk
|
2018-05-01 01:59:33 +01:00
|
|
|
|
|
|
|
|
|
runHook postInstall
|
2018-04-12 06:14:15 +01:00
|
|
|
|
'';
|
2020-03-09 06:10:06 +00:00
|
|
|
|
|
2020-03-09 06:10:06 +00:00
|
|
|
|
extraPaths = with self; [ make.src ] ++ make.extraPaths;
|
2018-04-12 06:14:15 +01:00
|
|
|
|
};
|
|
|
|
|
|
2020-03-09 06:10:06 +00:00
|
|
|
|
compat = mkDerivation (let
|
2021-05-15 11:02:05 +01:00
|
|
|
|
version = "9.2";
|
2020-03-09 06:10:06 +00:00
|
|
|
|
commonDeps = [ zlib ];
|
|
|
|
|
in {
|
2018-04-12 06:14:15 +01:00
|
|
|
|
path = "tools/compat";
|
2021-04-29 22:01:23 +01:00
|
|
|
|
sha256 = "1vsxg7136nlhc72vpa664vs22874xh7ila95nkmsd8crn3z3cyn0";
|
2020-03-09 06:10:06 +00:00
|
|
|
|
inherit version;
|
2018-04-12 06:14:15 +01:00
|
|
|
|
|
2018-05-07 18:07:19 +01:00
|
|
|
|
setupHooks = [
|
|
|
|
|
../../../build-support/setup-hooks/role.bash
|
|
|
|
|
./compat-setup-hook.sh
|
|
|
|
|
];
|
2018-04-12 06:14:15 +01:00
|
|
|
|
|
2021-09-01 22:38:38 +01:00
|
|
|
|
preConfigure = ''
|
|
|
|
|
make include/.stamp configure nbtool_config.h.in defs.mk.in
|
|
|
|
|
'';
|
|
|
|
|
|
|
|
|
|
configurePlatforms = [ "build" "host" ];
|
|
|
|
|
configureFlags = [
|
|
|
|
|
"--cache-file=config.cache"
|
2021-11-03 16:55:36 +00:00
|
|
|
|
] ++ lib.optionals stdenv.hostPlatform.isMusl [
|
|
|
|
|
# We include this header in our musl package only for legacy
|
|
|
|
|
# compatibility, and compat works fine without it (and having it
|
|
|
|
|
# know about sys/cdefs.h breaks packages like glib when built
|
|
|
|
|
# statically).
|
|
|
|
|
"ac_cv_header_sys_cdefs_h=no"
|
2021-09-01 22:38:38 +01:00
|
|
|
|
];
|
|
|
|
|
|
2020-03-09 06:10:06 +00:00
|
|
|
|
nativeBuildInputs = with buildPackages.netbsd; commonDeps ++ [
|
2020-03-09 06:10:06 +00:00
|
|
|
|
bsdSetupHook netbsdSetupHook
|
2020-03-09 06:10:06 +00:00
|
|
|
|
makeMinimal
|
2021-04-19 23:23:30 +01:00
|
|
|
|
rsync
|
2020-03-09 06:10:06 +00:00
|
|
|
|
];
|
2018-04-12 06:14:15 +01:00
|
|
|
|
|
2020-03-09 06:10:06 +00:00
|
|
|
|
buildInputs = with self; commonDeps;
|
2019-11-02 23:07:12 +00:00
|
|
|
|
|
2018-04-12 06:14:15 +01:00
|
|
|
|
# temporarily use gnuinstall for bootstrapping
|
|
|
|
|
# bsdinstall will be built later
|
2021-09-03 15:02:58 +01:00
|
|
|
|
makeFlags = defaultMakeFlags ++ [
|
2018-07-28 17:29:02 +01:00
|
|
|
|
"INSTALL=${buildPackages.coreutils}/bin/install"
|
netbsd.compat: Fix cross compilation
Not to netbsd, where it isn't needed, but elsewhere.
A few things going on here:
- Make compat use the "regular" not "host" makefile infra. This,
however, makes more assumptions that the toolchain is BSD-like, and
so we need to compensate for them with the likes of:
- `LORDER=...` and `TSORT=...`
- Move `export INSTALL_*` to install's setup hook so they don't interfere
with coreutils install
- Don't use `DESTDIR` for installing include files, instead set `INCSDIR`.
This is more proper, but doesn't work when `INCSDIR` is set multiple
times, unfortunately, as CLI defs override all other assignments. So
instead set `INCSDIR0` on the CLI, and do some `INCSDIR =
${INCSDIR0}/...` in the relevant packages.
- `INCSDIR` is set just in the NetBSD setup hook because FreeBSD uses
`INCLUDEDIR`.
2021-09-01 22:44:25 +01:00
|
|
|
|
"DATADIR=$(out)/share"
|
|
|
|
|
# Can't sort object files yet
|
|
|
|
|
"LORDER=echo"
|
|
|
|
|
"TSORT=cat"
|
2021-09-03 15:02:58 +01:00
|
|
|
|
# Can't process man pages yet
|
|
|
|
|
"MKSHARE=no"
|
2021-09-23 01:42:12 +01:00
|
|
|
|
] ++ lib.optionals stdenv.hostPlatform.isDarwin [
|
|
|
|
|
# GNU objcopy produces broken .a libs which won't link into dependers.
|
|
|
|
|
# Makefiles only invoke `$OBJCOPY -x/-X`, so cctools strip works here.
|
|
|
|
|
"OBJCOPY=${buildPackages.darwin.cctools}/bin/strip"
|
2018-07-28 17:29:02 +01:00
|
|
|
|
];
|
2018-04-12 06:14:15 +01:00
|
|
|
|
RENAME = "-D";
|
|
|
|
|
|
2021-09-23 01:42:12 +01:00
|
|
|
|
passthru.tests = { netbsd-install = self.install; };
|
|
|
|
|
|
2021-09-01 22:38:38 +01:00
|
|
|
|
patches = [
|
|
|
|
|
./compat-cxx-safe-header.patch
|
|
|
|
|
./compat-dont-configure-twice.patch
|
netbsd.compat: Fix cross compilation
Not to netbsd, where it isn't needed, but elsewhere.
A few things going on here:
- Make compat use the "regular" not "host" makefile infra. This,
however, makes more assumptions that the toolchain is BSD-like, and
so we need to compensate for them with the likes of:
- `LORDER=...` and `TSORT=...`
- Move `export INSTALL_*` to install's setup hook so they don't interfere
with coreutils install
- Don't use `DESTDIR` for installing include files, instead set `INCSDIR`.
This is more proper, but doesn't work when `INCSDIR` is set multiple
times, unfortunately, as CLI defs override all other assignments. So
instead set `INCSDIR0` on the CLI, and do some `INCSDIR =
${INCSDIR0}/...` in the relevant packages.
- `INCSDIR` is set just in the NetBSD setup hook because FreeBSD uses
`INCLUDEDIR`.
2021-09-01 22:44:25 +01:00
|
|
|
|
./compat-no-force-native.patch
|
2021-09-01 22:38:38 +01:00
|
|
|
|
];
|
2018-05-31 17:13:35 +01:00
|
|
|
|
|
netbsd.compat: Fix cross compilation
Not to netbsd, where it isn't needed, but elsewhere.
A few things going on here:
- Make compat use the "regular" not "host" makefile infra. This,
however, makes more assumptions that the toolchain is BSD-like, and
so we need to compensate for them with the likes of:
- `LORDER=...` and `TSORT=...`
- Move `export INSTALL_*` to install's setup hook so they don't interfere
with coreutils install
- Don't use `DESTDIR` for installing include files, instead set `INCSDIR`.
This is more proper, but doesn't work when `INCSDIR` is set multiple
times, unfortunately, as CLI defs override all other assignments. So
instead set `INCSDIR0` on the CLI, and do some `INCSDIR =
${INCSDIR0}/...` in the relevant packages.
- `INCSDIR` is set just in the NetBSD setup hook because FreeBSD uses
`INCLUDEDIR`.
2021-09-01 22:44:25 +01:00
|
|
|
|
preInstall = ''
|
|
|
|
|
makeFlagsArray+=('INSTALL_FILE=''${INSTALL} ''${COPY} ''${PRESERVE} ''${RENAME}')
|
|
|
|
|
makeFlagsArray+=('INSTALL_DIR=''${INSTALL} -d')
|
|
|
|
|
makeFlagsArray+=('INSTALL_SYMLINK=''${INSTALL} ''${SYMLINK} ''${RENAME}')
|
|
|
|
|
'';
|
2018-04-12 06:14:15 +01:00
|
|
|
|
|
netbsd.compat: Fix cross compilation
Not to netbsd, where it isn't needed, but elsewhere.
A few things going on here:
- Make compat use the "regular" not "host" makefile infra. This,
however, makes more assumptions that the toolchain is BSD-like, and
so we need to compensate for them with the likes of:
- `LORDER=...` and `TSORT=...`
- Move `export INSTALL_*` to install's setup hook so they don't interfere
with coreutils install
- Don't use `DESTDIR` for installing include files, instead set `INCSDIR`.
This is more proper, but doesn't work when `INCSDIR` is set multiple
times, unfortunately, as CLI defs override all other assignments. So
instead set `INCSDIR0` on the CLI, and do some `INCSDIR =
${INCSDIR0}/...` in the relevant packages.
- `INCSDIR` is set just in the NetBSD setup hook because FreeBSD uses
`INCLUDEDIR`.
2021-09-01 22:44:25 +01:00
|
|
|
|
postInstall = ''
|
2018-04-12 06:14:15 +01:00
|
|
|
|
# why aren't these installed by netbsd?
|
|
|
|
|
install -D compat_defs.h $out/include/compat_defs.h
|
2020-03-09 06:10:06 +00:00
|
|
|
|
install -D $BSDSRCDIR/include/cdbw.h $out/include/cdbw.h
|
|
|
|
|
install -D $BSDSRCDIR/sys/sys/cdbr.h $out/include/cdbr.h
|
|
|
|
|
install -D $BSDSRCDIR/sys/sys/featuretest.h \
|
2018-04-12 06:14:15 +01:00
|
|
|
|
$out/include/sys/featuretest.h
|
2020-03-09 06:10:06 +00:00
|
|
|
|
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
|
2021-04-29 22:01:23 +01:00
|
|
|
|
|
|
|
|
|
# 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
|
2018-10-06 20:42:54 +01:00
|
|
|
|
'' + lib.optionalString stdenv.isDarwin ''
|
|
|
|
|
mkdir -p $out/include/ssp
|
|
|
|
|
touch $out/include/ssp/ssp.h
|
|
|
|
|
'' + ''
|
2018-05-31 17:13:35 +01:00
|
|
|
|
mkdir -p $out/lib/pkgconfig
|
|
|
|
|
substitute ${./libbsd-overlay.pc} $out/lib/pkgconfig/libbsd-overlay.pc \
|
|
|
|
|
--subst-var-by out $out \
|
|
|
|
|
--subst-var-by version ${version}
|
2018-04-12 06:14:15 +01:00
|
|
|
|
'';
|
2021-04-29 22:01:23 +01:00
|
|
|
|
extraPaths = with self; [ include.src libc.src libutil.src
|
2021-05-15 11:02:05 +01:00
|
|
|
|
(fetchNetBSD "external/bsd/flex" "9.2" "0h98jpfj7vx5zh7vd7bk6b1hmzgkcb757a8j6d9zgygxxv13v43m")
|
|
|
|
|
(fetchNetBSD "sys/sys" "9.2" "0zawhw51klaigqqwkx0lzrx3mim2jywrc24cm7c66qsf1im9awgd")
|
|
|
|
|
(fetchNetBSD "common/include/rpc/types.h" "9.2" "0n2df12mlc3cbc48jxq35yzl1y7ghgpykvy7jnfh898rdhac7m9a")
|
2021-04-29 22:01:23 +01:00
|
|
|
|
] ++ libutil.extraPaths ++ _mainLibcExtraPaths;
|
2020-03-09 06:10:06 +00:00
|
|
|
|
});
|
2018-04-12 06:14:15 +01:00
|
|
|
|
|
2018-07-28 17:29:02 +01:00
|
|
|
|
# HACK: to ensure parent directories exist. This emulates GNU
|
2018-05-02 04:19:33 +01:00
|
|
|
|
# install’s -D option. No alternative seems to exist in BSD install.
|
|
|
|
|
install = let binstall = writeText "binstall" ''
|
2018-10-06 20:40:09 +01:00
|
|
|
|
#!${stdenv.shell}
|
2018-05-02 04:19:33 +01:00
|
|
|
|
for last in $@; do true; done
|
|
|
|
|
mkdir -p $(dirname $last)
|
|
|
|
|
xinstall "$@"
|
2018-07-28 17:29:02 +01:00
|
|
|
|
''; in mkDerivation {
|
2018-04-12 06:14:15 +01:00
|
|
|
|
path = "usr.bin/xinstall";
|
2021-05-15 11:02:05 +01:00
|
|
|
|
version = "9.2";
|
2018-09-21 03:11:12 +01:00
|
|
|
|
sha256 = "1f6pbz3qv1qcrchdxif8p5lbmnwl8b9nq615hsd3cyl4avd5bfqj";
|
2020-03-09 06:10:06 +00:00
|
|
|
|
extraPaths = with self; [ mtree.src make.src ];
|
|
|
|
|
nativeBuildInputs = with buildPackages.netbsd; [
|
2020-03-09 06:10:06 +00:00
|
|
|
|
bsdSetupHook netbsdSetupHook
|
2020-03-09 06:10:06 +00:00
|
|
|
|
makeMinimal
|
2021-04-19 23:23:30 +01:00
|
|
|
|
mandoc groff rsync
|
2020-03-09 06:10:06 +00:00
|
|
|
|
];
|
2018-07-28 17:29:02 +01:00
|
|
|
|
skipIncludesPhase = true;
|
2020-03-09 06:10:06 +00:00
|
|
|
|
buildInputs = with self; compatIfNeeded ++ [ fts ];
|
2018-05-01 01:59:33 +01:00
|
|
|
|
installPhase = ''
|
|
|
|
|
runHook preInstall
|
|
|
|
|
|
|
|
|
|
install -D install.1 $out/share/man/man1/install.1
|
2018-05-02 04:19:33 +01:00
|
|
|
|
install -D xinstall $out/bin/xinstall
|
|
|
|
|
install -D -m 0550 ${binstall} $out/bin/binstall
|
|
|
|
|
ln -s $out/bin/binstall $out/bin/install
|
2018-05-01 01:59:33 +01:00
|
|
|
|
|
|
|
|
|
runHook postInstall
|
|
|
|
|
'';
|
netbsd.compat: Fix cross compilation
Not to netbsd, where it isn't needed, but elsewhere.
A few things going on here:
- Make compat use the "regular" not "host" makefile infra. This,
however, makes more assumptions that the toolchain is BSD-like, and
so we need to compensate for them with the likes of:
- `LORDER=...` and `TSORT=...`
- Move `export INSTALL_*` to install's setup hook so they don't interfere
with coreutils install
- Don't use `DESTDIR` for installing include files, instead set `INCSDIR`.
This is more proper, but doesn't work when `INCSDIR` is set multiple
times, unfortunately, as CLI defs override all other assignments. So
instead set `INCSDIR0` on the CLI, and do some `INCSDIR =
${INCSDIR0}/...` in the relevant packages.
- `INCSDIR` is set just in the NetBSD setup hook because FreeBSD uses
`INCLUDEDIR`.
2021-09-01 22:44:25 +01:00
|
|
|
|
setupHook = ./install-setup-hook.sh;
|
2018-04-12 06:14:15 +01:00
|
|
|
|
};
|
2018-04-26 18:57:53 +01:00
|
|
|
|
|
2018-07-28 17:29:02 +01:00
|
|
|
|
fts = mkDerivation {
|
2018-04-26 18:57:53 +01:00
|
|
|
|
pname = "fts";
|
|
|
|
|
path = "include/fts.h";
|
|
|
|
|
sha256 = "01d4fpxvz1pgzfk5xznz5dcm0x0gdzwcsfm1h3d0xc9kc6hj2q77";
|
2021-05-15 11:02:05 +01:00
|
|
|
|
version = "9.2";
|
2020-03-09 06:10:06 +00:00
|
|
|
|
nativeBuildInputs = with buildPackages.netbsd; [
|
2020-03-09 06:10:06 +00:00
|
|
|
|
bsdSetupHook netbsdSetupHook rsync
|
2020-03-09 06:10:06 +00:00
|
|
|
|
];
|
2020-03-09 06:10:06 +00:00
|
|
|
|
propagatedBuildInputs = with self; compatIfNeeded;
|
|
|
|
|
extraPaths = with self; [
|
2021-05-15 11:02:05 +01:00
|
|
|
|
(fetchNetBSD "lib/libc/gen/fts.c" "9.2" "1a8hmf26242nmv05ipn3ircxb0jqmmi66rh78kkyi9vjwkfl3qn7")
|
|
|
|
|
(fetchNetBSD "lib/libc/include/namespace.h" "9.2" "0kksr3pdwdc1cplqf5z12ih4cml6l11lqrz91f7hjjm64y7785kc")
|
|
|
|
|
(fetchNetBSD "lib/libc/gen/fts.3" "9.2" "1asxw0n3fhjdadwkkq3xplfgqgl3q32w1lyrvbakfa3gs0wz5zc1")
|
2018-04-26 18:57:53 +01:00
|
|
|
|
];
|
2018-07-28 17:29:02 +01:00
|
|
|
|
skipIncludesPhase = true;
|
2018-04-26 18:57:53 +01:00
|
|
|
|
buildPhase = ''
|
2019-11-02 23:07:12 +00:00
|
|
|
|
"$CC" -c -Iinclude -Ilib/libc/include lib/libc/gen/fts.c \
|
2018-04-26 18:57:53 +01:00
|
|
|
|
-o lib/libc/gen/fts.o
|
2019-11-02 23:07:12 +00:00
|
|
|
|
"$AR" -rsc libfts.a lib/libc/gen/fts.o
|
2018-04-26 18:57:53 +01:00
|
|
|
|
'';
|
|
|
|
|
installPhase = ''
|
2018-05-01 01:59:33 +01:00
|
|
|
|
runHook preInstall
|
|
|
|
|
|
2018-04-26 18:57:53 +01:00
|
|
|
|
install -D lib/libc/gen/fts.3 $out/share/man/man3/fts.3
|
|
|
|
|
install -D include/fts.h $out/include/fts.h
|
|
|
|
|
install -D lib/libc/include/namespace.h $out/include/namespace.h
|
|
|
|
|
install -D libfts.a $out/lib/libfts.a
|
2018-05-01 01:59:33 +01:00
|
|
|
|
|
|
|
|
|
runHook postInstall
|
2018-04-26 18:57:53 +01:00
|
|
|
|
'';
|
2018-05-07 18:07:19 +01:00
|
|
|
|
setupHooks = [
|
|
|
|
|
../../../build-support/setup-hooks/role.bash
|
|
|
|
|
./fts-setup-hook.sh
|
|
|
|
|
];
|
2018-04-26 18:57:53 +01:00
|
|
|
|
};
|
2018-04-27 08:05:56 +01:00
|
|
|
|
|
2021-04-15 02:29:11 +01:00
|
|
|
|
# Don't add this to nativeBuildInputs directly. Use statHook instead.
|
2018-07-28 17:29:02 +01:00
|
|
|
|
stat = mkDerivation {
|
2018-04-27 08:05:56 +01:00
|
|
|
|
path = "usr.bin/stat";
|
2021-05-15 11:02:05 +01:00
|
|
|
|
version = "9.2";
|
2021-04-29 22:01:23 +01:00
|
|
|
|
sha256 = "18nqwlndfc34qbbgqx5nffil37jfq9aw663ippasfxd2hlyc106x";
|
2020-03-09 06:10:06 +00:00
|
|
|
|
nativeBuildInputs = with buildPackages.netbsd; [
|
2020-03-09 06:10:06 +00:00
|
|
|
|
bsdSetupHook netbsdSetupHook
|
2020-03-09 06:10:06 +00:00
|
|
|
|
makeMinimal
|
2021-04-19 23:23:30 +01:00
|
|
|
|
install mandoc groff rsync
|
2020-03-09 06:10:06 +00:00
|
|
|
|
];
|
2018-04-27 08:05:56 +01:00
|
|
|
|
};
|
|
|
|
|
|
2021-04-15 02:29:11 +01:00
|
|
|
|
# stat isn't in POSIX, and NetBSD stat supports a completely
|
|
|
|
|
# different range of flags than GNU stat, so including it in PATH
|
|
|
|
|
# breaks stdenv. Work around that with a hook that will point
|
|
|
|
|
# NetBSD's build system and NetBSD stat without including it in
|
|
|
|
|
# PATH.
|
|
|
|
|
statHook = makeSetupHook {
|
|
|
|
|
name = "netbsd-stat-hook";
|
|
|
|
|
} (writeText "netbsd-stat-hook-impl" ''
|
2020-03-09 06:10:06 +00:00
|
|
|
|
makeFlagsArray+=(TOOL_STAT=${self.stat}/bin/stat)
|
2021-04-15 02:29:11 +01:00
|
|
|
|
'');
|
|
|
|
|
|
2018-07-28 17:29:02 +01:00
|
|
|
|
tsort = mkDerivation {
|
2018-04-27 08:05:56 +01:00
|
|
|
|
path = "usr.bin/tsort";
|
2021-05-15 11:02:05 +01:00
|
|
|
|
version = "9.2";
|
2018-04-27 08:05:56 +01:00
|
|
|
|
sha256 = "1dqvf9gin29nnq3c4byxc7lfd062pg7m84843zdy6n0z63hnnwiq";
|
2020-03-09 06:10:06 +00:00
|
|
|
|
nativeBuildInputs = with buildPackages.netbsd; [
|
2020-03-09 06:10:06 +00:00
|
|
|
|
bsdSetupHook netbsdSetupHook
|
2020-03-09 06:10:06 +00:00
|
|
|
|
makeMinimal
|
2021-04-19 23:23:30 +01:00
|
|
|
|
install mandoc groff rsync
|
2020-03-09 06:10:06 +00:00
|
|
|
|
];
|
2018-04-27 08:05:56 +01:00
|
|
|
|
};
|
|
|
|
|
|
2018-07-28 17:29:02 +01:00
|
|
|
|
lorder = mkDerivation {
|
2018-04-27 08:05:56 +01:00
|
|
|
|
path = "usr.bin/lorder";
|
2021-05-15 11:02:05 +01:00
|
|
|
|
version = "9.2";
|
2018-04-27 08:05:56 +01:00
|
|
|
|
sha256 = "0rjf9blihhm0n699vr2bg88m4yjhkbxh6fxliaay3wxkgnydjwn2";
|
2020-03-09 06:10:06 +00:00
|
|
|
|
nativeBuildInputs = with buildPackages.netbsd; [
|
2020-03-09 06:10:06 +00:00
|
|
|
|
bsdSetupHook netbsdSetupHook
|
2020-03-09 06:10:06 +00:00
|
|
|
|
makeMinimal
|
2021-04-19 23:23:30 +01:00
|
|
|
|
install mandoc groff rsync
|
2020-03-09 06:10:06 +00:00
|
|
|
|
];
|
2018-04-27 08:05:56 +01:00
|
|
|
|
};
|
2018-05-01 01:59:33 +01:00
|
|
|
|
##
|
|
|
|
|
## END BOOTSTRAPPING
|
|
|
|
|
##
|
2018-04-12 06:14:15 +01:00
|
|
|
|
|
2018-07-28 17:29:02 +01:00
|
|
|
|
##
|
|
|
|
|
## START COMMAND LINE TOOLS
|
|
|
|
|
##
|
|
|
|
|
make = mkDerivation {
|
|
|
|
|
path = "usr.bin/make";
|
2021-05-15 11:02:05 +01:00
|
|
|
|
sha256 = "0vi73yicbmbp522qzqvd979cx6zm5jakhy77xh73c1kygf8klccs";
|
|
|
|
|
version = "9.2";
|
netbsd.compat: Fix cross compilation
Not to netbsd, where it isn't needed, but elsewhere.
A few things going on here:
- Make compat use the "regular" not "host" makefile infra. This,
however, makes more assumptions that the toolchain is BSD-like, and
so we need to compensate for them with the likes of:
- `LORDER=...` and `TSORT=...`
- Move `export INSTALL_*` to install's setup hook so they don't interfere
with coreutils install
- Don't use `DESTDIR` for installing include files, instead set `INCSDIR`.
This is more proper, but doesn't work when `INCSDIR` is set multiple
times, unfortunately, as CLI defs override all other assignments. So
instead set `INCSDIR0` on the CLI, and do some `INCSDIR =
${INCSDIR0}/...` in the relevant packages.
- `INCSDIR` is set just in the NetBSD setup hook because FreeBSD uses
`INCLUDEDIR`.
2021-09-01 22:44:25 +01:00
|
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
|
substituteInPlace $BSDSRCDIR/share/mk/bsd.doc.mk \
|
|
|
|
|
--replace '-o ''${DOCOWN}' "" \
|
|
|
|
|
--replace '-g ''${DOCGRP}' ""
|
|
|
|
|
for mk in $BSDSRCDIR/share/mk/bsd.inc.mk $BSDSRCDIR/share/mk/bsd.kinc.mk; do
|
|
|
|
|
substituteInPlace $mk \
|
|
|
|
|
--replace '-o ''${BINOWN}' "" \
|
|
|
|
|
--replace '-g ''${BINGRP}' ""
|
|
|
|
|
done
|
|
|
|
|
substituteInPlace $BSDSRCDIR/share/mk/bsd.kmodule.mk \
|
|
|
|
|
--replace '-o ''${KMODULEOWN}' "" \
|
|
|
|
|
--replace '-g ''${KMODULEGRP}' ""
|
|
|
|
|
substituteInPlace $BSDSRCDIR/share/mk/bsd.lib.mk \
|
|
|
|
|
--replace '-o ''${LIBOWN}' "" \
|
|
|
|
|
--replace '-g ''${LIBGRP}' "" \
|
|
|
|
|
--replace '-o ''${DEBUGOWN}' "" \
|
|
|
|
|
--replace '-g ''${DEBUGGRP}' ""
|
|
|
|
|
substituteInPlace $BSDSRCDIR/share/mk/bsd.lua.mk \
|
|
|
|
|
--replace '-o ''${LIBOWN}' "" \
|
|
|
|
|
--replace '-g ''${LIBGRP}' ""
|
|
|
|
|
substituteInPlace $BSDSRCDIR/share/mk/bsd.man.mk \
|
|
|
|
|
--replace '-o ''${MANOWN}' "" \
|
|
|
|
|
--replace '-g ''${MANGRP}' ""
|
|
|
|
|
substituteInPlace $BSDSRCDIR/share/mk/bsd.nls.mk \
|
|
|
|
|
--replace '-o ''${NLSOWN}' "" \
|
|
|
|
|
--replace '-g ''${NLSGRP}' ""
|
|
|
|
|
substituteInPlace $BSDSRCDIR/share/mk/bsd.prog.mk \
|
|
|
|
|
--replace '-o ''${BINOWN}' "" \
|
|
|
|
|
--replace '-g ''${BINGRP}' "" \
|
|
|
|
|
--replace '-o ''${RUMPBINOWN}' "" \
|
|
|
|
|
--replace '-g ''${RUMPBINGRP}' "" \
|
|
|
|
|
--replace '-o ''${DEBUGOWN}' "" \
|
|
|
|
|
--replace '-g ''${DEBUGGRP}' ""
|
|
|
|
|
|
2018-07-28 17:29:02 +01:00
|
|
|
|
# make needs this to pick up our sys make files
|
|
|
|
|
export NIX_CFLAGS_COMPILE+=" -D_PATH_DEFSYSPATH=\"$out/share/mk\""
|
|
|
|
|
|
2020-03-09 06:10:06 +00:00
|
|
|
|
substituteInPlace $BSDSRCDIR/share/mk/bsd.lib.mk \
|
2018-07-28 17:29:02 +01:00
|
|
|
|
--replace '_INSTRANLIB=''${empty(PRESERVE):?-a "''${RANLIB} -t":}' '_INSTRANLIB='
|
2020-03-09 06:10:06 +00:00
|
|
|
|
substituteInPlace $BSDSRCDIR/share/mk/bsd.kinc.mk \
|
2018-07-28 17:29:02 +01:00
|
|
|
|
--replace /bin/rm rm
|
|
|
|
|
'' + lib.optionalString stdenv.isDarwin ''
|
2020-03-09 06:10:06 +00:00
|
|
|
|
substituteInPlace $BSDSRCDIR/share/mk/bsd.sys.mk \
|
2018-07-28 17:29:02 +01:00
|
|
|
|
--replace '-Wl,--fatal-warnings' "" \
|
|
|
|
|
--replace '-Wl,--warn-shared-textrel' ""
|
|
|
|
|
'';
|
|
|
|
|
postInstall = ''
|
2020-03-09 06:10:06 +00:00
|
|
|
|
make -C $BSDSRCDIR/share/mk FILESDIR=$out/share/mk install
|
2018-07-28 17:29:02 +01:00
|
|
|
|
'';
|
|
|
|
|
extraPaths = [
|
2021-05-15 11:02:05 +01:00
|
|
|
|
(fetchNetBSD "share/mk" "9.2" "0w9x77cfnm6zwy40slradzi0ip9gz80x6lk7pvnlxzsr2m5ra5sy")
|
2018-07-28 17:29:02 +01:00
|
|
|
|
];
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
mtree = mkDerivation {
|
2018-04-12 06:14:15 +01:00
|
|
|
|
path = "usr.sbin/mtree";
|
2021-05-15 11:02:05 +01:00
|
|
|
|
version = "9.2";
|
2021-04-29 22:01:23 +01:00
|
|
|
|
sha256 = "04p7w540vz9npvyb8g8hcf2xa05phn1y88hsyrcz3vwanvpc0yv9";
|
2020-03-09 06:10:06 +00:00
|
|
|
|
extraPaths = with self; [ mknod.src ];
|
2018-04-12 06:14:15 +01:00
|
|
|
|
};
|
|
|
|
|
|
2018-07-28 17:29:02 +01:00
|
|
|
|
mknod = mkDerivation {
|
2018-10-06 20:42:54 +01:00
|
|
|
|
path = "sbin/mknod";
|
2021-05-15 11:02:05 +01:00
|
|
|
|
version = "9.2";
|
2021-04-29 22:01:23 +01:00
|
|
|
|
sha256 = "1d9369shzwgixz3nph991i8q5vk7hr04py3n9avbfbhzy4gndqs2";
|
2018-04-27 23:52:54 +01:00
|
|
|
|
};
|
|
|
|
|
|
2018-07-28 17:29:02 +01:00
|
|
|
|
getent = mkDerivation {
|
2018-04-12 06:14:15 +01:00
|
|
|
|
path = "usr.bin/getent";
|
2021-04-29 22:01:23 +01:00
|
|
|
|
sha256 = "1qngywcmm0y7nl8h3n8brvkxq4jw63szbci3kc1q6a6ndhycbbvr";
|
2021-05-15 11:02:05 +01:00
|
|
|
|
version = "9.2";
|
2018-04-12 06:14:15 +01:00
|
|
|
|
patches = [ ./getent.patch ];
|
|
|
|
|
};
|
|
|
|
|
|
2018-07-28 17:29:02 +01:00
|
|
|
|
getconf = mkDerivation {
|
2018-04-12 06:14:15 +01:00
|
|
|
|
path = "usr.bin/getconf";
|
|
|
|
|
sha256 = "122vslz4j3h2mfs921nr2s6m078zcj697yrb75rwp2hnw3qz4s8q";
|
2021-05-15 11:02:05 +01:00
|
|
|
|
version = "9.2";
|
2018-04-12 06:14:15 +01:00
|
|
|
|
};
|
|
|
|
|
|
2018-07-28 17:29:02 +01:00
|
|
|
|
locale = mkDerivation {
|
|
|
|
|
path = "usr.bin/locale";
|
2021-05-15 11:02:05 +01:00
|
|
|
|
version = "9.2";
|
2018-07-28 17:29:02 +01:00
|
|
|
|
sha256 = "0kk6v9k2bygq0wf9gbinliqzqpzs9bgxn0ndyl2wcv3hh2bmsr9p";
|
|
|
|
|
patches = [ ./locale.patch ];
|
|
|
|
|
NIX_CFLAGS_COMPILE = "-DYESSTR=__YESSTR -DNOSTR=__NOSTR";
|
2018-04-30 05:11:37 +01:00
|
|
|
|
};
|
|
|
|
|
|
2018-07-28 17:29:02 +01:00
|
|
|
|
rpcgen = mkDerivation {
|
|
|
|
|
path = "usr.bin/rpcgen";
|
2021-05-15 11:02:05 +01:00
|
|
|
|
version = "9.2";
|
2018-07-28 17:29:02 +01:00
|
|
|
|
sha256 = "1kfgfx54jg98wbg0d95p0rvf4w0302v8fz724b0bdackdsrd4988";
|
2018-04-12 06:14:15 +01:00
|
|
|
|
};
|
|
|
|
|
|
2018-07-28 17:29:02 +01:00
|
|
|
|
genassym = mkDerivation {
|
|
|
|
|
path = "usr.bin/genassym";
|
2021-05-15 11:02:05 +01:00
|
|
|
|
version = "9.2";
|
2018-07-28 17:29:02 +01:00
|
|
|
|
sha256 = "1acl1dz5kvh9h5806vkz2ap95rdsz7phmynh5i3x5y7agbki030c";
|
|
|
|
|
};
|
2018-09-21 04:56:45 +01:00
|
|
|
|
|
2018-07-28 17:29:02 +01:00
|
|
|
|
gencat = mkDerivation {
|
|
|
|
|
path = "usr.bin/gencat";
|
2021-05-15 11:02:05 +01:00
|
|
|
|
version = "9.2";
|
2021-04-29 22:01:23 +01:00
|
|
|
|
sha256 = "0gd463x1hg36bhr7y0xryb5jyxk0z0g7xvy8rgk82nlbnlnsbbwb";
|
2018-04-12 06:14:15 +01:00
|
|
|
|
};
|
|
|
|
|
|
2018-07-28 17:29:02 +01:00
|
|
|
|
nbperf = mkDerivation {
|
2018-04-12 06:14:15 +01:00
|
|
|
|
path = "usr.bin/nbperf";
|
2021-05-15 11:02:05 +01:00
|
|
|
|
version = "9.2";
|
2021-04-29 22:01:23 +01:00
|
|
|
|
sha256 = "1nxc302vgmjhm3yqdivqyfzslrg0vjpbss44s74rcryrl19mma9r";
|
2018-04-12 06:14:15 +01:00
|
|
|
|
};
|
|
|
|
|
|
2018-07-28 17:29:02 +01:00
|
|
|
|
tic = mkDerivation {
|
2018-04-12 06:14:15 +01:00
|
|
|
|
path = "tools/tic";
|
2021-05-15 11:02:05 +01:00
|
|
|
|
version = "9.2";
|
2018-04-12 06:14:15 +01:00
|
|
|
|
sha256 = "092y7db7k4kh2jq8qc55126r5qqvlb8lq8mhmy5ipbi36hwb4zrz";
|
|
|
|
|
HOSTPROG = "tic";
|
2020-03-09 06:10:06 +00:00
|
|
|
|
buildInputs = with self; compatIfNeeded;
|
|
|
|
|
nativeBuildInputs = with buildPackages.netbsd; [
|
2020-03-09 06:10:06 +00:00
|
|
|
|
bsdSetupHook netbsdSetupHook
|
2020-03-09 06:10:06 +00:00
|
|
|
|
makeMinimal
|
2021-11-03 15:50:01 +00:00
|
|
|
|
install mandoc groff nbperf rsync
|
2020-03-09 06:10:06 +00:00
|
|
|
|
];
|
2021-09-03 15:02:58 +01:00
|
|
|
|
makeFlags = defaultMakeFlags ++ [ "TOOLDIR=$(out)" ];
|
2020-03-09 06:10:06 +00:00
|
|
|
|
extraPaths = with self; [
|
2018-04-12 06:14:15 +01:00
|
|
|
|
libterminfo.src
|
2021-05-15 11:02:05 +01:00
|
|
|
|
(fetchNetBSD "usr.bin/tic" "9.2" "1mwdfg7yx1g43ss378qsgl5rqhsxskqvsd2mqvrn38qw54i8v5i1")
|
|
|
|
|
(fetchNetBSD "tools/Makefile.host" "9.2" "15b4ab0n36lqj00j5lz2xs83g7l8isk3wx1wcapbrn66qmzz2sxy")
|
2018-04-12 06:14:15 +01:00
|
|
|
|
];
|
|
|
|
|
};
|
2021-04-18 11:47:35 +01:00
|
|
|
|
|
|
|
|
|
uudecode = mkDerivation {
|
|
|
|
|
path = "usr.bin/uudecode";
|
2021-05-15 11:02:05 +01:00
|
|
|
|
version = "9.2";
|
2021-04-18 11:47:35 +01:00
|
|
|
|
sha256 = "00a3zmh15pg4vx6hz0kaa5mi8d2b1sj4h512d7p6wbvxq6mznwcn";
|
|
|
|
|
NIX_CFLAGS_COMPILE = lib.optional stdenv.isLinux "-DNO_BASE64";
|
|
|
|
|
};
|
2021-04-18 12:10:42 +01:00
|
|
|
|
|
|
|
|
|
cksum = mkDerivation {
|
|
|
|
|
path = "usr.bin/cksum";
|
2021-05-15 11:02:05 +01:00
|
|
|
|
version = "9.2";
|
2021-04-29 22:01:23 +01:00
|
|
|
|
sha256 = "0msfhgyvh5c2jmc6qjnf12c378dhw32ffsl864qz4rdb2b98rfcq";
|
2021-04-18 12:10:42 +01:00
|
|
|
|
meta.platforms = lib.platforms.netbsd;
|
|
|
|
|
};
|
2021-04-18 12:13:22 +01:00
|
|
|
|
|
|
|
|
|
config = mkDerivation {
|
|
|
|
|
path = "usr.bin/config";
|
2021-05-15 11:02:05 +01:00
|
|
|
|
version = "9.2";
|
|
|
|
|
sha256 = "1yz3n4hncdkk6kp595fh2q5lg150vpqg8iw2dccydkyw4y3hgsjj";
|
2021-04-18 12:13:22 +01:00
|
|
|
|
NIX_CFLAGS_COMPILE = [ "-DMAKE_BOOTSTRAP" ];
|
2020-03-09 06:10:06 +00:00
|
|
|
|
nativeBuildInputs = with buildPackages.netbsd; [
|
2020-03-09 06:10:06 +00:00
|
|
|
|
bsdSetupHook netbsdSetupHook
|
2021-04-19 23:23:30 +01:00
|
|
|
|
makeMinimal install mandoc byacc flex rsync
|
2020-03-09 06:10:06 +00:00
|
|
|
|
];
|
2020-03-09 06:10:06 +00:00
|
|
|
|
buildInputs = with self; compatIfNeeded;
|
|
|
|
|
extraPaths = with self; [ cksum.src ];
|
2021-04-18 12:13:22 +01:00
|
|
|
|
};
|
2018-07-28 17:29:02 +01:00
|
|
|
|
##
|
|
|
|
|
## END COMMAND LINE TOOLS
|
|
|
|
|
##
|
|
|
|
|
|
|
|
|
|
##
|
|
|
|
|
## START HEADERS
|
|
|
|
|
##
|
|
|
|
|
include = mkDerivation {
|
|
|
|
|
path = "include";
|
2021-05-15 11:02:05 +01:00
|
|
|
|
version = "9.2";
|
|
|
|
|
sha256 = "0nxnmj4c8s3hb9n3fpcmd0zl3l1nmhivqgi9a35sis943qvpgl9h";
|
2020-03-09 06:10:06 +00:00
|
|
|
|
nativeBuildInputs = with buildPackages.netbsd; [
|
2020-03-09 06:10:06 +00:00
|
|
|
|
bsdSetupHook netbsdSetupHook
|
2020-03-09 06:10:06 +00:00
|
|
|
|
makeMinimal
|
2021-04-19 23:23:30 +01:00
|
|
|
|
install mandoc groff rsync nbperf rpcgen
|
2020-03-09 06:10:06 +00:00
|
|
|
|
];
|
netbsd.compat: Fix cross compilation
Not to netbsd, where it isn't needed, but elsewhere.
A few things going on here:
- Make compat use the "regular" not "host" makefile infra. This,
however, makes more assumptions that the toolchain is BSD-like, and
so we need to compensate for them with the likes of:
- `LORDER=...` and `TSORT=...`
- Move `export INSTALL_*` to install's setup hook so they don't interfere
with coreutils install
- Don't use `DESTDIR` for installing include files, instead set `INCSDIR`.
This is more proper, but doesn't work when `INCSDIR` is set multiple
times, unfortunately, as CLI defs override all other assignments. So
instead set `INCSDIR0` on the CLI, and do some `INCSDIR =
${INCSDIR0}/...` in the relevant packages.
- `INCSDIR` is set just in the NetBSD setup hook because FreeBSD uses
`INCLUDEDIR`.
2021-09-01 22:44:25 +01:00
|
|
|
|
|
|
|
|
|
# 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}_' \
|
|
|
|
|
{} \;
|
|
|
|
|
'';
|
|
|
|
|
|
|
|
|
|
# multiple header dirs, see above
|
|
|
|
|
postConfigure = ''
|
|
|
|
|
makeFlags=''${makeFlags/INCSDIR/INCSDIR0}
|
|
|
|
|
'';
|
|
|
|
|
|
2021-04-23 17:01:33 +01:00
|
|
|
|
extraPaths = with self; [ common ];
|
2018-07-28 17:29:02 +01:00
|
|
|
|
headersOnly = true;
|
|
|
|
|
noCC = true;
|
2020-03-09 06:10:06 +00:00
|
|
|
|
meta.platforms = lib.platforms.netbsd;
|
2021-09-03 15:02:58 +01:00
|
|
|
|
makeFlags = defaultMakeFlags ++ [ "RPCGEN_CPP=${buildPackages.stdenv.cc.cc}/bin/cpp" ];
|
2018-07-28 17:29:02 +01:00
|
|
|
|
};
|
|
|
|
|
|
2021-05-15 11:02:05 +01:00
|
|
|
|
common = fetchNetBSD "common" "9.2" "1pfylz9r3ap5wnwwbwczbfjb1m5qdyspzbnmxmcdkpzz2zgj64b9";
|
2018-07-28 17:29:02 +01:00
|
|
|
|
|
2020-03-09 06:10:06 +00:00
|
|
|
|
sys-headers = mkDerivation {
|
|
|
|
|
pname = "sys-headers";
|
2018-07-28 17:29:02 +01:00
|
|
|
|
path = "sys";
|
2021-05-15 11:02:05 +01:00
|
|
|
|
version = "9.2";
|
|
|
|
|
sha256 = "03s18q8d9giipf05bx199fajc2qwikji0djz7hw63d2lya6bfnpj";
|
2021-04-29 22:01:23 +01:00
|
|
|
|
|
netbsd.compat: Fix cross compilation
Not to netbsd, where it isn't needed, but elsewhere.
A few things going on here:
- Make compat use the "regular" not "host" makefile infra. This,
however, makes more assumptions that the toolchain is BSD-like, and
so we need to compensate for them with the likes of:
- `LORDER=...` and `TSORT=...`
- Move `export INSTALL_*` to install's setup hook so they don't interfere
with coreutils install
- Don't use `DESTDIR` for installing include files, instead set `INCSDIR`.
This is more proper, but doesn't work when `INCSDIR` is set multiple
times, unfortunately, as CLI defs override all other assignments. So
instead set `INCSDIR0` on the CLI, and do some `INCSDIR =
${INCSDIR0}/...` in the relevant packages.
- `INCSDIR` is set just in the NetBSD setup hook because FreeBSD uses
`INCLUDEDIR`.
2021-09-01 22:44:25 +01:00
|
|
|
|
patches = [
|
|
|
|
|
# Fix this error when building bootia32.efi and bootx64.efi:
|
|
|
|
|
# error: PHDR segment not covered by LOAD segment
|
|
|
|
|
./no-dynamic-linker.patch
|
|
|
|
|
|
|
|
|
|
# multiple header dirs, see above
|
|
|
|
|
./sys-headers-incsdir.patch
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
# multiple header dirs, see above
|
|
|
|
|
inherit (self.include) postPatch;
|
2021-04-18 17:53:11 +01:00
|
|
|
|
|
|
|
|
|
CONFIG = "GENERIC";
|
|
|
|
|
|
2020-03-09 06:10:06 +00:00
|
|
|
|
propagatedBuildInputs = with self; [ include ];
|
|
|
|
|
nativeBuildInputs = with buildPackages.netbsd; [
|
2020-03-09 06:10:06 +00:00
|
|
|
|
bsdSetupHook netbsdSetupHook
|
2021-04-19 23:23:30 +01:00
|
|
|
|
makeMinimal install tsort lorder statHook rsync uudecode config genassym
|
2021-04-18 17:53:11 +01:00
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
postConfigure = ''
|
|
|
|
|
pushd arch/$MACHINE/conf
|
|
|
|
|
config $CONFIG
|
|
|
|
|
popd
|
netbsd.compat: Fix cross compilation
Not to netbsd, where it isn't needed, but elsewhere.
A few things going on here:
- Make compat use the "regular" not "host" makefile infra. This,
however, makes more assumptions that the toolchain is BSD-like, and
so we need to compensate for them with the likes of:
- `LORDER=...` and `TSORT=...`
- Move `export INSTALL_*` to install's setup hook so they don't interfere
with coreutils install
- Don't use `DESTDIR` for installing include files, instead set `INCSDIR`.
This is more proper, but doesn't work when `INCSDIR` is set multiple
times, unfortunately, as CLI defs override all other assignments. So
instead set `INCSDIR0` on the CLI, and do some `INCSDIR =
${INCSDIR0}/...` in the relevant packages.
- `INCSDIR` is set just in the NetBSD setup hook because FreeBSD uses
`INCLUDEDIR`.
2021-09-01 22:44:25 +01:00
|
|
|
|
''
|
|
|
|
|
# multiple header dirs, see above
|
|
|
|
|
+ self.include.postConfigure;
|
2021-04-18 17:53:11 +01:00
|
|
|
|
|
2021-09-03 15:02:58 +01:00
|
|
|
|
makeFlags = defaultMakeFlags ++ [ "FIRMWAREDIR=$(out)/libdata/firmware" ];
|
2021-04-18 17:53:11 +01:00
|
|
|
|
hardeningDisable = [ "pic" ];
|
|
|
|
|
MKKMOD = "no";
|
|
|
|
|
NIX_CFLAGS_COMPILE = [ "-Wa,--no-warn" ];
|
|
|
|
|
|
|
|
|
|
postBuild = ''
|
|
|
|
|
make -C arch/$MACHINE/compile/$CONFIG $makeFlags
|
|
|
|
|
'';
|
|
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
|
cp arch/$MACHINE/compile/$CONFIG/netbsd $out
|
|
|
|
|
'';
|
|
|
|
|
|
2021-04-18 17:42:48 +01:00
|
|
|
|
meta.platforms = lib.platforms.netbsd;
|
2021-04-23 17:01:33 +01:00
|
|
|
|
extraPaths = with self; [ common ];
|
2020-03-09 06:10:06 +00:00
|
|
|
|
|
|
|
|
|
installPhase = "includesPhase";
|
|
|
|
|
dontBuild = true;
|
|
|
|
|
noCC = true;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
# The full kernel. We do the funny thing of overridding the headers to the
|
|
|
|
|
# full kernal and not vice versa to avoid infinite recursion -- the headers
|
|
|
|
|
# come earlier in the bootstrap.
|
|
|
|
|
sys = self.sys-headers.override {
|
|
|
|
|
pname = "sys";
|
|
|
|
|
installPhase = null;
|
|
|
|
|
noCC = false;
|
|
|
|
|
dontBuild = false;
|
2018-07-28 17:29:02 +01:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
headers = symlinkJoin {
|
2021-05-15 11:02:05 +01:00
|
|
|
|
name = "netbsd-headers-9.2";
|
2020-03-09 06:10:06 +00:00
|
|
|
|
paths = with self; [
|
|
|
|
|
include
|
|
|
|
|
sys-headers
|
|
|
|
|
libpthread-headers
|
|
|
|
|
];
|
|
|
|
|
meta.platforms = lib.platforms.netbsd;
|
2018-07-28 17:29:02 +01:00
|
|
|
|
};
|
|
|
|
|
##
|
|
|
|
|
## END HEADERS
|
|
|
|
|
##
|
|
|
|
|
|
|
|
|
|
##
|
|
|
|
|
## START LIBRARIES
|
|
|
|
|
##
|
|
|
|
|
libutil = mkDerivation {
|
|
|
|
|
path = "lib/libutil";
|
2021-05-15 11:02:05 +01:00
|
|
|
|
version = "9.2";
|
2021-04-29 22:01:23 +01:00
|
|
|
|
sha256 = "02gm5a5zhh8qp5r5q5r7x8x6x50ir1i0ncgsnfwh1vnrz6mxbq7z";
|
2021-04-23 17:01:33 +01:00
|
|
|
|
extraPaths = with self; [ common libc.src sys.src ];
|
2021-04-23 16:52:30 +01:00
|
|
|
|
nativeBuildInputs = with buildPackages.netbsd; [
|
2020-03-09 06:10:06 +00:00
|
|
|
|
bsdSetupHook netbsdSetupHook
|
2021-04-23 16:52:30 +01:00
|
|
|
|
makeMinimal
|
2021-11-03 15:50:01 +00:00
|
|
|
|
byacc install tsort lorder mandoc statHook rsync
|
2021-04-23 16:52:30 +01:00
|
|
|
|
];
|
|
|
|
|
buildInputs = with self; [ headers ];
|
|
|
|
|
SHLIBINSTALLDIR = "$(out)/lib";
|
2018-07-28 17:29:02 +01:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
libedit = mkDerivation {
|
|
|
|
|
path = "lib/libedit";
|
2021-05-15 11:02:05 +01:00
|
|
|
|
version = "9.2";
|
2021-04-29 22:01:23 +01:00
|
|
|
|
sha256 = "1wqhngraxwqk4jgrf5f18jy195yrp7c06n1gf31pbplq79mg1bcj";
|
2020-03-09 06:10:06 +00:00
|
|
|
|
buildInputs = with self; [ libterminfo libcurses ];
|
|
|
|
|
propagatedBuildInputs = with self; compatIfNeeded;
|
2021-04-30 14:59:47 +01:00
|
|
|
|
SHLIBINSTALLDIR = "$(out)/lib";
|
2021-09-03 15:02:58 +01:00
|
|
|
|
makeFlags = defaultMakeFlags ++ [ "LIBDO.terminfo=${self.libterminfo}/lib" ];
|
2018-07-28 17:29:02 +01:00
|
|
|
|
postPatch = ''
|
|
|
|
|
sed -i '1i #undef bool_t' el.h
|
|
|
|
|
substituteInPlace config.h \
|
|
|
|
|
--replace "#define HAVE_STRUCT_DIRENT_D_NAMLEN 1" ""
|
|
|
|
|
substituteInPlace readline/Makefile --replace /usr/include "$out/include"
|
|
|
|
|
'';
|
|
|
|
|
NIX_CFLAGS_COMPILE = [
|
|
|
|
|
"-D__noinline="
|
|
|
|
|
"-D__scanflike(a,b)="
|
|
|
|
|
"-D__va_list=va_list"
|
|
|
|
|
];
|
|
|
|
|
};
|
2018-04-12 06:14:15 +01:00
|
|
|
|
|
2018-07-28 17:29:02 +01:00
|
|
|
|
libterminfo = mkDerivation {
|
|
|
|
|
path = "lib/libterminfo";
|
2021-05-15 11:02:05 +01:00
|
|
|
|
version = "9.2";
|
2021-04-29 22:01:23 +01:00
|
|
|
|
sha256 = "0pq05k3dj0dfsczv07frnnji92mazmy2qqngqbx2zgqc1x251414";
|
2020-03-09 06:10:06 +00:00
|
|
|
|
nativeBuildInputs = with buildPackages.netbsd; [
|
2020-03-09 06:10:06 +00:00
|
|
|
|
bsdSetupHook netbsdSetupHook
|
2021-11-03 15:50:01 +00:00
|
|
|
|
makeMinimal install tsort lorder mandoc statHook nbperf tic rsync
|
2021-04-22 16:46:20 +01:00
|
|
|
|
];
|
2020-03-09 06:10:06 +00:00
|
|
|
|
buildInputs = with self; compatIfNeeded;
|
2021-04-22 16:46:20 +01:00
|
|
|
|
SHLIBINSTALLDIR = "$(out)/lib";
|
2018-07-28 17:29:02 +01:00
|
|
|
|
postPatch = ''
|
|
|
|
|
substituteInPlace term.c --replace /usr/share $out/share
|
|
|
|
|
substituteInPlace setupterm.c \
|
|
|
|
|
--replace '#include <curses.h>' 'void use_env(bool);'
|
|
|
|
|
'';
|
2021-04-22 16:46:20 +01:00
|
|
|
|
postBuild = ''
|
2021-04-23 13:41:20 +01:00
|
|
|
|
make -C $BSDSRCDIR/share/terminfo $makeFlags BINDIR=$out/share
|
2021-04-22 16:46:20 +01:00
|
|
|
|
'';
|
2018-07-28 17:29:02 +01:00
|
|
|
|
postInstall = ''
|
2021-04-23 13:41:20 +01:00
|
|
|
|
make -C $BSDSRCDIR/share/terminfo $makeFlags BINDIR=$out/share install
|
2018-07-28 17:29:02 +01:00
|
|
|
|
'';
|
2020-03-09 06:10:06 +00:00
|
|
|
|
extraPaths = with self; [
|
2021-05-15 11:02:05 +01:00
|
|
|
|
(fetchNetBSD "share/terminfo" "9.2" "1vh9rl4w8118a9qdpblfxmv1wkpm83rm9gb4rzz5bpm56i6d7kk7")
|
2018-07-28 17:29:02 +01:00
|
|
|
|
];
|
2018-05-02 04:20:19 +01:00
|
|
|
|
};
|
|
|
|
|
|
2018-07-28 17:29:02 +01:00
|
|
|
|
libcurses = mkDerivation {
|
|
|
|
|
path = "lib/libcurses";
|
2021-05-15 11:02:05 +01:00
|
|
|
|
version = "9.2";
|
2021-04-29 22:01:23 +01:00
|
|
|
|
sha256 = "0pd0dggl3w4bv5i5h0s1wrc8hr66n4hkv3zlklarwfdhc692fqal";
|
2020-03-09 06:10:06 +00:00
|
|
|
|
buildInputs = with self; [ libterminfo ];
|
2018-07-28 17:29:02 +01:00
|
|
|
|
NIX_CFLAGS_COMPILE = [
|
|
|
|
|
"-D__scanflike(a,b)="
|
|
|
|
|
"-D__va_list=va_list"
|
|
|
|
|
"-D__warn_references(a,b)="
|
|
|
|
|
] ++ lib.optional stdenv.isDarwin "-D__strong_alias(a,b)=";
|
2020-03-09 06:10:06 +00:00
|
|
|
|
propagatedBuildInputs = with self; compatIfNeeded;
|
2018-07-28 17:29:02 +01:00
|
|
|
|
MKDOC = "no"; # missing vfontedpr
|
2021-09-03 15:02:58 +01:00
|
|
|
|
makeFlags = defaultMakeFlags ++ [ "LIBDO.terminfo=${self.libterminfo}/lib" ];
|
2018-07-28 17:29:02 +01:00
|
|
|
|
postPatch = lib.optionalString (!stdenv.isDarwin) ''
|
|
|
|
|
substituteInPlace printw.c \
|
|
|
|
|
--replace "funopen(win, NULL, __winwrite, NULL, NULL)" NULL \
|
|
|
|
|
--replace "__strong_alias(vwprintw, vw_printw)" 'extern int vwprintw(WINDOW*, const char*, va_list) __attribute__ ((alias ("vw_printw")));'
|
|
|
|
|
substituteInPlace scanw.c \
|
|
|
|
|
--replace "__strong_alias(vwscanw, vw_scanw)" 'extern int vwscanw(WINDOW*, const char*, va_list) __attribute__ ((alias ("vw_scanw")));'
|
|
|
|
|
'';
|
2018-06-11 19:44:49 +01:00
|
|
|
|
};
|
|
|
|
|
|
2018-07-28 17:29:02 +01:00
|
|
|
|
column = mkDerivation {
|
2019-01-23 21:35:11 +00:00
|
|
|
|
path = "usr.bin/column";
|
2021-05-15 11:02:05 +01:00
|
|
|
|
version = "9.2";
|
2019-01-23 21:35:11 +00:00
|
|
|
|
sha256 = "0r6b0hjn5ls3j3sv6chibs44fs32yyk2cg8kh70kb4cwajs4ifyl";
|
|
|
|
|
};
|
|
|
|
|
|
2018-07-28 17:29:02 +01:00
|
|
|
|
libossaudio = mkDerivation {
|
|
|
|
|
path = "lib/libossaudio";
|
2021-05-15 11:02:05 +01:00
|
|
|
|
version = "9.2";
|
2021-04-29 22:01:23 +01:00
|
|
|
|
sha256 = "16l3bfy6dcwqnklvh3x0ps8ld1y504vf57v9rx8f9adzhb797jh0";
|
2018-07-28 17:29:02 +01:00
|
|
|
|
meta.platforms = lib.platforms.netbsd;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
librpcsvc = mkDerivation {
|
|
|
|
|
path = "lib/librpcsvc";
|
2021-05-15 11:02:05 +01:00
|
|
|
|
version = "9.2";
|
2021-04-29 22:01:23 +01:00
|
|
|
|
sha256 = "1q34pfiyjbrgrdqm46jwrsqms49ly6z3b0xh1wg331zga900vq5n";
|
2021-09-03 15:02:58 +01:00
|
|
|
|
makeFlags = defaultMakeFlags ++ [ "INCSDIR=$(out)/include/rpcsvc" ];
|
2018-07-28 17:29:02 +01:00
|
|
|
|
meta.platforms = lib.platforms.netbsd;
|
2021-04-23 15:59:58 +01:00
|
|
|
|
nativeBuildInputs = with buildPackages.netbsd; [
|
2020-03-09 06:10:06 +00:00
|
|
|
|
bsdSetupHook netbsdSetupHook
|
2021-04-23 15:59:58 +01:00
|
|
|
|
makeMinimal
|
|
|
|
|
install tsort lorder rpcgen statHook
|
|
|
|
|
];
|
2018-07-28 17:29:02 +01:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
librt = mkDerivation {
|
|
|
|
|
path = "lib/librt";
|
2021-05-15 11:02:05 +01:00
|
|
|
|
version = "9.2";
|
2021-04-29 22:01:23 +01:00
|
|
|
|
sha256 = "07f8mpjcqh5kig5z5sp97fg55mc4dz6aa1x5g01nv2pvbmqczxc6";
|
2018-07-28 17:29:02 +01:00
|
|
|
|
meta.platforms = lib.platforms.netbsd;
|
2021-04-29 22:01:23 +01:00
|
|
|
|
extraPaths = with self; [ libc.src ] ++ libc.extraPaths;
|
2021-04-23 15:48:35 +01:00
|
|
|
|
postPatch = ''
|
|
|
|
|
sed -i 's,/usr\(/include/sys/syscall.h\),${self.headers}\1,g' \
|
|
|
|
|
$BSDSRCDIR/lib/{libc,librt}/sys/Makefile.inc
|
|
|
|
|
'';
|
2018-07-28 17:29:02 +01:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
libcrypt = mkDerivation {
|
|
|
|
|
path = "lib/libcrypt";
|
2021-05-15 11:02:05 +01:00
|
|
|
|
version = "9.2";
|
2018-07-28 17:29:02 +01:00
|
|
|
|
sha256 = "0siqan1wdqmmhchh2n8w6a8x1abbff8n4yb6jrqxap3hqn8ay54g";
|
2021-04-23 16:20:41 +01:00
|
|
|
|
SHLIBINSTALLDIR = "$(out)/lib";
|
2018-07-28 17:29:02 +01:00
|
|
|
|
meta.platforms = lib.platforms.netbsd;
|
|
|
|
|
};
|
|
|
|
|
|
2020-03-09 06:10:06 +00:00
|
|
|
|
libpthread-headers = mkDerivation {
|
|
|
|
|
pname = "libpthread-headers";
|
2018-07-28 17:29:02 +01:00
|
|
|
|
path = "lib/libpthread";
|
2021-05-15 11:02:05 +01:00
|
|
|
|
version = "9.2";
|
2021-04-29 22:01:23 +01:00
|
|
|
|
sha256 = "0mlmc31k509dwfmx5s2x010wxjc44mr6y0cbmk30cfipqh8c962h";
|
2020-03-09 06:10:06 +00:00
|
|
|
|
installPhase = "includesPhase";
|
|
|
|
|
dontBuild = true;
|
|
|
|
|
noCC = true;
|
2018-07-28 17:29:02 +01:00
|
|
|
|
meta.platforms = lib.platforms.netbsd;
|
|
|
|
|
};
|
|
|
|
|
|
2020-03-09 06:10:06 +00:00
|
|
|
|
libpthread = self.libpthread-headers.override {
|
|
|
|
|
pname = "libpthread";
|
|
|
|
|
installPhase = null;
|
|
|
|
|
noCC = false;
|
|
|
|
|
dontBuild = false;
|
2021-04-23 16:15:30 +01:00
|
|
|
|
buildInputs = with self; [ headers ];
|
2021-04-29 22:01:23 +01:00
|
|
|
|
SHLIBINSTALLDIR = "$(out)/lib";
|
|
|
|
|
extraPaths = with self; [ common libc.src librt.src sys.src ];
|
2020-03-09 06:10:06 +00:00
|
|
|
|
};
|
|
|
|
|
|
2018-07-28 17:29:02 +01:00
|
|
|
|
libresolv = mkDerivation {
|
|
|
|
|
path = "lib/libresolv";
|
2021-05-15 11:02:05 +01:00
|
|
|
|
version = "9.2";
|
2021-04-29 22:01:23 +01:00
|
|
|
|
sha256 = "1am74s74mf1ynwz3p4ncjkg63f78a1zjm983q166x4sgzps15626";
|
2018-07-28 17:29:02 +01:00
|
|
|
|
meta.platforms = lib.platforms.netbsd;
|
2020-03-09 06:10:06 +00:00
|
|
|
|
extraPaths = with self; [ libc.src ];
|
2018-07-28 17:29:02 +01:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
libm = mkDerivation {
|
|
|
|
|
path = "lib/libm";
|
2021-05-15 11:02:05 +01:00
|
|
|
|
version = "9.2";
|
2021-04-29 22:01:23 +01:00
|
|
|
|
sha256 = "1apwfr26shdmbqqnmg7hxf7bkfxw44ynqnnnghrww9bnhqdnsy92";
|
2021-04-22 20:10:32 +01:00
|
|
|
|
SHLIBINSTALLDIR = "$(out)/lib";
|
2018-07-28 17:29:02 +01:00
|
|
|
|
meta.platforms = lib.platforms.netbsd;
|
2021-04-22 20:10:32 +01:00
|
|
|
|
extraPaths = with self; [ sys.src ];
|
2018-07-28 17:29:02 +01:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
i18n_module = mkDerivation {
|
|
|
|
|
path = "lib/i18n_module";
|
2021-05-15 11:02:05 +01:00
|
|
|
|
version = "9.2";
|
2018-07-28 17:29:02 +01:00
|
|
|
|
sha256 = "0w6y5v3binm7gf2kn7y9jja8k18rhnyl55cvvfnfipjqdxvxd9jd";
|
|
|
|
|
meta.platforms = lib.platforms.netbsd;
|
2020-03-09 06:10:06 +00:00
|
|
|
|
extraPaths = with self; [ libc.src ];
|
2018-07-28 17:29:02 +01:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
csu = mkDerivation {
|
|
|
|
|
path = "lib/csu";
|
2021-05-15 11:02:05 +01:00
|
|
|
|
version = "9.2";
|
2021-04-29 22:01:23 +01:00
|
|
|
|
sha256 = "0al5jfazvhlzn9hvmnrbchx4d0gm282hq5gp4xs2zmj9ycmf6d03";
|
2018-07-28 17:29:02 +01:00
|
|
|
|
meta.platforms = lib.platforms.netbsd;
|
2020-03-09 06:10:06 +00:00
|
|
|
|
nativeBuildInputs = with buildPackages.netbsd; [
|
2020-03-09 06:10:06 +00:00
|
|
|
|
bsdSetupHook netbsdSetupHook
|
2020-03-09 06:10:06 +00:00
|
|
|
|
makeMinimal
|
|
|
|
|
install mandoc groff flex
|
2021-04-19 23:23:30 +01:00
|
|
|
|
byacc genassym gencat lorder tsort statHook rsync
|
2020-03-09 06:10:06 +00:00
|
|
|
|
];
|
2020-03-09 06:10:06 +00:00
|
|
|
|
buildInputs = with self; [ headers ];
|
|
|
|
|
extraPaths = with self; [ sys.src ld_elf_so.src ];
|
2018-07-28 17:29:02 +01:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
ld_elf_so = mkDerivation {
|
|
|
|
|
path = "libexec/ld.elf_so";
|
2021-05-15 11:02:05 +01:00
|
|
|
|
version = "9.2";
|
2021-04-29 22:01:23 +01:00
|
|
|
|
sha256 = "0ia9mqzdljly0vqfwflm5mzz55k7qsr4rw2bzhivky6k30vgirqa";
|
2018-07-28 17:29:02 +01:00
|
|
|
|
meta.platforms = lib.platforms.netbsd;
|
2021-05-15 22:29:25 +01:00
|
|
|
|
LIBC_PIC = "${self.libc}/lib/libc_pic.a";
|
2021-04-22 11:34:56 +01:00
|
|
|
|
# Hack to prevent a symlink being installed here for compatibility.
|
|
|
|
|
SHLINKINSTALLDIR = "/usr/libexec";
|
2018-07-28 17:29:02 +01:00
|
|
|
|
USE_FORT = "yes";
|
2021-09-03 15:02:58 +01:00
|
|
|
|
makeFlags = defaultMakeFlags ++ [ "BINDIR=$(out)/libexec" "CLIBOBJ=${self.libc}/lib" ];
|
2020-03-09 06:10:06 +00:00
|
|
|
|
extraPaths = with self; [ libc.src ] ++ libc.extraPaths;
|
2018-07-28 17:29:02 +01:00
|
|
|
|
};
|
|
|
|
|
|
2021-04-29 22:01:23 +01:00
|
|
|
|
_mainLibcExtraPaths = with self; [
|
|
|
|
|
common i18n_module.src sys.src
|
|
|
|
|
ld_elf_so.src libpthread.src libm.src libresolv.src
|
|
|
|
|
librpcsvc.src libutil.src librt.src libcrypt.src
|
|
|
|
|
];
|
|
|
|
|
|
2018-07-28 17:29:02 +01:00
|
|
|
|
libc = mkDerivation {
|
|
|
|
|
path = "lib/libc";
|
2021-05-15 11:02:05 +01:00
|
|
|
|
version = "9.2";
|
|
|
|
|
sha256 = "1y9c13igg0kai07sqvf9cm6yqmd8lhfd8hq3q7biilbgs1l99as3";
|
2018-07-28 17:29:02 +01:00
|
|
|
|
USE_FORT = "yes";
|
|
|
|
|
MKPROFILE = "no";
|
2021-04-29 22:01:23 +01:00
|
|
|
|
extraPaths = with self; _mainLibcExtraPaths ++ [
|
2021-05-15 11:02:05 +01:00
|
|
|
|
(fetchNetBSD "external/bsd/jemalloc" "9.2" "0cq704swa0h2yxv4gc79z2lwxibk9k7pxh3q5qfs7axx3jx3n8kb")
|
2020-03-09 06:10:06 +00:00
|
|
|
|
];
|
2020-03-09 06:10:06 +00:00
|
|
|
|
nativeBuildInputs = with buildPackages.netbsd; [
|
2020-03-09 06:10:06 +00:00
|
|
|
|
bsdSetupHook netbsdSetupHook
|
2020-03-09 06:10:06 +00:00
|
|
|
|
makeMinimal
|
|
|
|
|
install mandoc groff flex
|
2021-04-19 23:23:30 +01:00
|
|
|
|
byacc genassym gencat lorder tsort statHook rsync rpcgen
|
2020-03-09 06:10:06 +00:00
|
|
|
|
];
|
2020-03-09 06:10:06 +00:00
|
|
|
|
buildInputs = with self; [ headers csu ];
|
|
|
|
|
NIX_CFLAGS_COMPILE = "-B${self.csu}/lib";
|
2018-07-28 17:29:02 +01:00
|
|
|
|
meta.platforms = lib.platforms.netbsd;
|
|
|
|
|
SHLIBINSTALLDIR = "$(out)/lib";
|
2021-04-29 22:01:23 +01:00
|
|
|
|
MKPICINSTALL = "yes";
|
2018-07-28 17:29:02 +01:00
|
|
|
|
NLSDIR = "$(out)/share/nls";
|
2021-09-03 15:02:58 +01:00
|
|
|
|
makeFlags = defaultMakeFlags ++ [ "FILESDIR=$(out)/var/db"];
|
2018-07-28 17:29:02 +01:00
|
|
|
|
postInstall = ''
|
2020-03-09 06:10:06 +00:00
|
|
|
|
pushd ${self.headers}
|
2018-07-28 17:29:02 +01:00
|
|
|
|
find . -type d -exec mkdir -p $out/\{} \;
|
|
|
|
|
find . \( -type f -o -type l \) -exec cp -pr \{} $out/\{} \;
|
|
|
|
|
popd
|
|
|
|
|
|
2020-03-09 06:10:06 +00:00
|
|
|
|
pushd ${self.csu}
|
2018-07-28 17:29:02 +01:00
|
|
|
|
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"
|
|
|
|
|
|
2020-03-09 06:10:06 +00:00
|
|
|
|
make -C $BSDSRCDIR/lib/libpthread $makeFlags
|
|
|
|
|
make -C $BSDSRCDIR/lib/libpthread $makeFlags install
|
2018-07-28 17:29:02 +01:00
|
|
|
|
|
2020-03-09 06:10:06 +00:00
|
|
|
|
make -C $BSDSRCDIR/lib/libm $makeFlags
|
|
|
|
|
make -C $BSDSRCDIR/lib/libm $makeFlags install
|
2018-07-28 17:29:02 +01:00
|
|
|
|
|
2020-03-09 06:10:06 +00:00
|
|
|
|
make -C $BSDSRCDIR/lib/libresolv $makeFlags
|
|
|
|
|
make -C $BSDSRCDIR/lib/libresolv $makeFlags install
|
2018-07-28 17:29:02 +01:00
|
|
|
|
|
2020-03-09 06:10:06 +00:00
|
|
|
|
make -C $BSDSRCDIR/lib/librpcsvc $makeFlags
|
|
|
|
|
make -C $BSDSRCDIR/lib/librpcsvc $makeFlags install
|
2018-07-28 17:29:02 +01:00
|
|
|
|
|
2020-03-09 06:10:06 +00:00
|
|
|
|
make -C $BSDSRCDIR/lib/i18n_module $makeFlags
|
|
|
|
|
make -C $BSDSRCDIR/lib/i18n_module $makeFlags install
|
2018-07-28 17:29:02 +01:00
|
|
|
|
|
2020-03-09 06:10:06 +00:00
|
|
|
|
make -C $BSDSRCDIR/lib/libutil $makeFlags
|
|
|
|
|
make -C $BSDSRCDIR/lib/libutil $makeFlags install
|
2018-07-28 17:29:02 +01:00
|
|
|
|
|
2020-03-09 06:10:06 +00:00
|
|
|
|
make -C $BSDSRCDIR/lib/librt $makeFlags
|
|
|
|
|
make -C $BSDSRCDIR/lib/librt $makeFlags install
|
2018-07-28 17:29:02 +01:00
|
|
|
|
|
2020-03-09 06:10:06 +00:00
|
|
|
|
make -C $BSDSRCDIR/lib/libcrypt $makeFlags
|
|
|
|
|
make -C $BSDSRCDIR/lib/libcrypt $makeFlags install
|
2018-07-28 17:29:02 +01:00
|
|
|
|
'';
|
2021-04-23 15:48:35 +01:00
|
|
|
|
inherit (self.librt) postPatch;
|
2018-07-28 17:29:02 +01:00
|
|
|
|
};
|
|
|
|
|
#
|
|
|
|
|
# END LIBRARIES
|
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
|
# START MISCELLANEOUS
|
|
|
|
|
#
|
|
|
|
|
dict = mkDerivation {
|
|
|
|
|
path = "share/dict";
|
|
|
|
|
noCC = true;
|
2021-05-15 11:02:05 +01:00
|
|
|
|
version = "9.2";
|
2021-04-29 22:01:23 +01:00
|
|
|
|
sha256 = "0svfc0byk59ri37pyjslv4c4rc7zw396r73mr593i78d39q5g3ad";
|
2021-09-03 15:02:58 +01:00
|
|
|
|
makeFlags = defaultMakeFlags ++ [ "BINDIR=$(out)/share" ];
|
2018-07-28 17:29:02 +01:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
misc = mkDerivation {
|
|
|
|
|
path = "share/misc";
|
|
|
|
|
noCC = true;
|
2021-05-15 11:02:05 +01:00
|
|
|
|
version = "9.2";
|
2021-04-29 22:01:23 +01:00
|
|
|
|
sha256 = "1j2cdssdx6nncv8ffj7f7ybl7m9hadjj8vm8611skqdvxnjg6nbc";
|
2021-09-03 15:02:58 +01:00
|
|
|
|
makeFlags = defaultMakeFlags ++ [ "BINDIR=$(out)/share" ];
|
2018-07-28 17:29:02 +01:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
man = mkDerivation {
|
|
|
|
|
path = "share/man";
|
|
|
|
|
noCC = true;
|
2021-05-15 11:02:05 +01:00
|
|
|
|
version = "9.2";
|
|
|
|
|
sha256 = "1l4lmj4kmg8dl86x94sr45w0xdnkz8dn4zjx0ipgr9bnq98663zl";
|
2021-11-15 13:26:13 +00:00
|
|
|
|
# man0 generates a man.pdf using ps2pdf, but doesn't install it later,
|
|
|
|
|
# so we can avoid the dependency on ghostscript
|
|
|
|
|
postPatch = ''
|
|
|
|
|
substituteInPlace man0/Makefile --replace "ps2pdf" "echo noop "
|
|
|
|
|
'';
|
|
|
|
|
makeFlags = defaultMakeFlags ++ [
|
|
|
|
|
"FILESDIR=$(out)/share"
|
|
|
|
|
"MKRUMP=no" # would require to have additional path sys/rump/share/man
|
|
|
|
|
];
|
2018-07-28 17:29:02 +01:00
|
|
|
|
};
|
|
|
|
|
#
|
|
|
|
|
# END MISCELLANEOUS
|
|
|
|
|
#
|
|
|
|
|
|
2020-03-09 06:10:06 +00:00
|
|
|
|
})
|