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.
This commit is contained in:
parent
a1cdc2011e
commit
046f091e0d
|
@ -60,7 +60,7 @@ stdenv.mkDerivation {
|
|||
fi
|
||||
}
|
||||
|
||||
envHooks=(''${envHooks[@]} addCoqPath)
|
||||
addEnvHooks "$targetOffset" addCoqPath
|
||||
'';
|
||||
|
||||
passthru = {
|
||||
|
|
|
@ -109,7 +109,7 @@ self = stdenv.mkDerivation {
|
|||
fi
|
||||
}
|
||||
|
||||
envHooks=(''${envHooks[@]} addCoqPath)
|
||||
addEnvHooks "$targetOffset" addCoqPath
|
||||
'';
|
||||
|
||||
preConfigure = ''
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
addRLibPath () {
|
||||
addToSearchPath R_LIBS_SITE $1/library
|
||||
if [[ -d "$1/library" ]]; then
|
||||
addToSearchPath R_LIBS_SITE "$1/library"
|
||||
fi
|
||||
}
|
||||
|
||||
envHooks+=(addRLibPath)
|
||||
addEnvHooks "$targetOffset" addRLibPath
|
||||
|
|
|
@ -4,4 +4,8 @@ addEmacsVars () {
|
|||
fi
|
||||
}
|
||||
|
||||
envHooks+=(addEmacsVars)
|
||||
# If this is for a wrapper derivation, emacs and the dependencies are all
|
||||
# run-time dependencies. If this is for precompiling packages into bytecode,
|
||||
# emacs is a compile-time dependency of the package.
|
||||
addEnvHooks "$targetOffset" addEmacsVars
|
||||
addEnvHooks "$targetOffset" addEmacsVars
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
addCVars () {
|
||||
gccWrapperOld_addCVars () {
|
||||
if test -d $1/include; then
|
||||
export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -isystem $1/include"
|
||||
fi
|
||||
|
@ -12,7 +12,7 @@ addCVars () {
|
|||
fi
|
||||
}
|
||||
|
||||
envHooks=(${envHooks[@]} addCVars)
|
||||
envBuildBuildHooks+=(gccWrapperOld_addCVars)
|
||||
|
||||
# Note: these come *after* $out in the PATH (see setup.sh).
|
||||
|
||||
|
|
|
@ -18,5 +18,5 @@ if [ -z "$libxmlHookDone" ]; then
|
|||
# xmllint and xsltproc from looking in /etc/xml/catalog.
|
||||
export XML_CATALOG_FILES
|
||||
if [ -z "$XML_CATALOG_FILES" ]; then XML_CATALOG_FILES=" "; fi
|
||||
envHooks+=(addXMLCatalogs)
|
||||
addEnvHooks "$hostOffset" addXMLCatalogs
|
||||
fi
|
||||
|
|
|
@ -10,4 +10,4 @@ addPkgToClassPath () {
|
|||
done
|
||||
}
|
||||
|
||||
envHooks+=(addPkgToClassPath)
|
||||
addEnvHooks "$targetOffset" addPkgToClassPath
|
||||
|
|
|
@ -2,4 +2,4 @@ setupDebugInfoDirs () {
|
|||
addToSearchPath NIX_DEBUG_INFO_DIRS $1/lib/debug
|
||||
}
|
||||
|
||||
envHooks+=(setupDebugInfoDirs)
|
||||
addEnvHooks "$targetOffset" setupDebugInfoDirs
|
||||
|
|
|
@ -6,7 +6,7 @@ find_gio_modules() {
|
|||
fi
|
||||
}
|
||||
|
||||
envHooks+=(find_gio_modules)
|
||||
addEnvHooks "$targetOffset" find_gio_modules
|
||||
|
||||
# Note: $gappsWrapperArgs still gets defined even if $dontWrapGApps is set.
|
||||
wrapGAppsHook() {
|
||||
|
|
|
@ -8,7 +8,8 @@ hicolorIconThemeHook() {
|
|||
|
||||
}
|
||||
|
||||
envHooks+=(hicolorIconThemeHook)
|
||||
# I think this is meant to be a runtime dep
|
||||
addEnvHooks "$hostOffset" hicolorIconThemeHook
|
||||
|
||||
# Remove icon cache
|
||||
hicolorPreFixupPhase() {
|
||||
|
|
|
@ -4,4 +4,4 @@ make_grilo_find_plugins() {
|
|||
fi
|
||||
}
|
||||
|
||||
envHooks+=(make_grilo_find_plugins)
|
||||
addEnvHooks "$hostOffset" make_grilo_find_plugins
|
||||
|
|
|
@ -74,4 +74,4 @@ addEnvVars() {
|
|||
addToSearchPath NIX_GNUSTEP_SYSTEM_DOC_INFO "$tmp"
|
||||
fi
|
||||
}
|
||||
envHooks=(${envHooks[@]} addEnvVars)
|
||||
addEnvHooks "$targetOffset" addEnvVars
|
||||
|
|
|
@ -4,4 +4,4 @@ addChickenRepositoryPath() {
|
|||
export CHICKEN_INCLUDE_PATH="$1/share;$CHICKEN_INCLUDE_PATH"
|
||||
}
|
||||
|
||||
envHooks=(${envHooks[@]} addChickenRepositoryPath)
|
||||
addEnvHooks "$targetOffset" addChickenRepositoryPath
|
||||
|
|
|
@ -2,4 +2,4 @@ addToGoPath() {
|
|||
addToSearchPath GOPATH $1/share/go
|
||||
}
|
||||
|
||||
envHooks=(${envHooks[@]} addToGoPath)
|
||||
addEnvHooks "$targetOffset" addToGoPath
|
||||
|
|
|
@ -4,4 +4,4 @@ addHaxeLibPath() {
|
|||
fi
|
||||
}
|
||||
|
||||
envHooks+=(addHaxeLibPath)
|
||||
addEnvHooks "$targetOffset" addHaxeLibPath
|
||||
|
|
|
@ -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/'
|
||||
}
|
||||
|
|
|
@ -18,7 +18,8 @@
|
|||
fi
|
||||
}
|
||||
|
||||
envHooks+=(addIdrisLibs)
|
||||
# All run-time deps
|
||||
addEnvHooks 0 addIdrisLibs
|
||||
'';
|
||||
|
||||
buildPhase = ''
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
fi
|
||||
}
|
||||
|
||||
envHooks+=(installIdrisLib)
|
||||
envHostTargetHooks+=(installIdrisLib)
|
||||
'';
|
||||
|
||||
unpackPhase = ''
|
||||
|
|
|
@ -2,4 +2,4 @@ addErlLibPath() {
|
|||
addToSearchPath ERL_LIBS $1/lib/elixir/lib
|
||||
}
|
||||
|
||||
envHooks+=(addErlLibPath)
|
||||
addEnvHooks "$hostOffset" addErlLibPath
|
||||
|
|
|
@ -2,4 +2,4 @@ addErlangLibPath() {
|
|||
addToSearchPath ERL_LIBS $1/lib/erlang/lib
|
||||
}
|
||||
|
||||
envHooks+=(addErlangLibPath)
|
||||
addEnvHooks "$hostOffset" addErlangLibPath
|
||||
|
|
|
@ -10,4 +10,4 @@ addGuileLibPath () {
|
|||
fi
|
||||
}
|
||||
|
||||
envHooks+=(addGuileLibPath)
|
||||
addEnvHooks "$hostOffset" addGuileLibPath
|
||||
|
|
|
@ -10,4 +10,4 @@ addGuileLibPath () {
|
|||
fi
|
||||
}
|
||||
|
||||
envHooks+=(addGuileLibPath)
|
||||
addEnvHooks "$hostOffset" addGuileLibPath
|
||||
|
|
|
@ -5,4 +5,4 @@ addGuileLibPath () {
|
|||
fi
|
||||
}
|
||||
|
||||
envHooks+=(addGuileLibPath)
|
||||
addEnvHooks "$hostOffset" addGuileLibPath
|
||||
|
|
|
@ -36,7 +36,7 @@ jruby = stdenv.mkDerivation rec {
|
|||
addToSearchPath GEM_PATH \$1/${passthru.gemPath}
|
||||
}
|
||||
|
||||
envHooks+=(addGemPath)
|
||||
addEnvHooks "$hostOffset" addGemPath
|
||||
EOF
|
||||
'';
|
||||
|
||||
|
|
|
@ -2,4 +2,4 @@ addPerlLibPath () {
|
|||
addToSearchPath PERL5LIB $1/lib/perl5/site_perl
|
||||
}
|
||||
|
||||
envHooks+=(addPerlLibPath)
|
||||
addEnvHooks "$hostOffset" addPerlLibPath
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -4,8 +4,4 @@ addSDLPath () {
|
|||
fi
|
||||
}
|
||||
|
||||
if test -n "$crossConfig"; then
|
||||
crossEnvHooks+=(addSDLPath)
|
||||
else
|
||||
envHooks+=(addSDLPath)
|
||||
fi
|
||||
addEnvHooks "$hostOffset" addSDLPath
|
||||
|
|
|
@ -4,8 +4,4 @@ addSDL2Path () {
|
|||
fi
|
||||
}
|
||||
|
||||
if test -n "$crossConfig"; then
|
||||
crossEnvHooks+=(addSDL2Path)
|
||||
else
|
||||
envHooks+=(addSDL2Path)
|
||||
fi
|
||||
addEnvHooks "$hostOffset" addSDL2Path
|
||||
|
|
|
@ -14,4 +14,4 @@ findGdkPixbufLoaders() {
|
|||
|
||||
}
|
||||
|
||||
envHooks+=(findGdkPixbufLoaders)
|
||||
addEnvHooks "$hostOffset" findGdkPixbufLoaders
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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}"
|
||||
|
|
|
@ -10,8 +10,4 @@ _grantleeEnvHook() {
|
|||
propagatedUserEnvPkgs+=" $1"
|
||||
fi
|
||||
}
|
||||
if [ "$crossEnv" ]; then
|
||||
crossEnvHooks+=(_grantleeEnvHook)
|
||||
else
|
||||
envHooks+=(_grantleeEnvHook)
|
||||
fi
|
||||
addEnvHooks "$hostOffset" _grantleeEnvHook
|
||||
|
|
|
@ -5,5 +5,5 @@ addGstreamer1LibPath () {
|
|||
fi
|
||||
}
|
||||
|
||||
envHooks+=(addGstreamer1LibPath)
|
||||
addEnvHooks "$hostOffset" addGstreamer1LibPath
|
||||
|
||||
|
|
|
@ -5,4 +5,4 @@ addGstreamerLibPath () {
|
|||
fi
|
||||
}
|
||||
|
||||
envHooks+=(addGstreamerLibPath)
|
||||
addEnvHooks "$hostOffset" addGstreamerLibPath
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -2,4 +2,4 @@ addXdgData() {
|
|||
addToSearchPath XDG_DATA_DIRS "$1/share"
|
||||
}
|
||||
|
||||
envHooks+=(addXdgData)
|
||||
addEnvHooks "$targetOffset" addXdgData
|
||||
|
|
|
@ -2,4 +2,4 @@ addRepDLLoadPath () {
|
|||
addToSearchPath REP_DL_LOAD_PATH $1/lib/rep
|
||||
}
|
||||
|
||||
envHooks+=(addRepDLLoadPath)
|
||||
addEnvHooks "$hostOffset" addRepDLLoadPath
|
||||
|
|
|
@ -42,11 +42,7 @@ qtEnvHook() {
|
|||
propagatedUserEnvPkgs+=" $1"
|
||||
fi
|
||||
}
|
||||
if [ "$crossConfig" ]; then
|
||||
crossEnvHooks+=(qtEnvHook)
|
||||
else
|
||||
envHooks+=(qtEnvHook)
|
||||
fi
|
||||
envHostTargetHooks+=(qtEnvHook)
|
||||
|
||||
postPatchMkspecs() {
|
||||
local bin="${!outputBin}"
|
||||
|
|
|
@ -2,4 +2,4 @@ addRepDLLoadPath () {
|
|||
addToSearchPath REP_DL_LOAD_PATH $1/lib/rep
|
||||
}
|
||||
|
||||
envHooks+=(addRepDLLoadPath)
|
||||
addEnvHooks "$hostOffset" addRepDLLoadPath
|
||||
|
|
|
@ -10,4 +10,4 @@ addSlibPath () {
|
|||
fi
|
||||
}
|
||||
|
||||
envHooks+=(addSlibPath)
|
||||
addEnvHooks "$hostOffset" addSlibPath
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -2,4 +2,4 @@ addOcsigenDistilleryTemplate() {
|
|||
addToSearchPathWithCustomDelimiter : ELIOM_DISTILLERY_PATH $1/eliom-distillery-templates
|
||||
}
|
||||
|
||||
envHooks+=(addOcsigenDistilleryTemplate)
|
||||
addEnvHooks "$hostOffset" addOcsigenDistilleryTemplate
|
||||
|
|
|
@ -2,4 +2,4 @@ addOcamlMakefile () {
|
|||
export OCAMLMAKEFILE="@out@/include/OCamlMakefile"
|
||||
}
|
||||
|
||||
envHooks+=(addOcamlMakefile)
|
||||
addEnvHooks "$targetOffset" addOcamlMakefile
|
||||
|
|
|
@ -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=
|
||||
|
|
|
@ -2,4 +2,4 @@ addAclocals () {
|
|||
addToSearchPathWithCustomDelimiter : ACLOCAL_PATH $1/share/aclocal
|
||||
}
|
||||
|
||||
envHooks+=(addAclocals)
|
||||
addEnvHooks "$hostOffset" addAclocals
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -40,7 +40,7 @@ stdenv.mkDerivation rec {
|
|||
fi
|
||||
}
|
||||
|
||||
envHooks+=(addOCamlPath)
|
||||
addEnvHooks "$targetOffset" addOCamlPath
|
||||
'';
|
||||
|
||||
meta = {
|
||||
|
|
|
@ -2,4 +2,4 @@ addNodePath () {
|
|||
addToSearchPath NODE_PATH $1/lib/node_modules
|
||||
}
|
||||
|
||||
envHooks+=(addNodePath)
|
||||
addEnvHooks "$hostOffset" addNodePath
|
||||
|
|
|
@ -39,4 +39,4 @@ useSystemCoreFoundationFramework () {
|
|||
export NIX_COREFOUNDATION_RPATH=/System/Library/Frameworks
|
||||
}
|
||||
|
||||
envHooks+=(useSystemCoreFoundationFramework)
|
||||
addEnvHooks "$hostOffset" useSystemCoreFoundationFramework
|
||||
|
|
|
@ -7,4 +7,4 @@ noDeprecatedDeclarations() {
|
|||
fi
|
||||
}
|
||||
|
||||
envHooks+=(noDeprecatedDeclarations)
|
||||
addEnvHooks "$hostOffset" noDeprecatedDeclarations
|
||||
|
|
|
@ -18,5 +18,5 @@ if test -z "$sgmlHookDone"; then
|
|||
export ftp_proxy=http://nodtd.invalid/
|
||||
|
||||
export SGML_CATALOG_FILES
|
||||
envHooks+=(addSGMLCatalogs)
|
||||
addEnvHooks "$targetOffset" addSGMLCatalogs
|
||||
fi
|
||||
|
|
|
@ -4,4 +4,4 @@ addTeXMFPath () {
|
|||
fi
|
||||
}
|
||||
|
||||
envHooks+=(addTeXMFPath)
|
||||
addEnvHooks "$targetOffset" addTeXMFPath
|
||||
|
|
|
@ -4,4 +4,4 @@ addTeXMFPath () {
|
|||
fi
|
||||
}
|
||||
|
||||
envHooks+=(addTeXMFPath)
|
||||
addEnvHooks "$targetOffset" addTeXMFPath
|
||||
|
|
Loading…
Reference in New Issue