Skip to content

Commit

Permalink
Merge pull request #320840 from obsidiansystems/bsd-misc
Browse files Browse the repository at this point in the history
A few misc BSD related cleanups
  • Loading branch information
Ericson2314 committed Jun 18, 2024
2 parents 240648a + b6727bb commit f183a68
Show file tree
Hide file tree
Showing 55 changed files with 92 additions and 217 deletions.
2 changes: 1 addition & 1 deletion lib/systems/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ let
&& final.parsed.kernel == platform.parsed.kernel;
isCompatible = _: throw "2022-05-23: isCompatible has been removed in favor of canExecute, refer to the 22.11 changelog for details";
# Derived meta-data
useLLVM = final.isFreeBSD;
useLLVM = final.isFreeBSD || final.isOpenBSD;

libc =
/**/ if final.isDarwin then "libSystem"
Expand Down
34 changes: 13 additions & 21 deletions pkgs/os-specific/bsd/netbsd/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,7 @@ makeScopeWithSplicing' {
directory = ./pkgs;
}
// {

fetchNetBSD =
path: version: sha256:
fetchcvs {
cvsRoot = ":pserver:[email protected]:/cvsroot";
module = "src/${path}";
inherit sha256;
tag = "netbsd-${lib.replaceStrings [ "." ] [ "-" ] version}-RELEASE";
};
version = "9.2";

defaultMakeFlags = [
"MKSOFTFLOAT=${
Expand Down Expand Up @@ -151,18 +143,18 @@ makeScopeWithSplicing' {
inherit (buildPackages.buildPackages) rsync;
};

_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
_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 {
Expand Down
2 changes: 0 additions & 2 deletions pkgs/os-specific/bsd/netbsd/pkgs/cksum.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,5 @@

mkDerivation {
path = "usr.bin/cksum";
version = "9.2";
sha256 = "0msfhgyvh5c2jmc6qjnf12c378dhw32ffsl864qz4rdb2b98rfcq";
meta.platforms = lib.platforms.netbsd;
}
6 changes: 1 addition & 5 deletions pkgs/os-specific/bsd/netbsd/pkgs/column.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
{ mkDerivation }:

mkDerivation {
path = "usr.bin/column";
version = "9.2";
sha256 = "0r6b0hjn5ls3j3sv6chibs44fs32yyk2cg8kh70kb4cwajs4ifyl";
}
mkDerivation { path = "usr.bin/column"; }
3 changes: 0 additions & 3 deletions pkgs/os-specific/bsd/netbsd/pkgs/common.nix

This file was deleted.

19 changes: 7 additions & 12 deletions pkgs/os-specific/bsd/netbsd/pkgs/compat/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,16 @@
netbsdSetupHook,
makeMinimal,
rsync,
fetchNetBSD,
_mainLibcExtraPaths,
version,
}:

