summary refs log tree commit diff
path: root/pkgs/os-specific/bsd/netbsd/fts-setup-hook.sh
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2018-05-07 13:07:19 -0400
committerJohn Ericson <John.Ericson@Obsidian.Systems>2018-05-07 15:10:37 -0400
commit2110c0bd3009279ceec291f07bfbf063cb5ba6a0 (patch)
tree7c981653734d64a2b9c1859233b9902aa36f4ab1 /pkgs/os-specific/bsd/netbsd/fts-setup-hook.sh
parent34a3233a2e1e8ed2f005a3a86cfca02d5f2769ae (diff)
downloadnixpkgs-2110c0bd3009279ceec291f07bfbf063cb5ba6a0.tar
nixpkgs-2110c0bd3009279ceec291f07bfbf063cb5ba6a0.tar.gz
nixpkgs-2110c0bd3009279ceec291f07bfbf063cb5ba6a0.tar.bz2
nixpkgs-2110c0bd3009279ceec291f07bfbf063cb5ba6a0.tar.lz
nixpkgs-2110c0bd3009279ceec291f07bfbf063cb5ba6a0.tar.xz
nixpkgs-2110c0bd3009279ceec291f07bfbf063cb5ba6a0.tar.zst
nixpkgs-2110c0bd3009279ceec291f07bfbf063cb5ba6a0.zip
treewide: Use pkgs/build-support/roles.bash to remove copy pasta
Also fix some setup hooks that unnecessarily used environment hooks,
which revolted in the same variable being modified too many times.
Diffstat (limited to 'pkgs/os-specific/bsd/netbsd/fts-setup-hook.sh')
-rw-r--r--pkgs/os-specific/bsd/netbsd/fts-setup-hook.sh18
1 files changed, 3 insertions, 15 deletions
diff --git a/pkgs/os-specific/bsd/netbsd/fts-setup-hook.sh b/pkgs/os-specific/bsd/netbsd/fts-setup-hook.sh
index 6b706417493..5cf8c753aec 100644
--- a/pkgs/os-specific/bsd/netbsd/fts-setup-hook.sh
+++ b/pkgs/os-specific/bsd/netbsd/fts-setup-hook.sh
@@ -1,16 +1,4 @@
-ftsLdflags() {
-    # The `depHostOffset` describes how the host platform of the dependencies
-    # are slid relative to the depending package. It is brought into scope of
-    # the environment hook defined as the role of the dependency being applied.
-    case $depHostOffset in
-        -1) local role='BUILD_' ;;
-        0)  local role='' ;;
-        1)  local role='TARGET_' ;;
-        *)  echo "cc-wrapper: Error: Cannot be used with $depHostOffset-offset deps" >2;
-            return 1 ;;
-    esac
+# See pkgs/build-support/setup-hooks/role.bash
+getHostRole
 
-    export NIX_${role}LDFLAGS+=" -lfts"
-}
-
-addEnvHooks "$hostOffset" ftsLdflags
+export NIX_${role_pre}LDFLAGS+=" -lfts"