buildDotnetModule: properly inherit arguments from drv

Previously buildDotnetModule did not properly inherit some arguments from
derivations, take for example this expression:

dotnetFlags = [
    "--runtime linux-x64"
];

It would error out as follows: "MSBUILD : error MSB1001: Unknown switch.".
Setting the same flag from bash would work fine. This fixes that, all
arguments should now be properly interpreted :)
main
= 2 years ago committed by Jonathan Ringer
parent f69de108fb
commit f0af1ef49c
  1. 3
      pkgs/build-support/dotnet/build-dotnet-module/hooks/dotnet-build-hook.sh
  2. 3
      pkgs/build-support/dotnet/build-dotnet-module/hooks/dotnet-check-hook.sh
  3. 6
      pkgs/build-support/dotnet/build-dotnet-module/hooks/dotnet-configure-hook.sh
  4. 9
      pkgs/build-support/dotnet/build-dotnet-module/hooks/dotnet-fixup-hook.sh
  5. 3
      pkgs/build-support/dotnet/build-dotnet-module/hooks/dotnet-install-hook.sh

@ -1,4 +1,5 @@
declare -a projectFile testProjectFile dotnetBuildFlags dotnetFlags
# inherit arguments from derivation
dotnetBuildFlags=( ${dotnetBuildFlags[@]-} )
dotnetBuildHook() {
echo "Executing dotnetBuildHook"

@ -1,4 +1,5 @@
declare -a testProjectFile dotnetTestFlags dotnetFlags
# inherit arguments from derivation
dotnetTestFlags=( ${dotnetTestFlags[@]-} )
dotnetCheckHook() {
echo "Executing dotnetCheckHook"

@ -1,4 +1,8 @@
declare -a projectFile testProjectFile dotnetRestoreFlags dotnetFlags
declare -a projectFile testProjectFile
# inherit arguments from derivation
dotnetFlags=( ${dotnetFlags[@]-} )
dotnetRestoreFlags=( ${dotnetRestoreFlags[@]-} )
dotnetConfigureHook() {
echo "Executing dotnetConfigureHook"

@ -1,4 +1,5 @@
declare -a makeWrapperArgs gappsWrapperArgs
# Inherit arguments from the derivation
makeWrapperArgs=( ${makeWrapperArgs-} )
# First argument is the executable you want to wrap,
# the second is the destination for the wrapper.
@ -15,9 +16,9 @@ wrapDotnetProgram() {
dotnetFixupHook() {
echo "Executing dotnetFixupPhase"
if [ "${executables-}" ]; then
if [ "${executables}" ]; then
for executable in ${executables[@]}; do
execPath="$out/lib/${pname-}/$executable"
execPath="$out/lib/${pname}/$executable"
if [[ -f "$execPath" && -x "$execPath" ]]; then
wrapDotnetProgram "$execPath" "$out/bin/$(basename "$executable")"
@ -27,7 +28,7 @@ dotnetFixupHook() {
fi
done
else
for executable in $out/lib/${pname-}/*; do
for executable in $out/lib/${pname}/*; do
if [[ -f "$executable" && -x "$executable" && "$executable" != *"dll"* ]]; then
wrapDotnetProgram "$executable" "$out/bin/$(basename "$executable")"
fi

@ -1,4 +1,5 @@
declare -a projectFile dotnetInstallFlags dotnetFlags
# inherit arguments from derivation
dotnetInstallFlags=( ${dotnetInstallFlags[@]-} )
dotnetInstallHook() {
echo "Executing dotnetInstallHook"

Loading…
Cancel
Save