about summary refs log tree commit diff
path: root/pkgs/os-specific/bsd/setup-hook.sh
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2022-10-06 00:51:05 -0400
committerJohn Ericson <John.Ericson@Obsidian.Systems>2022-10-06 15:33:28 -0400
commitdcf7a5ec3dac6a53ce1a27e0806bd93309b9d053 (patch)
treed87630adc2508824be5623c858a9babe632b4ef7 /pkgs/os-specific/bsd/setup-hook.sh
parent3413bc7d800ce97618751e072b8d3113efc8da37 (diff)
netbsd: Adapt to BSD-common infra changes for FreeBSD
See https://github.com/NixOS/nixpkgs/pull/82131 for the rest of the
changes for FreeBSD. This is PRed separately because it is a macOS
moderate rebuild so we target staging.

The main change is that we CD to the path we're building *after*
applying patches, so we can patch other parts of the tree (from
`extraPaths`) as needed.

Another change is that `netbsd.install` no longer depends on `fts`,
which it evidently no longer needs.
Diffstat (limited to 'pkgs/os-specific/bsd/setup-hook.sh')
-rw-r--r--pkgs/os-specific/bsd/setup-hook.sh7
1 files changed, 6 insertions, 1 deletions
diff --git a/pkgs/os-specific/bsd/setup-hook.sh b/pkgs/os-specific/bsd/setup-hook.sh
index 4bdfde68b62e7..7dd7de48ac463 100644
--- a/pkgs/os-specific/bsd/setup-hook.sh
+++ b/pkgs/os-specific/bsd/setup-hook.sh
@@ -48,6 +48,7 @@ addMakeFlags() {
   makeFlags="BINDIR=${!outputBin}/bin $makeFlags"
   makeFlags="LIBDIR=${!outputLib}/lib $makeFlags"
   makeFlags="SHLIBDIR=${!outputLib}/lib $makeFlags"
+  makeFlags="SHAREDIR=${!outputLib}/share $makeFlags"
   makeFlags="MANDIR=${!outputMan}/share/man $makeFlags"
   makeFlags="INFODIR=${!outputInfo}/share/info $makeFlags"
   makeFlags="DOCDIR=${!outputDoc}/share/doc $makeFlags"
@@ -61,10 +62,13 @@ setBSDSourceDir() {
   sourceRoot=$PWD/$sourceRoot
   export BSDSRCDIR=$sourceRoot
   export _SRC_TOP_=$BSDSRCDIR
-
   cd $sourceRoot
+}
+
+cdBSDPath() {
   if [ -d "$BSD_PATH" ]
     then sourceRoot=$sourceRoot/$BSD_PATH
+    cd $BSD_PATH
   fi
 }
 
@@ -104,6 +108,7 @@ moveUsrDir() {
 }
 
 postUnpackHooks+=(setBSDSourceDir)
+postPatchHooks+=(cdBSDPath)
 preConfigureHooks+=(addMakeFlags)
 preInstallHooks+=(includesPhase)
 fixupOutputHooks+=(moveUsrDir)