diff --git a/pkgs/development/libraries/glib/setup-hook.sh b/pkgs/development/libraries/glib/setup-hook.sh index 9eabf8a679a9b..40336f2972836 100644 --- a/pkgs/development/libraries/glib/setup-hook.sh +++ b/pkgs/development/libraries/glib/setup-hook.sh @@ -14,7 +14,7 @@ glibPreInstallPhase() { } appendToVar preInstallPhases glibPreInstallPhase -glibPreFixupPhase() { +glibPostInstallHook() { # Move gschemas in case the install flag didn't help if [ -d "$prefix/share/glib-2.0/schemas" ]; then mkdir -p "${!outputLib}/share/gsettings-schemas/$name/glib-2.0" @@ -25,10 +25,7 @@ glibPreFixupPhase() { } # gappsWrapperArgsHook expects GSETTINGS_SCHEMAS_PATH variable to be set by this. -# Until we have dependency mechanism in generic builder, we need to use this ugly hack. -if [[ " ${preFixupPhases:-} " =~ " gappsWrapperArgsHook " ]]; then - preFixupPhases+=" " - preFixupPhases="${preFixupPhases/ gappsWrapperArgsHook / glibPreFixupPhase gappsWrapperArgsHook }" -else - preFixupPhases+=" glibPreFixupPhase" -fi +# Until we have dependency mechanism in generic builder, we need to use this hack. +# This relies on the fact that postInstallHooks are run *after* postInstall passed to +# mkDerivation. +postInstallHooks+=(glibPostInstallHook) diff --git a/pkgs/development/libraries/gobject-introspection/setup-hook.sh b/pkgs/development/libraries/gobject-introspection/setup-hook.sh index 50571a8f914d1..ee048867a278e 100644 --- a/pkgs/development/libraries/gobject-introspection/setup-hook.sh +++ b/pkgs/development/libraries/gobject-introspection/setup-hook.sh @@ -19,13 +19,8 @@ giDiscoverSelf() { } # gappsWrapperArgsHook expects GI_TYPELIB_PATH variable to be set by this. -# Until we have dependency mechanism in generic builder, we need to use this ugly hack. -if [[ " ${preFixupPhases:-} " =~ " gappsWrapperArgsHook " ]]; then - preFixupPhases+=" " - preFixupPhases="${preFixupPhases/ gappsWrapperArgsHook / giDiscoverSelf gappsWrapperArgsHook }" -else - preFixupPhases+=" giDiscoverSelf" -fi +# Until we have dependency mechanism in generic builder, we need to use this hack. +postInstallHooks+=(giDiscoverSelf) _multioutMoveGlibGir() { moveToOutput share/gir-1.0 "${!outputDev}" diff --git a/pkgs/development/python-modules/pytest-forked/setup-hook.sh b/pkgs/development/python-modules/pytest-forked/setup-hook.sh index 0eff690e9079e..88ccd0aac171b 100644 --- a/pkgs/development/python-modules/pytest-forked/setup-hook.sh +++ b/pkgs/development/python-modules/pytest-forked/setup-hook.sh @@ -12,21 +12,7 @@ pytestForkedHook() { fi } -# the flags should be added before pytestCheckHook runs so -# until we have dependency mechanism in generic builder, we need to use this ugly hack. - if [ -z "${dontUsePytestForked-}" ] && [ -z "${dontUsePytestCheck-}" ]; then - if [[ " ${preDistPhases[*]:-} " =~ " pytestCheckPhase " ]]; then - _preDistPhases="${preDistPhases[*]} " - _preDistPhases="${_preDistPhases/ pytestCheckPhase / pytestForkedHook pytestCheckPhase }" - if [[ -n "${__structuredAttrs-}" ]]; then - preDistPhases=() - else - preDistPhases="" - fi - appendToVar preDistPhases $_preDistPhases - unset _preDistPhases - else - appendToVar preDistPhases pytestForkedHook - fi + # The flags should be added before pytestCheckHook runs in preDistPhases. + postInstallCheckHooks+=(pytestForkedHook) fi diff --git a/pkgs/development/python-modules/pytest-xdist/setup-hook.sh b/pkgs/development/python-modules/pytest-xdist/setup-hook.sh index 9819e0d3ec7d2..8600ce998acc4 100644 --- a/pkgs/development/python-modules/pytest-xdist/setup-hook.sh +++ b/pkgs/development/python-modules/pytest-xdist/setup-hook.sh @@ -4,21 +4,7 @@ pytestXdistHook() { ) } -# the flags should be added before pytestCheckHook runs so -# until we have dependency mechanism in generic builder, we need to use this ugly hack. - if [ -z "${dontUsePytestXdist-}" ] && [ -z "${dontUsePytestCheck-}" ]; then - if [[ " ${preDistPhases[*]:-} " =~ " pytestCheckPhase " ]]; then - _preDistPhases="${preDistPhases[*]} " - _preDistPhases="${_preDistPhases/ pytestCheckPhase / pytestXdistHook pytestCheckPhase }" - if [[ -n "${__structuredAttrs-}" ]]; then - preDistPhases=() - else - preDistPhases="" - fi - appendToVar preDistPhases $_preDistPhases - unset _preDistPhases - else - appendToVar preDistPhases pytestXdistHook - fi + # The flags should be added before pytestCheckHook runs in preDistPhases. + preInstallCheckHooks+=(pytestXdistHook) fi