diff --git a/tools/nuget/CSFML/build/netstandard2.0/CSFML.props b/tools/nuget/CSFML/build/netstandard2.0/CSFML.props index 5eb29a4..8eb1468 100644 --- a/tools/nuget/CSFML/build/netstandard2.0/CSFML.props +++ b/tools/nuget/CSFML/build/netstandard2.0/CSFML.props @@ -2,5 +2,7 @@ true + + NETSDK1206 diff --git a/tools/nuget/build.linux.sh b/tools/nuget/build.linux.sh index 45835e0..1b3ba43 100755 --- a/tools/nuget/build.linux.sh +++ b/tools/nuget/build.linux.sh @@ -127,6 +127,9 @@ cmake --build . --config Release # STEP 5: Copy result to the NuGet folders # # ======================================== # +SFMLMajorMinor="2.6" +CSFMLMajorMinor="2.6" + # Copies one SFML and CSFML module into the NuGet package # The module name must be passed to this function as an argument, in lowercase # This function then copies $SFMLLibDir/libsfml-(module).so and @@ -137,14 +140,15 @@ copymodule() mkdir -p "$OutDir" - # Note the wildcard at the end of the first argument - # We are copying every versioned file here, not just the .so - # (libsfml-audio.so, libsfml-audio.so.2, libsfml-audio.so.2.6, etc) - # This is needed because of the way linux searches for libraries based - # one their SONAME - cp "$SFMLLibDir/libsfml-$MODULE.so"* "$OutDir" - + # SFML.Net only searches for the name with common pre- and suffixes + # As such we need to ship e.g. libcsfml-graphics.so + # But the CSFML libs will look for the major.minor version + # As such we also need to ship e.g. libcsfml-graphics.so.2.6 + # Unfortunately NuGet package don't support symlinks: https://github.com/NuGet/Home/issues/10734 + # For SFML, we can just ship one version that CSFML will be looking for + cp "$SFMLLibDir/libsfml-$MODULE.so.$SFMLMajorMinor" "$OutDir" cp "$CSFMLLibDir/libcsfml-$MODULE.so" "$OutDir" + cp "$CSFMLLibDir/libcsfml-$MODULE.so.$CSFMLMajorMinor" "$OutDir" } copymodule audio diff --git a/tools/nuget/build.macos.sh b/tools/nuget/build.macos.sh index 7ef4ac2..74db613 100755 --- a/tools/nuget/build.macos.sh +++ b/tools/nuget/build.macos.sh @@ -193,19 +193,15 @@ copymodule() mkdir -p "$OutDir" - # Note the wildcard at the end of the first argument - # We are copying every versioned file here, not just the .dylib - # (libsfml-audio.dylib, libsfml-audio.2.dylib, libsfml-audio.2.6.dylib, etc) - # This is needed because of the way macOS searches for libraries based - # one their SONAME - cp "$SFMLLibDir/libsfml-$MODULE."* "$OutDir" - - cp "$CSFMLLibDir/libcsfml-$MODULE."* "$OutDir" - - # Fix naming for expected filename - mv "$OutDir/libcsfml-$MODULE.dylib" "$OutDir/libcsfml-$MODULE" - mv "$OutDir/libcsfml-$MODULE.$CSFMLMajorMinor.dylib" "$OutDir/libcsfml-$MODULE.$CSFMLMajorMinor" - mv "$OutDir/libcsfml-$MODULE.$CSFMLMajorMinorPatch.dylib" "$OutDir/libcsfml-$MODULE.$CSFMLMajorMinorPatch" + # SFML.Net only searches for the name with common pre- and suffixes + # As such we need to ship e.g. libcsfml-graphics.dylib + # But the CSFML libs will look for the major.minor version + # As such we also need to ship e.g. libcsfml-graphics.2.6.dylib + # Unfortunately NuGet package don't support symlinks: https://github.com/NuGet/Home/issues/10734 + # For SFML, we can just ship one version that CSFML will be looking for + cp "$SFMLLibDir/libsfml-$MODULE.$SFMLMajorMinor.dylib" "$OutDir" + cp "$CSFMLLibDir/libcsfml-$MODULE.dylib" "$OutDir" + cp "$CSFMLLibDir/libcsfml-$MODULE.$CSFMLMajorMinor.dylib" "$OutDir" } copymodule audio