diff --git a/pkgs/build-support/cc-wrapper/default.nix b/pkgs/build-support/cc-wrapper/default.nix index 9bb07456e8f2..058b2d7a2dec 100644 --- a/pkgs/build-support/cc-wrapper/default.nix +++ b/pkgs/build-support/cc-wrapper/default.nix @@ -603,7 +603,7 @@ stdenvNoCC.mkDerivation { installPhase = if targetPlatform.isCygwin then '' - echo addToSearchPath "LINK_DLL_FOLDERS" "${cc_bin}/lib" >> $out + echo addToSearchPath "HOST_PATH" "${cc_bin}/lib" >> $out # Work around build failure caused by the gnulib workaround for # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114870. remove after # gnulib is updated in core packages (e.g. iconv, gnupatch, gnugrep) diff --git a/pkgs/os-specific/cygwin/cygwin-dll-link-hook/cygwin-dll-link.sh b/pkgs/os-specific/cygwin/cygwin-dll-link-hook/cygwin-dll-link.sh index 2fddfc349b94..6fe69347861e 100644 --- a/pkgs/os-specific/cygwin/cygwin-dll-link-hook/cygwin-dll-link.sh +++ b/pkgs/os-specific/cygwin/cygwin-dll-link-hook/cygwin-dll-link.sh @@ -1,21 +1,20 @@ # shellcheck shell=bash -addLinkDLLPaths() { - addToSearchPath "LINK_DLL_FOLDERS" "$1/lib" - addToSearchPath "LINK_DLL_FOLDERS" "$1/bin" +_moveDLLsToLib() { + if [[ "${dontMoveDLLsToLib-}" ]]; then return; fi + # shellcheck disable=SC2154 + moveToOutput "bin/*.dll" "${!outputLib}" } -# shellcheck disable=SC2154 -addEnvHooks "$targetOffset" addLinkDLLPaths +preFixupHooks+=(_moveDLLsToLib) addOutputDLLPaths() { for output in $(getAllOutputNames); do - addToSearchPath "LINK_DLL_FOLDERS" "${!output}/lib" - addToSearchPath "LINK_DLL_FOLDERS" "${!output}/bin" + addToSearchPath "HOST_PATH" "${!output}/bin" done } -postInstallHooks+=(addOutputDLLPaths) +preFixupHooks+=(addOutputDLLPaths) _dllDeps() { @objdump@ -p "$1" \ @@ -35,13 +34,13 @@ _linkDeps() { CYGWIN+=\ winsymlinks:nativestrict ln -sr /bin/cygwin1.dll "$dir" continue fi - # Locate the DLL - it should be an *executable* file on $LINK_DLL_FOLDERS. + # Locate the DLL - it should be an *executable* file on $HOST_PATH. local dllPath - if ! dllPath="$(PATH="$(dirname "$target"):$LINK_DLL_FOLDERS" type -P "$dll")"; then + if ! dllPath="$(PATH="$(dirname "$target"):$HOST_PATH" type -P "$dll")"; then if [[ -z "$check" || -n "${allowedImpureDLLsMap[$dll]}" ]]; then continue fi - echo unable to find "$dll" in "$LINK_DLL_FOLDERS" >&2 + echo unable to find "$dll" in "$HOST_PATH" >&2 exit 1 fi echo ' linking to:' "$dllPath"