Skip to content

Commit c996282

Browse files
committed
.NET 6: Further update build scripts for 4.0, works for desktop releases
Does not attempt to build Android, iOS and Web since it's not supported currently.
1 parent 4a37b8e commit c996282

File tree

6 files changed

+31
-74
lines changed

6 files changed

+31
-74
lines changed

build-android/build.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,11 @@ fi
5656

5757
# Mono
5858

59-
if [ "${MONO}" == "1" ]; then
59+
# No Android support with .NET 6 yet.
60+
#if [ "${MONO}" == "1" ]; then
61+
if false; then
6062
echo "Starting Mono build for Android..."
6163

62-
cp /root/mono-glue/*.cpp modules/mono/glue/
6364
cp -r /root/mono-glue/GodotSharp/GodotSharp/Generated modules/mono/glue/GodotSharp/GodotSharp/
6465

6566
$SCONS platform=android arch=arm32 $OPTIONS $OPTIONS_MONO tools=no target=release_debug

build-ios/build.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,11 @@ fi
5555

5656
# Mono
5757

58-
if [ "${MONO}" == "1" ]; then
58+
# No iOS support with .NET 6 yet.
59+
#if [ "${MONO}" == "1" ]; then
60+
if false; then
5961
echo "Starting Mono build for iOS..."
6062

61-
cp /root/mono-glue/*.cpp modules/mono/glue/
6263
cp -r /root/mono-glue/GodotSharp/GodotSharp/Generated modules/mono/glue/GodotSharp/GodotSharp/
6364

6465
# arm64 device

build-macos/build.sh

Lines changed: 8 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@ set -e
66

77
export SCONS="scons -j${NUM_CORES} verbose=yes warnings=no progress=no"
88
export OPTIONS="osxcross_sdk=darwin21.4 production=yes use_volk=no vulkan_sdk_path=/root/vulkansdk"
9-
export OPTIONS_MONO="module_mono_enabled=yes mono_static=yes"
10-
export MONO_PREFIX_X86_64="/root/mono-installs/desktop-osx-x86_64-release"
11-
export MONO_PREFIX_ARM64="/root/mono-installs/desktop-osx-arm64-release"
9+
export OPTIONS_MONO="module_mono_enabled=yes"
1210
export STRIP="x86_64-apple-darwin21.4-strip -u -r"
1311
export TERM=xterm
1412

@@ -50,48 +48,28 @@ fi
5048
if [ "${MONO}" == "1" ]; then
5149
echo "Starting Mono build for macOS..."
5250

53-
cp /root/mono-glue/*.cpp modules/mono/glue/
5451
cp -r /root/mono-glue/GodotSharp/GodotSharp/Generated modules/mono/glue/GodotSharp/GodotSharp/
5552
cp -r /root/mono-glue/GodotSharp/GodotSharpEditor/Generated modules/mono/glue/GodotSharp/GodotSharpEditor/
5653

57-
# Note: A bit of dylib wrangling involved as x86_64 and arm64 builds both generate GodotSharp
58-
# so the second build overrides the first, but we need to lipo the libs to make them universal.
59-
# We also need to ensure that /etc/mono/config has the proper filenames (keep arm64 as the last
60-
# build so that we rely on its config, which has libmono-native.dylib instead of
61-
# libmono-native-compat.dylib).
62-
mkdir -p tmp-lib/{x86_64,arm64}
63-
64-
$SCONS platform=macos $OPTIONS $OPTIONS_MONO mono_prefix=$MONO_PREFIX_X86_64 arch=x86_64 tools=yes target=release_debug copy_mono_root=yes
65-
cp bin/GodotSharp/Mono/lib/*.dylib tmp-lib/x86_64/
66-
$SCONS platform=macos $OPTIONS $OPTIONS_MONO mono_prefix=$MONO_PREFIX_ARM64 arch=arm64 tools=yes target=release_debug copy_mono_root=yes
67-
cp bin/GodotSharp/Mono/lib/*.dylib tmp-lib/arm64/
54+
$SCONS platform=macos $OPTIONS $OPTIONS_MONO arch=x86_64 tools=yes target=release_debug
55+
$SCONS platform=macos $OPTIONS $OPTIONS_MONO arch=arm64 tools=yes target=release_debug
6856
lipo -create bin/godot.macos.opt.tools.x86_64.mono bin/godot.macos.opt.tools.arm64.mono -output bin/godot.macos.opt.tools.universal.mono
6957
$STRIP bin/godot.macos.opt.tools.universal.mono
70-
71-
# Make universal versions of the dylibs we use.
72-
lipo -create tmp-lib/x86_64/libmono-native-compat.dylib tmp-lib/arm64/libmono-native.dylib -output tmp-lib/libmono-native.dylib
73-
lipo -create tmp-lib/x86_64/libMonoPosixHelper.dylib tmp-lib/arm64/libMonoPosixHelper.dylib -output tmp-lib/libMonoPosixHelper.dylib
74-
# Somehow only included in x86_64 build.
75-
cp tmp-lib/x86_64/libmono-btls-shared.dylib tmp-lib/
76-
77-
cp -f tmp-lib/*.dylib bin/GodotSharp/Mono/lib/
58+
./modules/mono/build_scripts/build_assemblies.py --godot-output-dir=./bin --godot-platform=macos
7859

7960
mkdir -p /root/out/tools-mono
8061
cp -rvp bin/* /root/out/tools-mono
8162
rm -rf bin
8263

83-
$SCONS platform=macos $OPTIONS $OPTIONS_MONO mono_prefix=$MONO_PREFIX_X86_64 arch=x86_64 tools=no target=release_debug
84-
$SCONS platform=macos $OPTIONS $OPTIONS_MONO mono_prefix=$MONO_PREFIX_ARM64 arch=arm64 tools=no target=release_debug
64+
$SCONS platform=macos $OPTIONS $OPTIONS_MONO arch=x86_64 tools=no target=release_debug
65+
$SCONS platform=macos $OPTIONS $OPTIONS_MONO arch=arm64 tools=no target=release_debug
8566
lipo -create bin/godot.macos.opt.debug.x86_64.mono bin/godot.macos.opt.debug.arm64.mono -output bin/godot.macos.opt.debug.universal.mono
8667
$STRIP bin/godot.macos.opt.debug.universal.mono
87-
$SCONS platform=macos $OPTIONS $OPTIONS_MONO mono_prefix=$MONO_PREFIX_X86_64 arch=x86_64 tools=no target=release
88-
$SCONS platform=macos $OPTIONS $OPTIONS_MONO mono_prefix=$MONO_PREFIX_ARM64 arch=arm64 tools=no target=release
68+
$SCONS platform=macos $OPTIONS $OPTIONS_MONO arch=x86_64 tools=no target=release
69+
$SCONS platform=macos $OPTIONS $OPTIONS_MONO arch=arm64 tools=no target=release
8970
lipo -create bin/godot.macos.opt.x86_64.mono bin/godot.macos.opt.arm64.mono -output bin/godot.macos.opt.universal.mono
9071
$STRIP bin/godot.macos.opt.universal.mono
9172

92-
cp -f tmp-lib/*.dylib bin/data.mono.macos.release.universal/Mono/lib/
93-
cp -f tmp-lib/*.dylib bin/data.mono.macos.release_debug.universal/Mono/lib/
94-
9573
mkdir -p /root/out/templates-mono
9674
cp -rvp bin/* /root/out/templates-mono
9775
rm -rf bin

build-mono-glue/build.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,19 @@ export SCONS="scons -j${NUM_CORES} verbose=yes warnings=no progress=no"
88
export OPTIONS="debug_symbols=no use_static_cpp=no"
99
export TERM=xterm
1010
export DISPLAY=:0
11+
export PATH="${GODOT_SDK_LINUX_X86_64}/bin:${BASE_PATH}"
1112

1213
rm -rf godot
1314
mkdir godot
1415
cd godot
1516
tar xf ../godot.tar.gz --strip-components=1
1617

18+
# pkg-config wrongly points to lib instead of lib64 for arch-dependent header.
19+
sed -i ${GODOT_SDK_LINUX_X86_64}/x86_64-godot-linux-gnu/sysroot/usr/lib/pkgconfig/dbus-1.pc -e "s@/lib@/lib64@g"
20+
21+
# Temporarily until we make --headless mode actually skip X11.
22+
dnf install -y libX11 libXcursor libXrandr libXinerama libXi mesa-libGL
23+
1724
# Mono
1825

1926
if [ "${MONO}" == "1" ]; then

build-release.sh

Lines changed: 7 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ sign_macos() {
3434
if [[ "${_is_mono}" == "1" ]]; then
3535
_appname="Godot_mono.app"
3636
_sharpdir="${_appname}/Contents/Resources/GodotSharp"
37-
_extra_files="${_sharpdir}/Mono/lib/*.dylib ${_sharpdir}/Tools/aot-compilers/*/*"
3837
else
3938
_appname="Godot.app"
4039
fi
@@ -46,7 +45,7 @@ sign_macos() {
4645
unzip ${_binname}.zip && \
4746
codesign --force --timestamp \
4847
--options=runtime --entitlements editor.entitlements \
49-
-s ${OSX_KEY_ID} -v ${_extra_files} ${_appname} && \
48+
-s ${OSX_KEY_ID} -v ${_appname} && \
5049
zip -r ${_binname}_signed.zip ${_appname}"
5150

5251
_request_uuid=$(ssh "${OSX_HOST}" "xcrun altool --notarize-app --primary-bundle-id \"${OSX_BUNDLE_ID}\" --username \"${APPLE_ID}\" --password \"${APPLE_ID_PASSWORD}\" --file ${_macos_tmpdir}/${_binname}_signed.zip")
@@ -76,17 +75,13 @@ sign_macos_template() {
7675
_reldir="$1"
7776
_is_mono="$2"
7877

79-
if [[ "${_is_mono}" == "1" ]]; then
80-
_extra_files="macos_template.app/Contents/Resources/data.mono.*/Mono/lib/*.dylib"
81-
fi
82-
8378
scp "${_reldir}/macos.zip" "${OSX_HOST}:${_macos_tmpdir}"
8479
ssh "${OSX_HOST}" "
8580
cd ${_macos_tmpdir} && \
8681
unzip macos.zip && \
8782
codesign --force -s - \
8883
--options=linker-signed \
89-
-v ${_extra_files} macos_template.app/Contents/MacOS/* && \
84+
-v macos_template.app/Contents/MacOS/* && \
9085
zip -r macos_signed.zip macos_template.app"
9186

9287
scp "${OSX_HOST}:${_macos_tmpdir}/macos_signed.zip" "${_reldir}/macos.zip"
@@ -354,7 +349,6 @@ if [ "${build_mono}" == "1" ]; then
354349
cp out/linux/x86_64/tools-mono/godot.linuxbsd.opt.tools.x86_64.mono ${binbasename}_x86_64/${binbasename}.x86_64
355350
strip ${binbasename}_x86_64/${binbasename}.x86_64
356351
cp -rp out/linux/x86_64/tools-mono/GodotSharp ${binbasename}_x86_64/
357-
cp -rp out/aot-compilers ${binbasename}_x86_64/GodotSharp/Tools/
358352
zip -r -q -9 "${reldir_mono}/${binbasename}_x86_64.zip" ${binbasename}_x86_64
359353
rm -rf ${binbasename}_x86_64
360354

@@ -363,22 +357,16 @@ if [ "${build_mono}" == "1" ]; then
363357
cp out/linux/x86_32/tools-mono/godot.linuxbsd.opt.tools.x86_32.mono ${binbasename}_x86_32/${binbasename}.x86_32
364358
strip ${binbasename}_x86_32/${binbasename}.x86_32
365359
cp -rp out/linux/x86_32/tools-mono/GodotSharp/ ${binbasename}_x86_32/
366-
cp -rp out/aot-compilers ${binbasename}_x86_32/GodotSharp/Tools/
367360
zip -r -q -9 "${reldir_mono}/${binbasename}_x86_32.zip" ${binbasename}_x86_32
368361
rm -rf ${binbasename}_x86_32
369362

370363
# Templates
371-
cp -rp out/linux/x86_64/templates-mono/data.mono.linuxbsd.x86_64.* ${templatesdir_mono}/
372364
cp out/linux/x86_64/templates-mono/godot.linuxbsd.opt.debug.x86_64.mono ${templatesdir_mono}/linux_debug.x86_64
373365
cp out/linux/x86_64/templates-mono/godot.linuxbsd.opt.x86_64.mono ${templatesdir_mono}/linux_release.x86_64
374-
cp -rp out/linux/x86_32/templates-mono/data.mono.linuxbsd.x86_32.* ${templatesdir_mono}/
375366
cp out/linux/x86_32/templates-mono/godot.linuxbsd.opt.debug.x86_32.mono ${templatesdir_mono}/linux_debug.x86_32
376367
cp out/linux/x86_32/templates-mono/godot.linuxbsd.opt.x86_32.mono ${templatesdir_mono}/linux_release.x86_32
377368
strip ${templatesdir_mono}/linux*
378369

379-
mkdir -p ${templatesdir_mono}/bcl
380-
cp -r out/linux/x86_64/tools-mono/GodotSharp/Mono/lib/mono/4.5/ ${templatesdir_mono}/bcl/net_4_x
381-
382370
## Windows (Mono) ##
383371

384372
# Editor
@@ -389,7 +377,6 @@ if [ "${build_mono}" == "1" ]; then
389377
strip ${binname}/${binname}.exe
390378
sign_windows ${binname}/${binname}.exe
391379
cp -rp out/windows/x86_64/tools-mono/GodotSharp ${binname}/
392-
cp -rp out/aot-compilers ${binname}/GodotSharp/Tools/
393380
echo "@echo off" > ${batname}
394381
echo ${binname}.exe >> ${batname}
395382
echo "pause > nul" >> ${batname}
@@ -404,7 +391,6 @@ if [ "${build_mono}" == "1" ]; then
404391
strip ${binname}/${binname}.exe
405392
sign_windows ${binname}/${binname}.exe
406393
cp -rp out/windows/x86_32/tools-mono/GodotSharp ${binname}/
407-
cp -rp out/aot-compilers ${binname}/GodotSharp/Tools/
408394
echo "@echo off" > ${batname}
409395
echo ${binname}.exe >> ${batname}
410396
echo "pause > nul" >> ${batname}
@@ -413,17 +399,12 @@ if [ "${build_mono}" == "1" ]; then
413399
rm -rf ${binname}
414400

415401
# Templates
416-
cp -rp out/windows/x86_64/templates-mono/data.mono.windows.x86_64.* ${templatesdir_mono}/
417402
cp out/windows/x86_64/templates-mono/godot.windows.opt.debug.x86_64.mono.exe ${templatesdir_mono}/windows_debug_x86_64.exe
418403
cp out/windows/x86_64/templates-mono/godot.windows.opt.x86_64.mono.exe ${templatesdir_mono}/windows_release_x86_64.exe
419-
cp -rp out/windows/x86_32/templates-mono/data.mono.windows.x86_32.* ${templatesdir_mono}/
420404
cp out/windows/x86_32/templates-mono/godot.windows.opt.debug.x86_32.mono.exe ${templatesdir_mono}/windows_debug_x86_32.exe
421405
cp out/windows/x86_32/templates-mono/godot.windows.opt.x86_32.mono.exe ${templatesdir_mono}/windows_release_x86_32.exe
422406
strip ${templatesdir_mono}/windows*.exe
423407

424-
mkdir -p ${templatesdir_mono}/bcl
425-
cp -r out/windows/x86_64/tools-mono/GodotSharp/Mono/lib/mono/4.5/ ${templatesdir_mono}/bcl/net_4_x_win
426-
427408
## macOS (Mono) ##
428409

429410
# Editor
@@ -433,7 +414,6 @@ if [ "${build_mono}" == "1" ]; then
433414
mkdir -p Godot_mono.app/Contents/{MacOS,Resources}
434415
cp out/macos/tools-mono/godot.macos.opt.tools.universal.mono Godot_mono.app/Contents/MacOS/Godot
435416
cp -rp out/macos/tools-mono/GodotSharp Godot_mono.app/Contents/Resources/GodotSharp
436-
cp -rp out/aot-compilers Godot_mono.app/Contents/Resources/GodotSharp/Tools/
437417
chmod +x Godot_mono.app/Contents/MacOS/Godot
438418
zip -q -9 -r "${reldir_mono}/${binname}.zip" Godot_mono.app
439419
rm -rf Godot_mono.app
@@ -445,12 +425,15 @@ if [ "${build_mono}" == "1" ]; then
445425
mkdir -p macos_template.app/Contents/{MacOS,Resources}
446426
cp out/macos/templates-mono/godot.macos.opt.debug.universal.mono macos_template.app/Contents/MacOS/godot_macos_debug.universal
447427
cp out/macos/templates-mono/godot.macos.opt.universal.mono macos_template.app/Contents/MacOS/godot_macos_release.universal
448-
cp -rp out/macos/templates-mono/data.mono.macos.* macos_template.app/Contents/Resources/
449428
chmod +x macos_template.app/Contents/MacOS/godot_macos*
450429
zip -q -9 -r "${templatesdir_mono}/macos.zip" macos_template.app
451430
rm -rf macos_template.app
452431
sign_macos_template ${templatesdir_mono} 1
453432

433+
# No .NET support for those platforms yet.
434+
435+
if false; then
436+
454437
## Web (Mono) ##
455438

456439
# Templates
@@ -462,18 +445,10 @@ if [ "${build_mono}" == "1" ]; then
462445
# Lib for direct download
463446
cp out/android/templates-mono/godot-lib.release.aar ${reldir_mono}/godot-lib.${templates_version}.mono.release.aar
464447

465-
# Editor
466-
#binname="${godot_basename}_mono_android_editor.apk"
467-
#cp out/android/tools-mono/android_editor.apk ${reldir_mono}/${binname}
468-
469448
# Templates
470449
cp out/android/templates-mono/*.apk ${templatesdir_mono}/
471450
cp out/android/templates-mono/android_source.zip ${templatesdir_mono}/
472451

473-
mkdir -p ${templatesdir_mono}/bcl
474-
cp -r out/android/templates-mono/bcl/godot_android_ext ${templatesdir_mono}/bcl/
475-
cp -r out/android/templates-mono/bcl/monodroid ${templatesdir_mono}/bcl/
476-
477452
## iOS (Mono) ##
478453

479454
rm -rf ios_xcode
@@ -489,13 +464,7 @@ if [ "${build_mono}" == "1" ]; then
489464
cd ..
490465
rm -rf ios_xcode
491466

492-
mkdir -p ${templatesdir_mono}/bcl
493-
cp -r out/ios/templates-mono/bcl/monotouch* ${templatesdir_mono}/bcl/
494-
cp -r out/ios/templates-mono/ios-mono-libs ${templatesdir_mono}
495-
496-
# ## UWP (Mono) ##
497-
#
498-
# # Not supported yet.
467+
fi
499468

500469
## Templates TPZ (Mono) ##
501470

build-web/build.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,11 @@ fi
5555

5656
# Mono
5757

58-
if [ "${MONO}" == "1" ]; then
58+
# No Web support with .NET 6 yet.
59+
#if [ "${MONO}" == "1" ]; then
60+
if false; then
5961
echo "Starting Mono build for Web..."
6062

61-
cp /root/mono-glue/*.cpp modules/mono/glue/
6263
cp -r /root/mono-glue/GodotSharp/GodotSharp/Generated modules/mono/glue/GodotSharp/GodotSharp/
6364

6465
$SCONS platform=web ${OPTIONS} ${OPTIONS_MONO} target=release_debug tools=no

0 commit comments

Comments
 (0)