Unverified Commit 2ae0ffc6 authored by David McFarland's avatar David McFarland Committed by GitHub
Browse files

Merge pull request #320851 from tie/dotnet-cross

buildDotnetModule: convert makeWrapperArgs to an array
parents fcd58516 4caf9a61
Loading
Loading
Loading
Loading
+10 −3
Original line number Diff line number Diff line
# For compatibility, convert makeWrapperArgs to an array unless we are using
# structured attributes. That is, we ensure that makeWrapperArgs is always an
# array.
# See https://github.com/NixOS/nixpkgs/blob/858f4db3048c5be3527e183470e93c1a72c5727c/pkgs/build-support/dotnet/build-dotnet-module/hooks/dotnet-fixup-hook.sh#L1-L3
# and https://github.com/NixOS/nixpkgs/pull/313005#issuecomment-2175482920
if [[ -z $__structuredAttrs ]]; then
    makeWrapperArgs=( ${makeWrapperArgs-} )
fi

# First argument is the executable you want to wrap,
# the second is the destination for the wrapper.
wrapDotnetProgram() {
@@ -17,10 +26,8 @@ dotnetFromEnv'

    if [[ -n $__structuredAttrs ]]; then
        local -r dotnetRuntimeDepsArray=( "${dotnetRuntimeDeps[@]}" )
        local -r makeWrapperArgsArray=( "${makeWrapperArgs[@]}" )
    else
        local -r dotnetRuntimeDepsArray=($dotnetRuntimeDeps)
        local -r makeWrapperArgsArray=($makeWrapperArgs)
    fi

    local dotnetRuntimeDepsFlags=()
@@ -49,7 +56,7 @@ dotnetFromEnv'
        "${dotnetRuntimeDepsFlags[@]}" \
        "${dotnetRootFlagsArray[@]}" \
        "${gappsWrapperArgs[@]}" \
        "${makeWrapperArgsArray[@]}"
        "${makeWrapperArgs[@]}"

    echo "installed wrapper to "$2""
}