diff options
author | John Ericson <Ericson2314@yahoo.com> | 2018-05-07 15:32:10 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-07 15:32:10 -0400 |
commit | 4f7cdd35d58e3d32ba576e218316b3c835bc508c (patch) | |
tree | b88a4fc1cb1f397c83dbf32d598c07c6361fb2cf /pkgs/development/compilers/llvm | |
parent | 1c87d77efea75e29061d13e11af68efa6f50aee2 (diff) | |
parent | 8b0fce8cb1013837cd2108193653a1763cd68266 (diff) | |
download | nixlib-4f7cdd35d58e3d32ba576e218316b3c835bc508c.tar nixlib-4f7cdd35d58e3d32ba576e218316b3c835bc508c.tar.gz nixlib-4f7cdd35d58e3d32ba576e218316b3c835bc508c.tar.bz2 nixlib-4f7cdd35d58e3d32ba576e218316b3c835bc508c.tar.lz nixlib-4f7cdd35d58e3d32ba576e218316b3c835bc508c.tar.xz nixlib-4f7cdd35d58e3d32ba576e218316b3c835bc508c.tar.zst nixlib-4f7cdd35d58e3d32ba576e218316b3c835bc508c.zip |
Merge pull request #40139 from obsidiansystems/modular-setup-hooks
treewide: Modular setup hooks
Diffstat (limited to 'pkgs/development/compilers/llvm')
14 files changed, 56 insertions, 91 deletions
diff --git a/pkgs/development/compilers/llvm/3.5/libc++/default.nix b/pkgs/development/compilers/llvm/3.5/libc++/default.nix index 1f1129f578f4..6edd5e9798c7 100644 --- a/pkgs/development/compilers/llvm/3.5/libc++/default.nix +++ b/pkgs/development/compilers/llvm/3.5/libc++/default.nix @@ -39,7 +39,10 @@ stdenv.mkDerivation rec { linkCxxAbi = stdenv.isLinux; - setupHook = ./setup-hook.sh; + setupHooks = [ + ../../../../../build-support/setup-hooks/role.bash + ./setup-hook.sh + ]; meta = { homepage = http://libcxx.llvm.org/; diff --git a/pkgs/development/compilers/llvm/3.5/libc++/setup-hook.sh b/pkgs/development/compilers/llvm/3.5/libc++/setup-hook.sh index e18733b5ea3a..6611259165ae 100644 --- a/pkgs/development/compilers/llvm/3.5/libc++/setup-hook.sh +++ b/pkgs/development/compilers/llvm/3.5/libc++/setup-hook.sh @@ -1,14 +1,6 @@ -# The `hostOffset` describes how the host platform of the dependencies are slid -# relative to the depending package. It is brought into scope of the setup hook -# defined as the role of the dependency whose hooks is being run. -case $hostOffset in - -1) local role='BUILD_' ;; - 0) local role='' ;; - 1) local role='TARGET_' ;; - *) echo "cc-wrapper: Error: Cannot be used with $hostOffset-offset deps" >2; - return 1 ;; -esac +# See pkgs/build-support/setup-hooks/role.bash +getHostRole linkCxxAbi="@linkCxxAbi@" -export NIX_${role}CXXSTDLIB_COMPILE+=" -isystem @out@/include/c++/v1" -export NIX_${role}CXXSTDLIB_LINK=" -stdlib=libc++${linkCxxAbi:+" -lc++abi"}" +export NIX_${role_pre}CXXSTDLIB_COMPILE+=" -isystem @out@/include/c++/v1" +export NIX_${role_pre}CXXSTDLIB_LINK=" -stdlib=libc++${linkCxxAbi:+" -lc++abi"}" diff --git a/pkgs/development/compilers/llvm/3.7/libc++/default.nix b/pkgs/development/compilers/llvm/3.7/libc++/default.nix index 4296c0fd192c..462e35a483f4 100644 --- a/pkgs/development/compilers/llvm/3.7/libc++/default.nix +++ b/pkgs/development/compilers/llvm/3.7/libc++/default.nix @@ -33,7 +33,10 @@ stdenv.mkDerivation rec { linkCxxAbi = stdenv.isLinux; - setupHook = ./setup-hook.sh; + setupHooks = [ + ../../../../../build-support/setup-hooks/role.bash + ./setup-hook.sh + ]; meta = { homepage = http://libcxx.llvm.org/; diff --git a/pkgs/development/compilers/llvm/3.7/libc++/setup-hook.sh b/pkgs/development/compilers/llvm/3.7/libc++/setup-hook.sh index e18733b5ea3a..6611259165ae 100644 --- a/pkgs/development/compilers/llvm/3.7/libc++/setup-hook.sh +++ b/pkgs/development/compilers/llvm/3.7/libc++/setup-hook.sh @@ -1,14 +1,6 @@ -# The `hostOffset` describes how the host platform of the dependencies are slid -# relative to the depending package. It is brought into scope of the setup hook -# defined as the role of the dependency whose hooks is being run. -case $hostOffset in - -1) local role='BUILD_' ;; - 0) local role='' ;; - 1) local role='TARGET_' ;; - *) echo "cc-wrapper: Error: Cannot be used with $hostOffset-offset deps" >2; - return 1 ;; -esac +# See pkgs/build-support/setup-hooks/role.bash +getHostRole linkCxxAbi="@linkCxxAbi@" -export NIX_${role}CXXSTDLIB_COMPILE+=" -isystem @out@/include/c++/v1" -export NIX_${role}CXXSTDLIB_LINK=" -stdlib=libc++${linkCxxAbi:+" -lc++abi"}" +export NIX_${role_pre}CXXSTDLIB_COMPILE+=" -isystem @out@/include/c++/v1" +export NIX_${role_pre}CXXSTDLIB_LINK=" -stdlib=libc++${linkCxxAbi:+" -lc++abi"}" diff --git a/pkgs/development/compilers/llvm/3.8/libc++/default.nix b/pkgs/development/compilers/llvm/3.8/libc++/default.nix index ea468b3772e0..cc3f5545146c 100644 --- a/pkgs/development/compilers/llvm/3.8/libc++/default.nix +++ b/pkgs/development/compilers/llvm/3.8/libc++/default.nix @@ -31,7 +31,10 @@ stdenv.mkDerivation rec { linkCxxAbi = stdenv.isLinux; - setupHook = ./setup-hook.sh; + setupHooks = [ + ../../../../../build-support/setup-hooks/role.bash + ./setup-hook.sh + ]; meta = { homepage = http://libcxx.llvm.org/; diff --git a/pkgs/development/compilers/llvm/3.8/libc++/setup-hook.sh b/pkgs/development/compilers/llvm/3.8/libc++/setup-hook.sh index bcd93cf486ff..6611259165ae 100644 --- a/pkgs/development/compilers/llvm/3.8/libc++/setup-hook.sh +++ b/pkgs/development/compilers/llvm/3.8/libc++/setup-hook.sh @@ -1,14 +1,6 @@ -# The `hostOffset` describes how the host platform of the dependencies -# relative to the depending package. It is brought into scope of the setup hook -# defined as the role of the dependency whose hooks is being run. -case $hostOffset in - -1) local role='BUILD_' ;; - 0) local role='' ;; - 1) local role='TARGET_' ;; - *) echo "cc-wrapper: Error: Cannot be used with $hostOffset-offset deps" >2; - return 1 ;; -esac +# See pkgs/build-support/setup-hooks/role.bash +getHostRole linkCxxAbi="@linkCxxAbi@" -export NIX_${role}CXXSTDLIB_COMPILE+=" -isystem @out@/include/c++/v1" -export NIX_${role}CXXSTDLIB_LINK=" -stdlib=libc++${linkCxxAbi:+" -lc++abi"}" +export NIX_${role_pre}CXXSTDLIB_COMPILE+=" -isystem @out@/include/c++/v1" +export NIX_${role_pre}CXXSTDLIB_LINK=" -stdlib=libc++${linkCxxAbi:+" -lc++abi"}" diff --git a/pkgs/development/compilers/llvm/3.9/libc++/default.nix b/pkgs/development/compilers/llvm/3.9/libc++/default.nix index ad514b0daa54..7e5c30bdfd35 100644 --- a/pkgs/development/compilers/llvm/3.9/libc++/default.nix +++ b/pkgs/development/compilers/llvm/3.9/libc++/default.nix @@ -31,7 +31,10 @@ stdenv.mkDerivation rec { linkCxxAbi = stdenv.isLinux; - setupHook = ./setup-hook.sh; + setupHooks = [ + ../../../../../build-support/setup-hooks/role.bash + ./setup-hook.sh + ]; meta = { homepage = http://libcxx.llvm.org/; diff --git a/pkgs/development/compilers/llvm/3.9/libc++/setup-hook.sh b/pkgs/development/compilers/llvm/3.9/libc++/setup-hook.sh index bcd93cf486ff..6611259165ae 100644 --- a/pkgs/development/compilers/llvm/3.9/libc++/setup-hook.sh +++ b/pkgs/development/compilers/llvm/3.9/libc++/setup-hook.sh @@ -1,14 +1,6 @@ -# The `hostOffset` describes how the host platform of the dependencies -# relative to the depending package. It is brought into scope of the setup hook -# defined as the role of the dependency whose hooks is being run. -case $hostOffset in - -1) local role='BUILD_' ;; - 0) local role='' ;; - 1) local role='TARGET_' ;; - *) echo "cc-wrapper: Error: Cannot be used with $hostOffset-offset deps" >2; - return 1 ;; -esac +# See pkgs/build-support/setup-hooks/role.bash +getHostRole linkCxxAbi="@linkCxxAbi@" -export NIX_${role}CXXSTDLIB_COMPILE+=" -isystem @out@/include/c++/v1" -export NIX_${role}CXXSTDLIB_LINK=" -stdlib=libc++${linkCxxAbi:+" -lc++abi"}" +export NIX_${role_pre}CXXSTDLIB_COMPILE+=" -isystem @out@/include/c++/v1" +export NIX_${role_pre}CXXSTDLIB_LINK=" -stdlib=libc++${linkCxxAbi:+" -lc++abi"}" diff --git a/pkgs/development/compilers/llvm/4/libc++/default.nix b/pkgs/development/compilers/llvm/4/libc++/default.nix index f28957c35185..718abc420a97 100644 --- a/pkgs/development/compilers/llvm/4/libc++/default.nix +++ b/pkgs/development/compilers/llvm/4/libc++/default.nix @@ -44,7 +44,10 @@ stdenv.mkDerivation rec { linkCxxAbi = stdenv.isLinux; - setupHook = ./setup-hook.sh; + setupHooks = [ + ../../../../../build-support/setup-hooks/role.bash + ./setup-hook.sh + ]; meta = { homepage = http://libcxx.llvm.org/; diff --git a/pkgs/development/compilers/llvm/4/libc++/setup-hook.sh b/pkgs/development/compilers/llvm/4/libc++/setup-hook.sh index bcd93cf486ff..6611259165ae 100644 --- a/pkgs/development/compilers/llvm/4/libc++/setup-hook.sh +++ b/pkgs/development/compilers/llvm/4/libc++/setup-hook.sh @@ -1,14 +1,6 @@ -# The `hostOffset` describes how the host platform of the dependencies -# relative to the depending package. It is brought into scope of the setup hook -# defined as the role of the dependency whose hooks is being run. -case $hostOffset in - -1) local role='BUILD_' ;; - 0) local role='' ;; - 1) local role='TARGET_' ;; - *) echo "cc-wrapper: Error: Cannot be used with $hostOffset-offset deps" >2; - return 1 ;; -esac +# See pkgs/build-support/setup-hooks/role.bash +getHostRole linkCxxAbi="@linkCxxAbi@" -export NIX_${role}CXXSTDLIB_COMPILE+=" -isystem @out@/include/c++/v1" -export NIX_${role}CXXSTDLIB_LINK=" -stdlib=libc++${linkCxxAbi:+" -lc++abi"}" +export NIX_${role_pre}CXXSTDLIB_COMPILE+=" -isystem @out@/include/c++/v1" +export NIX_${role_pre}CXXSTDLIB_LINK=" -stdlib=libc++${linkCxxAbi:+" -lc++abi"}" diff --git a/pkgs/development/compilers/llvm/5/libc++/default.nix b/pkgs/development/compilers/llvm/5/libc++/default.nix index 6a486636d33a..5492e12da98c 100644 --- a/pkgs/development/compilers/llvm/5/libc++/default.nix +++ b/pkgs/development/compilers/llvm/5/libc++/default.nix @@ -40,7 +40,10 @@ stdenv.mkDerivation rec { linkCxxAbi = stdenv.isLinux; - setupHook = ./setup-hook.sh; + setupHooks = [ + ../../../../../build-support/setup-hooks/role.bash + ./setup-hook.sh + ]; meta = { homepage = http://libcxx.llvm.org/; diff --git a/pkgs/development/compilers/llvm/5/libc++/setup-hook.sh b/pkgs/development/compilers/llvm/5/libc++/setup-hook.sh index bcd93cf486ff..6611259165ae 100644 --- a/pkgs/development/compilers/llvm/5/libc++/setup-hook.sh +++ b/pkgs/development/compilers/llvm/5/libc++/setup-hook.sh @@ -1,14 +1,6 @@ -# The `hostOffset` describes how the host platform of the dependencies -# relative to the depending package. It is brought into scope of the setup hook -# defined as the role of the dependency whose hooks is being run. -case $hostOffset in - -1) local role='BUILD_' ;; - 0) local role='' ;; - 1) local role='TARGET_' ;; - *) echo "cc-wrapper: Error: Cannot be used with $hostOffset-offset deps" >2; - return 1 ;; -esac +# See pkgs/build-support/setup-hooks/role.bash +getHostRole linkCxxAbi="@linkCxxAbi@" -export NIX_${role}CXXSTDLIB_COMPILE+=" -isystem @out@/include/c++/v1" -export NIX_${role}CXXSTDLIB_LINK=" -stdlib=libc++${linkCxxAbi:+" -lc++abi"}" +export NIX_${role_pre}CXXSTDLIB_COMPILE+=" -isystem @out@/include/c++/v1" +export NIX_${role_pre}CXXSTDLIB_LINK=" -stdlib=libc++${linkCxxAbi:+" -lc++abi"}" diff --git a/pkgs/development/compilers/llvm/6/libc++/default.nix b/pkgs/development/compilers/llvm/6/libc++/default.nix index 3c6c009a58fa..27d8cd18b666 100644 --- a/pkgs/development/compilers/llvm/6/libc++/default.nix +++ b/pkgs/development/compilers/llvm/6/libc++/default.nix @@ -40,7 +40,10 @@ stdenv.mkDerivation rec { linkCxxAbi = stdenv.isLinux; - setupHook = ./setup-hook.sh; + setupHooks = [ + ../../../../../build-support/setup-hooks/role.bash + ./setup-hook.sh + ]; meta = { homepage = http://libcxx.llvm.org/; diff --git a/pkgs/development/compilers/llvm/6/libc++/setup-hook.sh b/pkgs/development/compilers/llvm/6/libc++/setup-hook.sh index bcd93cf486ff..6611259165ae 100644 --- a/pkgs/development/compilers/llvm/6/libc++/setup-hook.sh +++ b/pkgs/development/compilers/llvm/6/libc++/setup-hook.sh @@ -1,14 +1,6 @@ -# The `hostOffset` describes how the host platform of the dependencies -# relative to the depending package. It is brought into scope of the setup hook -# defined as the role of the dependency whose hooks is being run. -case $hostOffset in - -1) local role='BUILD_' ;; - 0) local role='' ;; - 1) local role='TARGET_' ;; - *) echo "cc-wrapper: Error: Cannot be used with $hostOffset-offset deps" >2; - return 1 ;; -esac +# See pkgs/build-support/setup-hooks/role.bash +getHostRole linkCxxAbi="@linkCxxAbi@" -export NIX_${role}CXXSTDLIB_COMPILE+=" -isystem @out@/include/c++/v1" -export NIX_${role}CXXSTDLIB_LINK=" -stdlib=libc++${linkCxxAbi:+" -lc++abi"}" +export NIX_${role_pre}CXXSTDLIB_COMPILE+=" -isystem @out@/include/c++/v1" +export NIX_${role_pre}CXXSTDLIB_LINK=" -stdlib=libc++${linkCxxAbi:+" -lc++abi"}" |