mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-31 09:14:28 +00:00
netbsd.statHook: init
This fixes the build of various NetBSD programs on Linux, e.g. netbsd.statHook.
This commit is contained in:
parent
e7adc44bb8
commit
3b5b199012
@ -1,5 +1,5 @@
|
||||
{ stdenv, stdenvNoCC, fetchcvs, lib, groff, mandoc, zlib, bison, flex
|
||||
, writeText, buildPackages, splicePackages, symlinkJoin }:
|
||||
, makeSetupHook, writeText, buildPackages, splicePackages, symlinkJoin }:
|
||||
|
||||
let
|
||||
fetchNetBSD = path: version: sha256: fetchcvs {
|
||||
@ -30,7 +30,7 @@ let
|
||||
|
||||
extraPaths = [ ];
|
||||
|
||||
nativeBuildInputs = [ makeMinimal install tsort lorder mandoc groff stat ];
|
||||
nativeBuildInputs = [ makeMinimal install tsort lorder mandoc groff statHook ];
|
||||
buildInputs = [ compat ];
|
||||
# depsBuildBuild = [ buildPackages.stdenv.cc ];
|
||||
|
||||
@ -243,6 +243,7 @@ let
|
||||
];
|
||||
};
|
||||
|
||||
# Don't add this to nativeBuildInputs directly. Use statHook instead.
|
||||
stat = mkDerivation {
|
||||
path = "usr.bin/stat";
|
||||
version = "8.0";
|
||||
@ -250,6 +251,17 @@ let
|
||||
nativeBuildInputs = [ makeMinimal install mandoc groff ];
|
||||
};
|
||||
|
||||
# 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" ''
|
||||
makeFlagsArray+=(TOOL_STAT=${netbsd.stat}/bin/stat)
|
||||
'');
|
||||
|
||||
tsort = mkDerivation {
|
||||
path = "usr.bin/tsort";
|
||||
version = "8.0";
|
||||
@ -563,7 +575,7 @@ let
|
||||
sha256 = "0630lbvz6v4ic13bfg8ccwfhqkgcv76bfdw9f36rfsnwfgpxqsmq";
|
||||
meta.platforms = lib.platforms.netbsd;
|
||||
nativeBuildInputs = [ makeMinimal install mandoc groff flex
|
||||
bison genassym gencat lorder tsort stat ];
|
||||
bison genassym gencat lorder tsort statHook ];
|
||||
extraPaths = [ sys.src ld_elf_so.src ];
|
||||
};
|
||||
|
||||
@ -587,7 +599,7 @@ let
|
||||
librpcsvc.src libutil.src librt.src libcrypt.src ];
|
||||
buildInputs = [ buildPackages.netbsd.headers csu ];
|
||||
nativeBuildInputs = [ makeMinimal install mandoc groff flex
|
||||
bison genassym gencat lorder tsort stat ];
|
||||
bison genassym gencat lorder tsort statHook ];
|
||||
NIX_CFLAGS_COMPILE = "-B${csu}/lib";
|
||||
meta.platforms = lib.platforms.netbsd;
|
||||
SHLIBINSTALLDIR = "$(out)/lib";
|
||||
|
Loading…
Reference in New Issue
Block a user