mkDerivation (
let
version = "9.2";
commonDeps = [ zlib ];
in
{
path = "tools/compat";
sha256 = "1vsxg7136nlhc72vpa664vs22874xh7ila95nkmsd8crn3z3cyn0";
inherit version;

setupHooks = [
../../../../../build-support/setup-hooks/role.bash
Expand Down Expand Up @@ -133,14 +130,12 @@ mkDerivation (
--subst-var-by version ${version}
'';
extraPaths = [
include.src
libc.src
libutil.src
(fetchNetBSD "external/bsd/flex" "9.2" "0h98jpfj7vx5zh7vd7bk6b1hmzgkcb757a8j6d9zgygxxv13v43m")
(fetchNetBSD "sys/sys" "9.2" "0zawhw51klaigqqwkx0lzrx3mim2jywrc24cm7c66qsf1im9awgd")
(fetchNetBSD "common/include/rpc/types.h" "9.2"
"0n2df12mlc3cbc48jxq35yzl1y7ghgpykvy7jnfh898rdhac7m9a"
)
include.path
libc.path
libutil.path
"external/bsd/flex"
"sys/sys"
"common/include/rpc/types.h"
] ++ libutil.extraPaths ++ _mainLibcExtraPaths;
}
)
4 changes: 1 addition & 3 deletions pkgs/os-specific/bsd/netbsd/pkgs/config.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
}:
mkDerivation {
path = "usr.bin/config";
version = "9.2";
sha256 = "1yz3n4hncdkk6kp595fh2q5lg150vpqg8iw2dccydkyw4y3hgsjj";
env.NIX_CFLAGS_COMPILE = toString [ "-DMAKE_BOOTSTRAP" ];
nativeBuildInputs = [
bsdSetupHook
Expand All @@ -27,5 +25,5 @@ mkDerivation {
rsync
];
buildInputs = compatIfNeeded;
extraPaths = [ cksum.src ];
extraPaths = [ cksum.path ];
}
6 changes: 2 additions & 4 deletions pkgs/os-specific/bsd/netbsd/pkgs/csu.nix
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@

mkDerivation {
path = "lib/csu";
version = "9.2";
sha256 = "0al5jfazvhlzn9hvmnrbchx4d0gm282hq5gp4xs2zmj9ycmf6d03";
meta.platforms = lib.platforms.netbsd;
nativeBuildInputs = [
bsdSetupHook
Expand All @@ -43,7 +41,7 @@ mkDerivation {
];
buildInputs = [ headers ];
extraPaths = [
sys.src
ld_elf_so.src
sys.path
ld_elf_so.path
];
}
2 changes: 0 additions & 2 deletions pkgs/os-specific/bsd/netbsd/pkgs/dict.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,5 @@
mkDerivation {
path = "share/dict";
noCC = true;
version = "9.2";
sha256 = "0svfc0byk59ri37pyjslv4c4rc7zw396r73mr593i78d39q5g3ad";
makeFlags = defaultMakeFlags ++ [ "BINDIR=$(out)/share" ];
}
11 changes: 3 additions & 8 deletions pkgs/os-specific/bsd/netbsd/pkgs/fts/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,21 @@
netbsdSetupHook,
rsync,
compatIfNeeded,
fetchNetBSD,
}:

mkDerivation {
pname = "fts";
path = "include/fts.h";
sha256 = "01d4fpxvz1pgzfk5xznz5dcm0x0gdzwcsfm1h3d0xc9kc6hj2q77";
version = "9.2";
nativeBuildInputs = [
bsdSetupHook
netbsdSetupHook
rsync
];
propagatedBuildInputs = compatIfNeeded;
extraPaths = [
(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")
"lib/libc/gen/fts.c"
"lib/libc/include/namespace.h"
"lib/libc/gen/fts.3"
];
skipIncludesPhase = true;
buildPhase = ''
Expand Down
6 changes: 1 addition & 5 deletions pkgs/os-specific/bsd/netbsd/pkgs/genassym.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
{ mkDerivation }:

mkDerivation {
path = "usr.bin/genassym";
version = "9.2";
sha256 = "1acl1dz5kvh9h5806vkz2ap95rdsz7phmynh5i3x5y7agbki030c";
}
mkDerivation { path = "usr.bin/genassym"; }
6 changes: 1 addition & 5 deletions pkgs/os-specific/bsd/netbsd/pkgs/gencat.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
{ mkDerivation }:

mkDerivation {
path = "usr.bin/gencat";
version = "9.2";
sha256 = "0gd463x1hg36bhr7y0xryb5jyxk0z0g7xvy8rgk82nlbnlnsbbwb";
}
mkDerivation { path = "usr.bin/gencat"; }
6 changes: 1 addition & 5 deletions pkgs/os-specific/bsd/netbsd/pkgs/getconf.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
{ mkDerivation }:

mkDerivation {
path = "usr.bin/getconf";
sha256 = "122vslz4j3h2mfs921nr2s6m078zcj697yrb75rwp2hnw3qz4s8q";
version = "9.2";
}
mkDerivation { path = "usr.bin/getconf"; }
2 changes: 0 additions & 2 deletions pkgs/os-specific/bsd/netbsd/pkgs/getent/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,5 @@

mkDerivation {
path = "usr.bin/getent";
sha256 = "1qngywcmm0y7nl8h3n8brvkxq4jw63szbci3kc1q6a6ndhycbbvr";
version = "9.2";
patches = [ ./getent.patch ];
}
4 changes: 1 addition & 3 deletions pkgs/os-specific/bsd/netbsd/pkgs/i18n_module.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@

mkDerivation {
path = "lib/i18n_module";
version = "9.2";
sha256 = "0w6y5v3binm7gf2kn7y9jja8k18rhnyl55cvvfnfipjqdxvxd9jd";
meta.platforms = lib.platforms.netbsd;
extraPaths = [ libc.src ];
extraPaths = [ libc.path ];
}
5 changes: 1 addition & 4 deletions pkgs/os-specific/bsd/netbsd/pkgs/include.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,12 @@
rsync,
nbperf,
rpcgen,
common,
defaultMakeFlags,
stdenv,
}:

mkDerivation {
path = "include";
version = "9.2";
sha256 = "0nxnmj4c8s3hb9n3fpcmd0zl3l1nmhivqgi9a35sis943qvpgl9h";
nativeBuildInputs = [
bsdSetupHook
netbsdSetupHook
Expand Down Expand Up @@ -46,7 +43,7 @@ mkDerivation {
makeFlags=''${makeFlags/INCSDIR/INCSDIR0}
'';

extraPaths = [ common ];
extraPaths = [ "common" ];
headersOnly = true;
noCC = true;
meta.platforms = lib.platforms.netbsd;
Expand Down
6 changes: 2 additions & 4 deletions pkgs/os-specific/bsd/netbsd/pkgs/install/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,9 @@ let
in
mkDerivation {
path = "usr.bin/xinstall";
version = "9.2";
sha256 = "1f6pbz3qv1qcrchdxif8p5lbmnwl8b9nq615hsd3cyl4avd5bfqj";
extraPaths = [
mtree.src
make.src
mtree.path
make.path
];
nativeBuildInputs = [
bsdSetupHook
Expand Down
4 changes: 1 addition & 3 deletions pkgs/os-specific/bsd/netbsd/pkgs/ld_elf_so.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@

mkDerivation {
path = "libexec/ld.elf_so";
version = "9.2";
sha256 = "0ia9mqzdljly0vqfwflm5mzz55k7qsr4rw2bzhivky6k30vgirqa";
meta.platforms = lib.platforms.netbsd;
LIBC_PIC = "${libc}/lib/libc_pic.a";
# Hack to prevent a symlink being installed here for compatibility.
Expand All @@ -18,5 +16,5 @@ mkDerivation {
"BINDIR=$(out)/libexec"
"CLIBOBJ=${libc}/lib"
];
extraPaths = [ libc.src ] ++ libc.extraPaths;
extraPaths = [ libc.path ] ++ libc.extraPaths;
}
2 changes: 0 additions & 2 deletions pkgs/os-specific/bsd/netbsd/pkgs/libarch.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,5 @@

mkDerivation {
path = "lib/libarch";
version = "9.2";
sha256 = "6ssenRhuSwp0Jn71ErT0PrEoCJ+cIYRztwdL4QTDZsQ=";
meta.platforms = lib.platforms.netbsd;
}
7 changes: 1 addition & 6 deletions pkgs/os-specific/bsd/netbsd/pkgs/libc.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
mkDerivation,
defaultMakeFlags,
_mainLibcExtraPaths,
fetchNetBSD,
bsdSetupHook,
netbsdSetupHook,
makeMinimal,
Expand All @@ -26,13 +25,9 @@

mkDerivation {
path = "lib/libc";
version = "9.2";
sha256 = "1y9c13igg0kai07sqvf9cm6yqmd8lhfd8hq3q7biilbgs1l99as3";
USE_FORT = "yes";
MKPROFILE = "no";
extraPaths = _mainLibcExtraPaths ++ [
(fetchNetBSD "external/bsd/jemalloc" "9.2" "0cq704swa0h2yxv4gc79z2lwxibk9k7pxh3q5qfs7axx3jx3n8kb")
];
extraPaths = _mainLibcExtraPaths ++ [ "external/bsd/jemalloc" ];
nativeBuildInputs = [
bsdSetupHook
netbsdSetupHook
Expand Down
2 changes: 0 additions & 2 deletions pkgs/os-specific/bsd/netbsd/pkgs/libcrypt.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

mkDerivation {
path = "lib/libcrypt";
version = "9.2";
sha256 = "0siqan1wdqmmhchh2n8w6a8x1abbff8n4yb6jrqxap3hqn8ay54g";
SHLIBINSTALLDIR = "$(out)/lib";
meta.platforms = lib.platforms.netbsd;
}
2 changes: 0 additions & 2 deletions pkgs/os-specific/bsd/netbsd/pkgs/libcurses.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@

mkDerivation {
path = "lib/libcurses";
version = "9.2";
sha256 = "0pd0dggl3w4bv5i5h0s1wrc8hr66n4hkv3zlklarwfdhc692fqal";
buildInputs = [ libterminfo ];
env.NIX_CFLAGS_COMPILE = toString (
[
Expand Down
2 changes: 0 additions & 2 deletions pkgs/os-specific/bsd/netbsd/pkgs/libedit.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@

mkDerivation {
path = "lib/libedit";
version = "9.2";
sha256 = "1wqhngraxwqk4jgrf5f18jy195yrp7c06n1gf31pbplq79mg1bcj";
buildInputs = [
libterminfo
libcurses
Expand Down
4 changes: 1 addition & 3 deletions pkgs/os-specific/bsd/netbsd/pkgs/libm.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@

mkDerivation {
path = "lib/libm";
version = "9.2";
sha256 = "1apwfr26shdmbqqnmg7hxf7bkfxw44ynqnnnghrww9bnhqdnsy92";
SHLIBINSTALLDIR = "$(out)/lib";
meta.platforms = lib.platforms.netbsd;
extraPaths = [ sys.src ];
extraPaths = [ sys.path ];
}
2 changes: 0 additions & 2 deletions pkgs/os-specific/bsd/netbsd/pkgs/libossaudio.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,5 @@

mkDerivation {
path = "lib/libossaudio";
version = "9.2";
sha256 = "16l3bfy6dcwqnklvh3x0ps8ld1y504vf57v9rx8f9adzhb797jh0";
meta.platforms = lib.platforms.netbsd;
}
4 changes: 1 addition & 3 deletions pkgs/os-specific/bsd/netbsd/pkgs/libpci.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@
mkDerivation {
pname = "libpci";
path = "lib/libpci";
version = "9.2";
sha256 = "+IOEO1Bw3/H3iCp3uk3bwsFZbvCqN5Ciz70irnPl8E8=";
env.NIX_CFLAGS_COMPILE = toString [ "-I." ];
meta.platforms = lib.platforms.netbsd;
extraPaths = [ sys.src ];
extraPaths = [ sys.path ];
}
6 changes: 1 addition & 5 deletions pkgs/os-specific/bsd/netbsd/pkgs/libpthread/base.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1 @@
{
path = "lib/libpthread";
version = "9.2";
sha256 = "0mlmc31k509dwfmx5s2x010wxjc44mr6y0cbmk30cfipqh8c962h";
}
{ path = "lib/libpthread"; }
Loading

0 comments on commit f183a68

Please sign in to comment.