diff options
author | John Ericson <John.Ericson@Obsidian.Systems> | 2017-08-10 18:22:07 -0400 |
---|---|---|
committer | John Ericson <John.Ericson@Obsidian.Systems> | 2017-12-30 22:04:22 -0500 |
commit | 046f091e0d9853a81ce4d484a75cfa1b5fc9347d (patch) | |
tree | 4a0094d67c9444330e9b71d4c89d0ce45630e31b /pkgs/development | |
parent | a1cdc2011ed049cf8a7a0f2f7909d401dc8d9457 (diff) |
treewide: Don't use envHook anymore
This commits needs a MAJOR audit as I oftentimes just guessed which of
`$hostOffset`, `$targetOffset`, or a fixed offset should be used.
Diffstat (limited to 'pkgs/development')
37 files changed, 38 insertions, 61 deletions
diff --git a/pkgs/development/compilers/chicken/setup-hook.sh b/pkgs/development/compilers/chicken/setup-hook.sh index d7f28539dc64..b0d9b53b5378 100644 --- a/pkgs/development/compilers/chicken/setup-hook.sh +++ b/pkgs/development/compilers/chicken/setup-hook.sh @@ -4,4 +4,4 @@ addChickenRepositoryPath() { export CHICKEN_INCLUDE_PATH="$1/share;$CHICKEN_INCLUDE_PATH" } -envHooks=(${envHooks[@]} addChickenRepositoryPath) +addEnvHooks "$targetOffset" addChickenRepositoryPath diff --git a/pkgs/development/compilers/go/setup-hook.sh b/pkgs/development/compilers/go/setup-hook.sh index 1b91c8312b88..7dce15eeb102 100644 --- a/pkgs/development/compilers/go/setup-hook.sh +++ b/pkgs/development/compilers/go/setup-hook.sh @@ -2,4 +2,4 @@ addToGoPath() { addToSearchPath GOPATH $1/share/go } -envHooks=(${envHooks[@]} addToGoPath) +addEnvHooks "$targetOffset" addToGoPath diff --git a/pkgs/development/compilers/haxe/setup-hook.sh b/pkgs/development/compilers/haxe/setup-hook.sh index 21cc0206859f..e6496107a5ee 100644 --- a/pkgs/development/compilers/haxe/setup-hook.sh +++ b/pkgs/development/compilers/haxe/setup-hook.sh @@ -4,4 +4,4 @@ addHaxeLibPath() { fi } -envHooks+=(addHaxeLibPath) +addEnvHooks "$targetOffset" addHaxeLibPath diff --git a/pkgs/development/compilers/sbcl/default.nix b/pkgs/development/compilers/sbcl/default.nix index b800d71198af..cd3120ed8312 100644 --- a/pkgs/development/compilers/sbcl/default.nix +++ b/pkgs/development/compilers/sbcl/default.nix @@ -91,7 +91,7 @@ stdenv.mkDerivation rec { # Specifying $SBCL_HOME is only truly needed with `purgeNixReferences = true`. setupHook = writeText "setupHook.sh" '' - envHooks+=(_setSbclHome) + addEnvHooks "$targetOffset" _setSbclHome _setSbclHome() { export SBCL_HOME='@out@/lib/sbcl/' } diff --git a/pkgs/development/idris-modules/build-idris-package.nix b/pkgs/development/idris-modules/build-idris-package.nix index 9dfa3430ed8b..66eddd0e3602 100644 --- a/pkgs/development/idris-modules/build-idris-package.nix +++ b/pkgs/development/idris-modules/build-idris-package.nix @@ -18,7 +18,8 @@ fi } - envHooks+=(addIdrisLibs) + # All run-time deps + addEnvHooks 0 addIdrisLibs ''; buildPhase = '' diff --git a/pkgs/development/idris-modules/with-packages.nix b/pkgs/development/idris-modules/with-packages.nix index d2b09808ec15..d4638670f699 100644 --- a/pkgs/development/idris-modules/with-packages.nix +++ b/pkgs/development/idris-modules/with-packages.nix @@ -14,7 +14,7 @@ fi } - envHooks+=(installIdrisLib) + envHostTargetHooks+=(installIdrisLib) ''; unpackPhase = '' diff --git a/pkgs/development/interpreters/elixir/setup-hook.sh b/pkgs/development/interpreters/elixir/setup-hook.sh index 2ed3b2e6454b..501eca3cf02a 100644 --- a/pkgs/development/interpreters/elixir/setup-hook.sh +++ b/pkgs/development/interpreters/elixir/setup-hook.sh @@ -2,4 +2,4 @@ addErlLibPath() { addToSearchPath ERL_LIBS $1/lib/elixir/lib } -envHooks+=(addErlLibPath) +addEnvHooks "$hostOffset" addErlLibPath diff --git a/pkgs/development/interpreters/erlang/setup-hook.sh b/pkgs/development/interpreters/erlang/setup-hook.sh index 68c0f762dfc5..3962d154ba9f 100644 --- a/pkgs/development/interpreters/erlang/setup-hook.sh +++ b/pkgs/development/interpreters/erlang/setup-hook.sh @@ -2,4 +2,4 @@ addErlangLibPath() { addToSearchPath ERL_LIBS $1/lib/erlang/lib } -envHooks+=(addErlangLibPath) +addEnvHooks "$hostOffset" addErlangLibPath diff --git a/pkgs/development/interpreters/guile/setup-hook-2.0.sh b/pkgs/development/interpreters/guile/setup-hook-2.0.sh index fd1dc944ed44..c7fb4f70fc6a 100644 --- a/pkgs/development/interpreters/guile/setup-hook-2.0.sh +++ b/pkgs/development/interpreters/guile/setup-hook-2.0.sh @@ -10,4 +10,4 @@ addGuileLibPath () { fi } -envHooks+=(addGuileLibPath) +addEnvHooks "$hostOffset" addGuileLibPath diff --git a/pkgs/development/interpreters/guile/setup-hook-2.2.sh b/pkgs/development/interpreters/guile/setup-hook-2.2.sh index 86c1e0d3e4a9..73e700bde026 100644 --- a/pkgs/development/interpreters/guile/setup-hook-2.2.sh +++ b/pkgs/development/interpreters/guile/setup-hook-2.2.sh @@ -10,4 +10,4 @@ addGuileLibPath () { fi } -envHooks+=(addGuileLibPath) +addEnvHooks "$hostOffset" addGuileLibPath diff --git a/pkgs/development/interpreters/guile/setup-hook.sh b/pkgs/development/interpreters/guile/setup-hook.sh index c1d19e579ed5..bf04fee1e893 100644 --- a/pkgs/development/interpreters/guile/setup-hook.sh +++ b/pkgs/development/interpreters/guile/setup-hook.sh @@ -5,4 +5,4 @@ addGuileLibPath () { fi } -envHooks+=(addGuileLibPath) +addEnvHooks "$hostOffset" addGuileLibPath diff --git a/pkgs/development/interpreters/jruby/default.nix b/pkgs/development/interpreters/jruby/default.nix index ff192c072865..2224a13ba7c0 100644 --- a/pkgs/development/interpreters/jruby/default.nix +++ b/pkgs/development/interpreters/jruby/default.nix @@ -36,7 +36,7 @@ jruby = stdenv.mkDerivation rec { addToSearchPath GEM_PATH \$1/${passthru.gemPath} } - envHooks+=(addGemPath) + addEnvHooks "$hostOffset" addGemPath EOF ''; diff --git a/pkgs/development/interpreters/perl/setup-hook.sh b/pkgs/development/interpreters/perl/setup-hook.sh index a8656b8531db..7909412806c8 100644 --- a/pkgs/development/interpreters/perl/setup-hook.sh +++ b/pkgs/development/interpreters/perl/setup-hook.sh @@ -2,4 +2,4 @@ addPerlLibPath () { addToSearchPath PERL5LIB $1/lib/perl5/site_perl } -envHooks+=(addPerlLibPath) +addEnvHooks "$hostOffset" addPerlLibPath diff --git a/pkgs/development/interpreters/python/setup-hook.sh b/pkgs/development/interpreters/python/setup-hook.sh index dda9bed39f85..3599478537e3 100644 --- a/pkgs/development/interpreters/python/setup-hook.sh +++ b/pkgs/development/interpreters/python/setup-hook.sh @@ -12,7 +12,7 @@ toPythonPath() { echo $result } -envHooks+=(addPythonPath) +addEnvHooks "$hostOffset" addPythonPath # Determinism: The interpreter is patched to write null timestamps when compiling python files. # This way python doesn't try to update them when we freeze timestamps in nix store. diff --git a/pkgs/development/interpreters/ruby/default.nix b/pkgs/development/interpreters/ruby/default.nix index d664c00bc31d..478c2b45b26e 100644 --- a/pkgs/development/interpreters/ruby/default.nix +++ b/pkgs/development/interpreters/ruby/default.nix @@ -142,7 +142,7 @@ let addToSearchPath GEM_PATH \$1/${passthru.gemPath} } - envHooks+=(addGemPath) + addEnvHooks "$hostOffset" addGemPath EOF '' + opString useRailsExpress '' rbConfig=$(find $out/lib/ruby -name rbconfig.rb) diff --git a/pkgs/development/libraries/SDL/setup-hook.sh b/pkgs/development/libraries/SDL/setup-hook.sh index 3696e743a07a..20382f18f529 100644 --- a/pkgs/development/libraries/SDL/setup-hook.sh +++ b/pkgs/development/libraries/SDL/setup-hook.sh @@ -4,8 +4,4 @@ addSDLPath () { fi } -if test -n "$crossConfig"; then - crossEnvHooks+=(addSDLPath) -else - envHooks+=(addSDLPath) -fi +addEnvHooks "$hostOffset" addSDLPath diff --git a/pkgs/development/libraries/SDL2/setup-hook.sh b/pkgs/development/libraries/SDL2/setup-hook.sh index 5a26440f37b3..3acce9d473c5 100644 --- a/pkgs/development/libraries/SDL2/setup-hook.sh +++ b/pkgs/development/libraries/SDL2/setup-hook.sh @@ -4,8 +4,4 @@ addSDL2Path () { fi } -if test -n "$crossConfig"; then - crossEnvHooks+=(addSDL2Path) -else - envHooks+=(addSDL2Path) -fi +addEnvHooks "$hostOffset" addSDL2Path diff --git a/pkgs/development/libraries/gdk-pixbuf/setup-hook.sh b/pkgs/development/libraries/gdk-pixbuf/setup-hook.sh index ba7ab82f50b4..5a7dcd792996 100644 --- a/pkgs/development/libraries/gdk-pixbuf/setup-hook.sh +++ b/pkgs/development/libraries/gdk-pixbuf/setup-hook.sh @@ -14,4 +14,4 @@ findGdkPixbufLoaders() { } -envHooks+=(findGdkPixbufLoaders) +addEnvHooks "$hostOffset" findGdkPixbufLoaders diff --git a/pkgs/development/libraries/glib/setup-hook.sh b/pkgs/development/libraries/glib/setup-hook.sh index c5cf293902cd..98341376fdf6 100644 --- a/pkgs/development/libraries/glib/setup-hook.sh +++ b/pkgs/development/libraries/glib/setup-hook.sh @@ -5,7 +5,7 @@ make_glib_find_gsettings_schemas() { addToSearchPath GSETTINGS_SCHEMAS_PATH "$1/share/gsettings-schemas/"* fi } -envHooks+=(make_glib_find_gsettings_schemas) +addEnvHooks "$hostOffset" make_glib_find_gsettings_schemas # Install gschemas, if any, in a package-specific directory glibPreInstallPhase() { diff --git a/pkgs/development/libraries/gobject-introspection/setup-hook.sh b/pkgs/development/libraries/gobject-introspection/setup-hook.sh index 583d8475ec3b..6d3488a6622d 100644 --- a/pkgs/development/libraries/gobject-introspection/setup-hook.sh +++ b/pkgs/development/libraries/gobject-introspection/setup-hook.sh @@ -11,7 +11,7 @@ make_gobject_introspection_find_gir_files() { fi } -envHooks+=(make_gobject_introspection_find_gir_files) +addEnvHooks "$hostOffset" make_gobject_introspection_find_gir_files _multioutMoveGlibGir() { moveToOutput share/gir-1.0 "${!outputDev}" diff --git a/pkgs/development/libraries/grantlee/5/setup-hook.sh b/pkgs/development/libraries/grantlee/5/setup-hook.sh index aaa64868dc94..b51cb4a31909 100644 --- a/pkgs/development/libraries/grantlee/5/setup-hook.sh +++ b/pkgs/development/libraries/grantlee/5/setup-hook.sh @@ -10,8 +10,4 @@ _grantleeEnvHook() { propagatedUserEnvPkgs+=" $1" fi } -if [ "$crossEnv" ]; then - crossEnvHooks+=(_grantleeEnvHook) -else - envHooks+=(_grantleeEnvHook) -fi +addEnvHooks "$hostOffset" _grantleeEnvHook diff --git a/pkgs/development/libraries/gstreamer/core/setup-hook.sh b/pkgs/development/libraries/gstreamer/core/setup-hook.sh index 3dd7812ece6d..b8c741af578f 100644 --- a/pkgs/development/libraries/gstreamer/core/setup-hook.sh +++ b/pkgs/development/libraries/gstreamer/core/setup-hook.sh @@ -5,5 +5,5 @@ addGstreamer1LibPath () { fi } -envHooks+=(addGstreamer1LibPath) +addEnvHooks "$hostOffset" addGstreamer1LibPath diff --git a/pkgs/development/libraries/gstreamer/legacy/gstreamer/setup-hook.sh b/pkgs/development/libraries/gstreamer/legacy/gstreamer/setup-hook.sh index e89aeda5bc1c..65ce26112519 100644 --- a/pkgs/development/libraries/gstreamer/legacy/gstreamer/setup-hook.sh +++ b/pkgs/development/libraries/gstreamer/legacy/gstreamer/setup-hook.sh @@ -5,4 +5,4 @@ addGstreamerLibPath () { fi } -envHooks+=(addGstreamerLibPath) +addEnvHooks "$hostOffset" addGstreamerLibPath diff --git a/pkgs/development/libraries/kde-frameworks/extra-cmake-modules/setup-hook.sh b/pkgs/development/libraries/kde-frameworks/extra-cmake-modules/setup-hook.sh index c1b1e21852cf..88091e78a0cd 100644 --- a/pkgs/development/libraries/kde-frameworks/extra-cmake-modules/setup-hook.sh +++ b/pkgs/development/libraries/kde-frameworks/extra-cmake-modules/setup-hook.sh @@ -2,7 +2,7 @@ _ecmEnvHook() { addToSearchPath XDG_DATA_DIRS "$1/share" addToSearchPath XDG_CONFIG_DIRS "$1/etc/xdg" } -envHooks+=(_ecmEnvHook) +addEnvHooks "$targetOffset" _ecmEnvHook _ecmPreConfigureHook() { # Because we need to use absolute paths here, we must set *all* the paths. diff --git a/pkgs/development/libraries/kde-frameworks/kdoctools/setup-hook.sh b/pkgs/development/libraries/kde-frameworks/kdoctools/setup-hook.sh index 5cfffbd622d1..2928d9b34dbe 100644 --- a/pkgs/development/libraries/kde-frameworks/kdoctools/setup-hook.sh +++ b/pkgs/development/libraries/kde-frameworks/kdoctools/setup-hook.sh @@ -2,4 +2,4 @@ addXdgData() { addToSearchPath XDG_DATA_DIRS "$1/share" } -envHooks+=(addXdgData) +addEnvHooks "$targetOffset" addXdgData diff --git a/pkgs/development/libraries/librep/setup-hook.sh b/pkgs/development/libraries/librep/setup-hook.sh index 420d63d6c513..4d875b693304 100644 --- a/pkgs/development/libraries/librep/setup-hook.sh +++ b/pkgs/development/libraries/librep/setup-hook.sh @@ -2,4 +2,4 @@ addRepDLLoadPath () { addToSearchPath REP_DL_LOAD_PATH $1/lib/rep } -envHooks+=(addRepDLLoadPath) +addEnvHooks "$hostOffset" addRepDLLoadPath diff --git a/pkgs/development/libraries/qt-5/hooks/qtbase-setup-hook.sh b/pkgs/development/libraries/qt-5/hooks/qtbase-setup-hook.sh index 8ec7eeda8aee..754a75cbef4f 100644 --- a/pkgs/development/libraries/qt-5/hooks/qtbase-setup-hook.sh +++ b/pkgs/development/libraries/qt-5/hooks/qtbase-setup-hook.sh @@ -42,11 +42,7 @@ qtEnvHook() { propagatedUserEnvPkgs+=" $1" fi } -if [ "$crossConfig" ]; then - crossEnvHooks+=(qtEnvHook) -else - envHooks+=(qtEnvHook) -fi +envHostTargetHooks+=(qtEnvHook) postPatchMkspecs() { local bin="${!outputBin}" diff --git a/pkgs/development/libraries/rep-gtk/setup-hook.sh b/pkgs/development/libraries/rep-gtk/setup-hook.sh index 420d63d6c513..4d875b693304 100644 --- a/pkgs/development/libraries/rep-gtk/setup-hook.sh +++ b/pkgs/development/libraries/rep-gtk/setup-hook.sh @@ -2,4 +2,4 @@ addRepDLLoadPath () { addToSearchPath REP_DL_LOAD_PATH $1/lib/rep } -envHooks+=(addRepDLLoadPath) +addEnvHooks "$hostOffset" addRepDLLoadPath diff --git a/pkgs/development/libraries/slib/setup-hook.sh b/pkgs/development/libraries/slib/setup-hook.sh index 62b72d6dc0ab..3c7e91e81886 100644 --- a/pkgs/development/libraries/slib/setup-hook.sh +++ b/pkgs/development/libraries/slib/setup-hook.sh @@ -10,4 +10,4 @@ addSlibPath () { fi } -envHooks+=(addSlibPath) +addEnvHooks "$hostOffset" addSlibPath diff --git a/pkgs/development/lisp-modules/clwrapper/setup-hook.sh b/pkgs/development/lisp-modules/clwrapper/setup-hook.sh index 7ac8c70d59f8..eb6052d58db5 100644 --- a/pkgs/development/lisp-modules/clwrapper/setup-hook.sh +++ b/pkgs/development/lisp-modules/clwrapper/setup-hook.sh @@ -31,7 +31,7 @@ collectNixLispLDLP () { export NIX_LISP_COMMAND NIX_LISP CL_SOURCE_REGISTRY NIX_LISP_ASDF -envHooks+=(addASDFPaths setLisp collectNixLispLDLP) +addEnvHooks "$targetOffset" addASDFPaths setLisp collectNixLispLDLP mkdir -p "$HOME"/.cache/common-lisp || HOME="$TMP/.temp-$USER-home" mkdir -p "$HOME"/.cache/common-lisp diff --git a/pkgs/development/ocaml-modules/eliom/setup-hook.sh b/pkgs/development/ocaml-modules/eliom/setup-hook.sh index 096d8f8bf635..9868ab93f791 100644 --- a/pkgs/development/ocaml-modules/eliom/setup-hook.sh +++ b/pkgs/development/ocaml-modules/eliom/setup-hook.sh @@ -2,4 +2,4 @@ addOcsigenDistilleryTemplate() { addToSearchPathWithCustomDelimiter : ELIOM_DISTILLERY_PATH $1/eliom-distillery-templates } -envHooks+=(addOcsigenDistilleryTemplate) +addEnvHooks "$hostOffset" addOcsigenDistilleryTemplate diff --git a/pkgs/development/ocaml-modules/ocamlmake/setup-hook.sh b/pkgs/development/ocaml-modules/ocamlmake/setup-hook.sh index a93a7250bebb..6d9504370165 100644 --- a/pkgs/development/ocaml-modules/ocamlmake/setup-hook.sh +++ b/pkgs/development/ocaml-modules/ocamlmake/setup-hook.sh @@ -2,4 +2,4 @@ addOcamlMakefile () { export OCAMLMAKEFILE="@out@/include/OCamlMakefile" } -envHooks+=(addOcamlMakefile) +addEnvHooks "$targetOffset" addOcamlMakefile diff --git a/pkgs/development/tools/build-managers/cmake/setup-hook.sh b/pkgs/development/tools/build-managers/cmake/setup-hook.sh index 614e00314212..a92d54b3f144 100755 --- a/pkgs/development/tools/build-managers/cmake/setup-hook.sh +++ b/pkgs/development/tools/build-managers/cmake/setup-hook.sh @@ -72,11 +72,7 @@ if [ -z "$dontUseCmakeConfigure" -a -z "$configurePhase" ]; then configurePhase=cmakeConfigurePhase fi -if [ -n "$crossConfig" ]; then - crossEnvHooks+=(addCMakeParams) -else - envHooks+=(addCMakeParams) -fi +addEnvHooks "$targetOffset" addCMakeParams makeCmakeFindLibs(){ isystem_seen= diff --git a/pkgs/development/tools/misc/automake/setup-hook.sh b/pkgs/development/tools/misc/automake/setup-hook.sh index 5cd8c6229f68..292632b7cbce 100644 --- a/pkgs/development/tools/misc/automake/setup-hook.sh +++ b/pkgs/development/tools/misc/automake/setup-hook.sh @@ -2,4 +2,4 @@ addAclocals () { addToSearchPathWithCustomDelimiter : ACLOCAL_PATH $1/share/aclocal } -envHooks+=(addAclocals) +addEnvHooks "$hostOffset" addAclocals diff --git a/pkgs/development/tools/misc/pkgconfig/setup-hook.sh b/pkgs/development/tools/misc/pkgconfig/setup-hook.sh index 1c153976a343..34a9b9f1173b 100644 --- a/pkgs/development/tools/misc/pkgconfig/setup-hook.sh +++ b/pkgs/development/tools/misc/pkgconfig/setup-hook.sh @@ -3,8 +3,4 @@ addPkgConfigPath () { addToSearchPath PKG_CONFIG_PATH $1/share/pkgconfig } -if test -n "$crossConfig"; then - crossEnvHooks+=(addPkgConfigPath) -else - envHooks+=(addPkgConfigPath) -fi +addEnvHooks "$targetOffset" addPkgConfigPath diff --git a/pkgs/development/tools/ocaml/findlib/default.nix b/pkgs/development/tools/ocaml/findlib/default.nix index 846546ae7699..186b78ce3f36 100644 --- a/pkgs/development/tools/ocaml/findlib/default.nix +++ b/pkgs/development/tools/ocaml/findlib/default.nix @@ -40,7 +40,7 @@ stdenv.mkDerivation rec { fi } - envHooks+=(addOCamlPath) + addEnvHooks "$targetOffset" addOCamlPath ''; meta = { diff --git a/pkgs/development/web/nodejs/setup-hook.sh b/pkgs/development/web/nodejs/setup-hook.sh index e1f4d9089f38..18368588c2af 100644 --- a/pkgs/development/web/nodejs/setup-hook.sh +++ b/pkgs/development/web/nodejs/setup-hook.sh @@ -2,4 +2,4 @@ addNodePath () { addToSearchPath NODE_PATH $1/lib/node_modules } -envHooks+=(addNodePath) +addEnvHooks "$hostOffset" addNodePath |