Update NuGet tooling

- Add officially supported RID for Linux and macOS
- Ensure reproducible builds with fixed image versions
- Add additional dependencies
- Add dirty workaround (for now) for macOS builds
This commit is contained in:
Lukas Dürrenberger committed 2023-06-09 19:48:52 +02:00
1 parent 39d7c47f04
commit fe8145e750
16 files changed
+401 -213

No files matched your search

+5
View File
@@ -33,8 +33,13 @@
# Build folders # Build folders
build/ build/
cmake-build-*/
# Cache/IDE folders # Cache/IDE folders
.cache/ .cache/
.vscode/ .vscode/
.idea/ .idea/
.vs/
# System files
.DS_Store
+4 -10
View File
@@ -1,13 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0"> <Project Sdk="Microsoft.NET.Sdk" ToolsVersion="16.0">
<PropertyGroup> <PropertyGroup>
<TargetFramework>netstandard1.0</TargetFramework> <TargetFramework>netstandard2.0</TargetFramework>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild> <GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<!-- Workaround to remove the NETStandard.Library NuGet reference without breaking everything --> <Version>2.5.2</Version>
<DisableImplicitFrameworkReferences>true</DisableImplicitFrameworkReferences>
<Version>2.5.1</Version>
<Authors>Laurent Gomila</Authors> <Authors>Laurent Gomila</Authors>
<PackageTags>sfml csfml</PackageTags> <PackageTags>sfml csfml</PackageTags>
<Copyright>Copyright © Laurent Gomila</Copyright> <Copyright>Copyright © Laurent Gomila</Copyright>
@@ -22,10 +19,7 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="all" /> <PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="all" />
<!-- Workaround to remove the NETStandard.Library NuGet reference without breaking everything -->
<PackageReference Include="NETStandard.Library" Version="1.6.1" PrivateAssets="all" />
</ItemGroup> </ItemGroup>
<PropertyGroup> <PropertyGroup>
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="16.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup> <PropertyGroup>
<CSFMLIgnoreAnyCPU>false</CSFMLIgnoreAnyCPU> <CSFMLIgnoreAnyCPU>false</CSFMLIgnoreAnyCPU>
</PropertyGroup> </PropertyGroup>
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="16.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Target Name="CSFMLAnyCPUError" Condition="$(CSFMLIgnoreAnyCPU) != true and $(Platform) == 'AnyCPU'" BeforeTargets="Build"> <Target Name="CSFMLAnyCPUError" Condition="$(CSFMLIgnoreAnyCPU) != true and $(Platform) == 'AnyCPU'" BeforeTargets="Build">
<Error Text="CSFML doesn't support 'Any CPU' on the .NET Framework. Consider switching to .NET Core. If this is not possible, change your platform to x64 or x86, or set the MSBuild property 'CSFMLIgnoreAnyCPU' to true and manually load the appropriate native library at runtime." /> <Error Text="CSFML doesn't support 'Any CPU' on the .NET Framework. Consider switching to .NET Core. If this is not possible, change your platform to x64 or x86, or set the MSBuild property 'CSFMLIgnoreAnyCPU' to true and manually load the appropriate native library at runtime." />
+11 -6
View File
@@ -19,17 +19,22 @@ All build scripts follow the same routine:
This generic script doesn't install any of its dependencies. As such, you must have cmake and make installed, as well as all [SFML Dependencies](https://www.sfml-dev.org/tutorials/2.5/compile-with-cmake.php#installing-dependencies) available to cmake. This generic script doesn't install any of its dependencies. As such, you must have cmake and make installed, as well as all [SFML Dependencies](https://www.sfml-dev.org/tutorials/2.5/compile-with-cmake.php#installing-dependencies) available to cmake.
* `build.macos.sh` * `build.macos.sh`
* A [Bash](https://www.gnu.org/software/bash/) script to build libraries for macOS. The [Runtime Identifier](https://docs.microsoft.com/en-us/dotnet/core/rid-catalog#macos-rids) of the macOS distribution must be specified as parameter to the script. * A [Bash](https://www.gnu.org/software/bash/) script to build libraries for macOS. The [Runtime Identifier](https://docs.microsoft.com/en-us/dotnet/core/rid-catalog#macos-rids) of the macOS distribution must be specified as parameter to the script. Latest macOS SDKs can be downloaded [here](https://github.com/phracker/MacOSX-SDKs/releases).
Currently supported RIDs are: Currently supported RIDs are:
* osx.10.15-x64 * `osx-x64` (uses macOS SDK 10.12)
* osx.11.0-x64 * `osx.11.0-x64`
* osx.11.0-arm64 (requires SFML 2.6) * `osx.11.0-arm64` (requires SFML 2.6)
* `build.docker.sh`, `build.docker.ps1` * `build.docker.sh`, `build.docker.ps1`
* A script to build the native libraries for a Linux distribution in a Docker container. If no RID is specified as a parameter, all supported RIDs will be built. Currently, the supported RIDs are: * A script to build the native libraries for a Linux distribution in a Docker container. If no RID is specified as a parameter, all supported RIDs will be built. Currently, the supported RIDs are:
* `alpine-x64` * `linux-x64` (uses Ubuntu)
* `linux-musl-x64` (uses Apline)
* `linux-arm` (uses Arm32v7 Ubuntu)
* `linux-arm64` (uses Arm64v8 Ubuntu )
* `alpine-x64`
* `debian-x64` (compatible with derivatives such as Ubuntu and Linux Mint) * `debian-x64` (compatible with derivatives such as Ubuntu and Linux Mint)
* `fedora-x64` * `ubuntu-x64`
* `fedora-x64`
* `pushnuget.ps1`, `pushnuget.sh` * `pushnuget.ps1`, `pushnuget.sh`
* A script to automatically build and push the NuGet package to nuget.org. Make sure that all the native libraries are in `CSFML/runtimes/` before running this. * A script to automatically build and push the NuGet package to nuget.org. Make sure that all the native libraries are in `CSFML/runtimes/` before running this.
+28 -7
View File
@@ -6,10 +6,11 @@ Param(
$ErrorActionPreference = "Stop" $ErrorActionPreference = "Stop"
if (-not $RID ) { if (-not $RID ) {
Write-Output "No RID specified, building all known RIDs" Write-Output "No RID specified, building all common RIDs"
./build.docker.ps1 "alpine-x64" ./build.docker.ps1 "linux-x64"
./build.docker.ps1 "debian-x64" ./build.docker.ps1 "linux-musl-x64"
./build.docker.ps1 "fedora-x64" ./build.docker.ps1 "linux-arm"
./build.docker.ps1 "linux-arm64"
exit exit
} }
@@ -18,15 +19,35 @@ $Shell = $null
switch ($RID) { switch ($RID) {
'alpine-x64' { 'alpine-x64' {
$Image = 'alpine' $Image = 'alpine:3.7'
$Shell = '/bin/sh' $Shell = '/bin/sh'
} }
'debian-x64' { 'debian-x64' {
$Image = 'debian' $Image = 'debian:bullseye'
$Shell = '/bin/bash'
}
'ubuntu-x64' {
$Image = 'ubuntu:22.04'
$Shell = '/bin/bash' $Shell = '/bin/bash'
} }
'fedora-x64' { 'fedora-x64' {
$Image = 'fedora' $Image = 'fedora:37'
$Shell = '/bin/bash'
}
'linux-x64' {
$Image = 'ubuntu:22.04'
$Shell = '/bin/bash'
}
'linux-musl-x64' {
$Image = 'alpine:3.15'
$Shell = '/bin/sh'
}
'linux-arm' {
$Image = 'arm32v7/ubuntu:22.04'
$Shell = '/bin/bash'
}
'linux-arm64' {
$Image = 'arm64v8/ubuntu:22.04'
$Shell = '/bin/bash' $Shell = '/bin/bash'
} }
Default { Default {
Regular → Executable
+230 -183
View File
@@ -1,183 +1,230 @@
#!/bin/bash #!/bin/bash
# Automatically exit on error # Automatically exit on error
set -e set -e
set -x
# ========================= #
# PRELUDE: A note on rpaths # # ========================= #
# ========================= # # PRELUDE: A note on rpaths #
# ========================= #
# Unlike Windows, macOS doesn't search the current directory by default when searching for shared libraries (.dylib)
# It only searches the system default directories (usually /lib and /usr/lib) and the paths in LD_LIBRARY_PATH # Unlike Windows, macOS doesn't search the current directory by default when searching for shared libraries (.dylib)
# It only searches the system default directories (usually /lib and /usr/lib) and the paths in LD_LIBRARY_PATH
# The .NET Runtime will find the CSFML library in its NuGet packages just fine, but that library will then request
# the OS for libsfml-(module).dylib, and the .NET Runtime will have no say in how that SFML library is found. # The .NET Runtime will find the CSFML library in its NuGet packages just fine, but that library will then request
# the OS for libsfml-(module).dylib, and the .NET Runtime will have no say in how that SFML library is found.
# Without SFML installed globally on the system, this will fail, causing the loading of CSFML to fail, causing the
# .NET Runtime to think the CSFML library doesn't exist or is invalid. # Without SFML installed globally on the system, this will fail, causing the loading of CSFML to fail, causing the
# .NET Runtime to think the CSFML library doesn't exist or is invalid.
# And so, we need to set the rpath of the CSFML library.
# The rpath is a special value embedded straight into a library that specifies to the OS a list of folders where # And so, we need to set the rpath of the CSFML library.
# other libraries that it references may be found. # The rpath is a special value embedded straight into a library that specifies to the OS a list of folders where
# $ORIGIN, a kind-of environment variable, can be used in rpath to point to the folder where the library currently is. # other libraries that it references may be found.
# To let the OS know that we intend to use $ORIGIN, we need to add the ORIGIN flag to our ELF with the -z origin # $ORIGIN, a kind-of environment variable, can be used in rpath to point to the folder where the library currently is.
# gcc linker option # To let the OS know that we intend to use $ORIGIN, we need to add the ORIGIN flag to our ELF with the -z origin
# gcc linker option
# Since CSFML and SFML will always be deployed on the same folder by NuGet, we just need to add an rpath to CSFML
# that points to $ORIGIN, causing the OS to search the current folder for SFML, without interference from .NET # Since CSFML and SFML will always be deployed on the same folder by NuGet, we just need to add an rpath to CSFML
# that points to $ORIGIN, causing the OS to search the current folder for SFML, without interference from .NET
# We also add the same rpath to SFML itself for future-proofing, in case we ever decide to ship some Linux SFML
# dependencies on the Native package. # We also add the same rpath to SFML itself for future-proofing, in case we ever decide to ship some Linux SFML
# dependencies on the Native package.
# You may need to `brew install coreutils` first for grealpath
# See supported RID at https://docs.microsoft.com/en-us/dotnet/core/rid-catalog # You may need to `brew install coreutils` first for grealpath
# See supported RID at https://docs.microsoft.com/en-us/dotnet/core/rid-catalog
# =================================================== #
# STEP 1: Setup all variables needed during the build # # =================================================== #
# =================================================== # # STEP 1: Setup all variables needed during the build #
# =================================================== #
if [[ -z "$1" ]]; then
echo "Please specify the platform Runtime Identifier as an argument to this script" if [[ -z "$1" ]]; then
exit 1 echo "Please specify the platform Runtime Identifier as an argument to this script"
fi exit 1
fi
echo "Please note that all SFML dependencies must be installed and available to cmake. SFML does not ship with its linux dependencies."
echo "Please note that all SFML dependencies must be installed and available to cmake. SFML does not ship with its linux dependencies."
RID="$1"
RID="$1"
SFMLBranch="2.5.x" # The branch or tag of the SFML repository to be cloned
CSFMLDir="$(grealpath "$(git rev-parse --show-toplevel)")" # The directory of the source code of CSFML SFMLBranch="2.5.x" # The branch or tag of the SFML repository to be cloned
CSFMLDir="$(grealpath "$(git rev-parse --show-toplevel)")" # The directory of the source code of CSFML
OutDir="./CSFML/runtimes/$RID/native" # The base directory of all CSFML modules, used to copy the final libraries
mkdir -p "$OutDir" OutDir="./CSFML/runtimes/$RID/native" # The base directory of all CSFML modules, used to copy the final libraries
OutDir="$(grealpath "$OutDir")" mkdir -p "$OutDir"
OutDir="$(grealpath "$OutDir")"
echo "Building $RID"
echo "Building $RID"
mkdir -p "Build"
pushd "Build" mkdir -p "Build"
pushd "Build"
# ================== #
# STEP 2: Clone SFML # # ================== #
# ================== # # STEP 2: Clone SFML #
# ================== #
if [[ ! -d "SFML/.git" ]]; then
echo "Cloning SFML" if [[ ! -d "SFML/.git" ]]; then
rm -rf "SFML" echo "Cloning SFML"
git clone --branch "$SFMLBranch" --depth 1 "https://github.com/SFML/SFML.git" "SFML" rm -rf "SFML"
fi git clone --branch "$SFMLBranch" --depth 1 "https://github.com/SFML/SFML.git" "SFML"
fi
SFMLDir="$(grealpath SFML)"
SFMLDir="$(grealpath SFML)"
# ================== #
# STEP 3: Build SFML # # ================== #
# ================== # # STEP 3: Build SFML #
# ================== #
rm -rf "$RID"
mkdir -p "$RID" rm -rf "$RID"
pushd "$RID" mkdir -p "$RID"
pushd "$RID"
echo "Building SFML"
mkdir -p SFML echo "Building SFML"
pushd SFML mkdir -p SFML
pushd SFML
SFMLBuiltDir="$(grealpath .)" # The directory where SFML was built to. Used later to direct cmake when building CSFML
SFMLBuiltDir="$(grealpath .)" # The directory where SFML was built to. Used later to direct cmake when building CSFML
mkdir -p lib
# The directory that contains the final SFML libraries mkdir -p lib
# Since linux libraries don't support static linking from a shared library, this is used to copy the # The directory that contains the final SFML libraries
# SFML shared libraries together with the CSFML shared libraries into SFML.Net # Since linux libraries don't support static linking from a shared library, this is used to copy the
SFMLLibDir="$(grealpath lib)" # SFML shared libraries together with the CSFML shared libraries into SFML.Net
SFMLLibDir="$(grealpath lib)"
if [ $RID == "osx.10.15-x64" ]; then
ARCHITECTURE="x86_64" if [ $RID == "osx-x64" ]; then
TARGET="10.15" ARCHITECTURE="x86_64"
SYSROOT="/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/" TARGET="10.12"
elif [ $RID == "osx.11.0-x64" ]; then SYSROOT="/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/"
ARCHITECTURE="x86_64" elif [ $RID == "osx.11.0-x64" ]; then
TARGET="11.0" ARCHITECTURE="x86_64"
SYSROOT="/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/" TARGET="11.0"
elif [ $RID == "osx.11.0-arm64" ]; then SYSROOT="/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.0.sdk/"
ARCHITECTURE="arm64" elif [ $RID == "osx.11.0-arm64" ]; then
TARGET="11.0" ARCHITECTURE="arm64"
SYSROOT="/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/" TARGET="11.0"
SYSROOT="/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.0.sdk/"
echo "Note: arm64 is only supported with SFML 2.6"
else echo "Note: arm64 is only supported with SFML 2.6"
echo "Unsupported RID provided. Use 'osx.10.15-x64', 'osx.11.0-x64' or 'osx.11.0-arm64'" else
exit 1 echo "Unsupported RID provided. Use 'osx.10.15-x64', 'osx.11.0-x64' or 'osx.11.0-arm64'"
fi exit 1
fi
cmake -E env \
cmake -G "Unix Makefiles" \ cmake -E env \
-D 'BUILD_SHARED_LIBS=ON' \ cmake -G "Unix Makefiles" \
-D 'CMAKE_BUILD_TYPE=Release' \ -D 'BUILD_SHARED_LIBS=ON' \
-D "CMAKE_OSX_ARCHITECTURES=$ARCHITECTURE" \ -D 'SFML_BUILD_FRAMEWORKS=OFF' \
-D "CMAKE_OSX_DEPLOYMENT_TARGET=$TARGET" \ -D 'CMAKE_BUILD_TYPE=Release' \
-D "CMAKE_OSX_SYSROOT=$SYSROOT" \ -D "CMAKE_OSX_ARCHITECTURES=$ARCHITECTURE" \
-D "CMAKE_LIBRARY_OUTPUT_DIRECTORY=$SFMLLibDir" \ -D "CMAKE_OSX_DEPLOYMENT_TARGET=$TARGET" \
-D 'CMAKE_BUILD_WITH_INSTALL_RPATH=ON' \ -D "CMAKE_OSX_SYSROOT=$SYSROOT" \
-D 'CMAKE_INSTALL_RPATH=@executable_path' \ -D "CMAKE_LIBRARY_OUTPUT_DIRECTORY=$SFMLLibDir" \
"$SFMLDir" -D 'CMAKE_BUILD_WITH_INSTALL_RPATH=ON' \
-D 'CMAKE_INSTALL_RPATH=@loader_path' \
cmake --build . --config Release -D "CMAKE_INSTALL_PREFIX=$SFMLLibDir" \
-D "SFML_DEPENDENCIES_INSTALL_PREFIX=$SFMLLibDir" \
popd # Pop SFML -D "SFML_MISC_INSTALL_PREFIX=$SFMLLibDir" \
"$SFMLDir"
# =================== #
# STEP 4: Build CSFML # cmake --build . --config Release --target install
# =================== #
popd # Pop SFML
echo "Building CSFML using SFML at $SFMLBuiltDir"
mkdir -p CSFML # =================== #
pushd CSFML # STEP 4: Build CSFML #
# =================== #
mkdir -p lib
CSFMLLibDir="$(realpath lib)" # The directory that contains the final CSFML libraries. Used to copy the result into SFML.Net echo "Building CSFML using SFML at $SFMLBuiltDir"
mkdir -p CSFML
cmake -E env \ pushd CSFML
cmake -G "Unix Makefiles" \
-D "SFML_DIR=$SFMLBuiltDir" \ mkdir -p lib
-D 'BUILD_SHARED_LIBS=ON' \ CSFMLLibDir="$(realpath lib)" # The directory that contains the final CSFML libraries. Used to copy the result into SFML.Net
-D 'CMAKE_BUILD_TYPE=Release' \
-D "CMAKE_OSX_ARCHITECTURES=$ARCHITECTURE" \ cmake -E env \
-D "CMAKE_OSX_DEPLOYMENT_TARGET=$TARGET" \ cmake -G "Unix Makefiles" \
-D "CMAKE_OSX_SYSROOT=$SYSROOT" \ -D "SFML_DIR=$SFMLBuiltDir" \
-D "CMAKE_LIBRARY_OUTPUT_DIRECTORY=$CSFMLLibDir" \ -D 'BUILD_SHARED_LIBS=ON' \
-D 'CMAKE_BUILD_WITH_INSTALL_RPATH=ON' \ -D 'CMAKE_BUILD_TYPE=Release' \
-D 'CMAKE_INSTALL_RPATH=@executable_path' \ -D "CMAKE_OSX_ARCHITECTURES=$ARCHITECTURE" \
"$CSFMLDir" -D "CMAKE_OSX_DEPLOYMENT_TARGET=$TARGET" \
cmake --build . --config Release -D "CMAKE_OSX_SYSROOT=$SYSROOT" \
-D "CMAKE_LIBRARY_OUTPUT_DIRECTORY=$CSFMLLibDir" \
# ======================================== # -D 'CMAKE_BUILD_WITH_INSTALL_RPATH=ON' \
# STEP 5: Copy result to the NuGet folders # -D 'CMAKE_INSTALL_RPATH=@loader_path' \
# ======================================== # -D "CMAKE_INSTALL_PREFIX=$CSFMLLibDir" \
-D "INSTALL_MISC_DIR=$CSFMLLibDir" \
# Copies one SFML and CSFML module into the NuGet package "$CSFMLDir"
# The module name must be passed to this function as an argument, in lowercase cmake --build . --config Release --target install
# This function then copies $SFMLLibDir/libsfml-(module).so and
# $CSFMLLibDir/libcsfml-(module).so into $OutDir # ============================ #
copymodule() # STEP 5: Fix RPATH references #
{ # ============================ #
MODULE="$1"
SFMLMajorMinor="2.5"
mkdir -p "$OutDir" SFMLMajorMinorPatch="$SFMLMajorMinor.1"
# Note the wildcard at the end of the first argument # SFML's framework dependencies will always reference @rpath/../Frameworks/<depedency>
# We are copying every versioned file here, not just the .dylib # Which is not where we place the frameworks and where SFML should look for them
# (libsfml-audio.dylib, libsfml-audio.2.dylib, libsfml-audio.2.5.dylib, etc) # This this fixes the dependency with install_name_tool
# This is needed because of the way macOS searches for libraries based fixrpath()
# one their SONAME {
cp "$SFMLLibDir/libsfml-$MODULE."* "$OutDir" MODULE="$1"
OLD="$2"
cp "$CSFMLLibDir/libcsfml-$MODULE."* "$OutDir" NEW="$3"
}
install_name_tool -change $OLD $NEW "$SFMLLibDir/libsfml-$MODULE.dylib"
copymodule audio install_name_tool -change $OLD $NEW "$SFMLLibDir/libsfml-$MODULE.$SFMLMajorMinor.dylib"
copymodule graphics install_name_tool -change $OLD $NEW "$SFMLLibDir/libsfml-$MODULE.$SFMLMajorMinorPatch.dylib"
copymodule system }
copymodule window
fixrpath audio "@rpath/../Frameworks/OpenAL.framework/Versions/A/OpenAL" "@rpath/OpenAL.framework/Versions/A/OpenAL"
popd # Pop CSFML fixrpath audio "@rpath/../Frameworks/vorbisenc.framework/Versions/A/vorbisenc" "@rpath/vorbisenc.framework/Versions/A/vorbisen"
popd # Pop $RID fixrpath audio "@rpath/../Frameworks/vorbisfile.framework/Versions/A/vorbisfile" "@rpath/vorbisfile.framework/Versions/A/vorbisfile"
popd # Pop Build fixrpath audio "@rpath/../Frameworks/vorbis.framework/Versions/A/vorbis" "@rpath/vorbis.framework/Versions/A/vorbis"
fixrpath audio "@rpath/../Frameworks/ogg.framework/Versions/A/ogg" "@rpath/ogg.framework/Versions/A/ogg"
fixrpath audio "@rpath/../Frameworks/FLAC.framework/Versions/A/FLAC" "@rpath/FLAC.framework/Versions/A/FLAC"
fixrpath graphics "@rpath/../Frameworks/freetype.framework/Versions/A/freetype" "@rpath/freetype.framework/Versions/A/freetype"
# ======================================== #
# STEP 6: Copy result to the NuGet folders #
# ======================================== #
CSFMLMajorMinor="2.5"
CSFMLMajorMinorPatch="$CSFMLMajorMinor.2"
# 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
# $CSFMLLibDir/libcsfml-(module).so into $OutDir
copymodule()
{
MODULE="$1"
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.5.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"
}
copymodule audio
copymodule graphics
copymodule system
copymodule window
cp -R "$SFMLLibDir/"*.framework "$OutDir"
popd # Pop CSFML
popd # Pop $RID
popd # Pop Build
+1
View File
@@ -10,6 +10,7 @@ apk add \
freetype-dev \ freetype-dev \
libx11-dev \ libx11-dev \
libxrandr-dev \ libxrandr-dev \
libxcursor-dev \
eudev-dev \ eudev-dev \
mesa-dev \ mesa-dev \
flac-dev \ flac-dev \
+1 -4
View File
@@ -10,15 +10,12 @@ apt-get install -y \
libfreetype6-dev \ libfreetype6-dev \
xorg-dev \ xorg-dev \
libxrandr-dev \ libxrandr-dev \
libxcursor-dev \
libudev-dev \ libudev-dev \
libgl1-mesa-dev \ libgl1-mesa-dev \
libflac-dev \ libflac-dev \
libogg-dev \ libogg-dev \
libvorbis-dev \ libvorbis-dev \
libvorbisenc2 \
libvorbisfile3 \
libopenal-dev \
libpthread-stubs0-dev \
cmake \ cmake \
g++ g++
+1
View File
@@ -8,6 +8,7 @@ dnf install -y \
freetype-devel \ freetype-devel \
xorg-x11-server-devel \ xorg-x11-server-devel \
libXrandr-devel \ libXrandr-devel \
libXcursor-devel \
systemd-devel \ systemd-devel \
mesa-libEGL-devel \ mesa-libEGL-devel \
flac-devel \ flac-devel \
+23
View File
@@ -0,0 +1,23 @@
#!/bin/bash
# Automatically exit on error
set -e
apt-get update
apt-get install -y \
git \
libfreetype6-dev \
xorg-dev \
libxrandr-dev \
libxcursor-dev \
libudev-dev \
libgl1-mesa-dev \
libflac-dev \
libogg-dev \
libvorbis-dev \
libopenal-dev \
cmake \
g++
./build.linux.sh linux-arm
+23
View File
@@ -0,0 +1,23 @@
#!/bin/bash
# Automatically exit on error
set -e
apt-get update
apt-get install -y \
git \
libfreetype6-dev \
xorg-dev \
libxrandr-dev \
libxcursor-dev \
libudev-dev \
libgl1-mesa-dev \
libflac-dev \
libogg-dev \
libvorbis-dev \
libopenal-dev \
cmake \
g++
./build.linux.sh linux-arm64
+25
View File
@@ -0,0 +1,25 @@
#!/bin/sh
# Alpine Linux doesn't come with bash by default, so we need to bootstrap everything with sh
# Automatically exit on error
set -e
apk add \
bash \
git \
freetype-dev \
libx11-dev \
libxrandr-dev \
libxcursor-dev \
eudev-dev \
mesa-dev \
flac-dev \
libogg-dev \
libvorbis-dev \
openal-soft-dev \
libpthread-stubs \
cmake \
make \
g++
./build.linux.sh linux-musl-x64
+23
View File
@@ -0,0 +1,23 @@
#!/bin/bash
# Automatically exit on error
set -e
apt-get update
apt-get install -y \
git \
libfreetype6-dev \
xorg-dev \
libxrandr-dev \
libxcursor-dev \
libudev-dev \
libgl1-mesa-dev \
libflac-dev \
libogg-dev \
libvorbis-dev \
libopenal-dev \
cmake \
g++
./build.linux.sh linux-x64
+23
View File
@@ -0,0 +1,23 @@
#!/bin/bash
# Automatically exit on error
set -e
apt-get update
apt-get install -y \
git \
libfreetype6-dev \
xorg-dev \
libxrandr-dev \
libxcursor-dev \
libudev-dev \
libgl1-mesa-dev \
libflac-dev \
libogg-dev \
libvorbis-dev \
libopenal-dev \
cmake \
g++
./build.linux.sh ubuntu-x64
+1 -1
View File
@@ -3,7 +3,7 @@ Param(
[string]$APIKey [string]$APIKey
) )
dotnet build -c Release dotnet pack -c Release
if ($LASTEXITCODE -ne 0) { if ($LASTEXITCODE -ne 0) {
Write-Error "Build failed" Write-Error "Build failed"
exit 1 exit 1