Skip to content

Commit fe8145e

Browse files
committed
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
1 parent 39d7c47 commit fe8145e

16 files changed

+401
-213
lines changed

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,13 @@
3333

3434
# Build folders
3535
build/
36+
cmake-build-*/
3637

3738
# Cache/IDE folders
3839
.cache/
3940
.vscode/
4041
.idea/
42+
.vs/
43+
44+
# System files
45+
.DS_Store

tools/nuget/CSFML/CSFML.csproj

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
1-
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0">
1+
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="16.0">
22

33
<PropertyGroup>
4-
<TargetFramework>netstandard1.0</TargetFramework>
4+
<TargetFramework>netstandard2.0</TargetFramework>
55
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
66

7-
<!-- Workaround to remove the NETStandard.Library NuGet reference without breaking everything -->
8-
<DisableImplicitFrameworkReferences>true</DisableImplicitFrameworkReferences>
9-
10-
<Version>2.5.1</Version>
7+
<Version>2.5.2</Version>
118
<Authors>Laurent Gomila</Authors>
129
<PackageTags>sfml csfml</PackageTags>
1310
<Copyright>Copyright © Laurent Gomila</Copyright>
@@ -22,10 +19,7 @@
2219
</PropertyGroup>
2320

2421
<ItemGroup>
25-
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="all" />
26-
27-
<!-- Workaround to remove the NETStandard.Library NuGet reference without breaking everything -->
28-
<PackageReference Include="NETStandard.Library" Version="1.6.1" PrivateAssets="all" />
22+
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="all" />
2923
</ItemGroup>
3024

3125
<PropertyGroup>

tools/nuget/CSFML/build/netframework/CSFML.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2+
<Project ToolsVersion="16.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<PropertyGroup>
44
<CSFMLIgnoreAnyCPU>false</CSFMLIgnoreAnyCPU>
55
</PropertyGroup>

tools/nuget/CSFML/build/netframework/CSFML.targets

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2+
<Project ToolsVersion="16.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33

44
<Target Name="CSFMLAnyCPUError" Condition="$(CSFMLIgnoreAnyCPU) != true and $(Platform) == 'AnyCPU'" BeforeTargets="Build">
55
<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." />

tools/nuget/README.md

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,22 @@ All build scripts follow the same routine:
1919
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.
2020

2121
* `build.macos.sh`
22-
* 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.
22+
* 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).
2323
Currently supported RIDs are:
24-
* osx.10.15-x64
25-
* osx.11.0-x64
26-
* osx.11.0-arm64 (requires SFML 2.6)
24+
* `osx-x64` (uses macOS SDK 10.12)
25+
* `osx.11.0-x64`
26+
* `osx.11.0-arm64` (requires SFML 2.6)
2727

2828
* `build.docker.sh`, `build.docker.ps1`
2929
* 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:
30-
* `alpine-x64`
30+
* `linux-x64` (uses Ubuntu)
31+
* `linux-musl-x64` (uses Apline)
32+
* `linux-arm` (uses Arm32v7 Ubuntu)
33+
* `linux-arm64` (uses Arm64v8 Ubuntu )
34+
* `alpine-x64`
3135
* `debian-x64` (compatible with derivatives such as Ubuntu and Linux Mint)
32-
* `fedora-x64`
36+
* `ubuntu-x64`
37+
* `fedora-x64`
3338

3439
* `pushnuget.ps1`, `pushnuget.sh`
3540
* 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.

tools/nuget/build.docker.ps1

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,11 @@ Param(
66
$ErrorActionPreference = "Stop"
77

88
if (-not $RID ) {
9-
Write-Output "No RID specified, building all known RIDs"
10-
./build.docker.ps1 "alpine-x64"
11-
./build.docker.ps1 "debian-x64"
12-
./build.docker.ps1 "fedora-x64"
9+
Write-Output "No RID specified, building all common RIDs"
10+
./build.docker.ps1 "linux-x64"
11+
./build.docker.ps1 "linux-musl-x64"
12+
./build.docker.ps1 "linux-arm"
13+
./build.docker.ps1 "linux-arm64"
1314
exit
1415
}
1516

@@ -18,15 +19,35 @@ $Shell = $null
1819

1920
switch ($RID) {
2021
'alpine-x64' {
21-
$Image = 'alpine'
22+
$Image = 'alpine:3.7'
2223
$Shell = '/bin/sh'
2324
}
2425
'debian-x64' {
25-
$Image = 'debian'
26+
$Image = 'debian:bullseye'
27+
$Shell = '/bin/bash'
28+
}
29+
'ubuntu-x64' {
30+
$Image = 'ubuntu:22.04'
2631
$Shell = '/bin/bash'
2732
}
2833
'fedora-x64' {
29-
$Image = 'fedora'
34+
$Image = 'fedora:37'
35+
$Shell = '/bin/bash'
36+
}
37+
'linux-x64' {
38+
$Image = 'ubuntu:22.04'
39+
$Shell = '/bin/bash'
40+
}
41+
'linux-musl-x64' {
42+
$Image = 'alpine:3.15'
43+
$Shell = '/bin/sh'
44+
}
45+
'linux-arm' {
46+
$Image = 'arm32v7/ubuntu:22.04'
47+
$Shell = '/bin/bash'
48+
}
49+
'linux-arm64' {
50+
$Image = 'arm64v8/ubuntu:22.04'
3051
$Shell = '/bin/bash'
3152
}
3253
Default {

0 commit comments

Comments
 (0)