--- A/PKGBUILD 2023-02-13 18:37:16.989122993 -0600 +++ B/PKGBUILD 2023-02-13 18:38:45.654531138 -0600 @@ -3,24 +3,30 @@ # Contributor: Jorge Araya Navarro # Contributor: Cristian Porras # Contributor: Matthew Bentley +# Contributor: HurricanePootis -pkgname=godot +_pkgname=godot +pkgname=godot-mono pkgver=3.5.1 pkgrel=1 pkgdesc='Advanced cross-platform 2D and 3D game engine' url='https://godotengine.org' license=(MIT) arch=(x86_64) -makedepends=(gcc scons yasm alsa-lib pulseaudio) +makedepends=(gcc scons yasm alsa-lib pulseaudio nuget xorg-server-xvfb) depends=(embree freetype2 libglvnd libtheora libvorbis libvpx libwebp - libwslay libxcursor libxi libxinerama libxrandr mbedtls miniupnpc opusfile) + libwslay libxcursor libxi libxinerama libxrandr mbedtls miniupnpc opusfile mono mono-msbuild) optdepends=(pipewire-alsa pipewire-pulse) -source=("$pkgname-$pkgver.tar.gz::https://github.com/godotengine/godot/archive/$pkgver-stable.tar.gz") -b2sums=('e8a209972fc680ce9c024762715c64ea36f9d1ca223c6911a5179ff1cff3c2a143b703bb5b41f198b8b3ed5bd2c474316177bda094a3ef34d06e2dcf2adb2815') +source=("$_pkgname-$pkgver.tar.gz::https://github.com/godotengine/godot/archive/$pkgver-stable.tar.gz" + "godot") +conflicts=("godot" "godot-mono-bin") +provides=("godot") +b2sums=('e8a209972fc680ce9c024762715c64ea36f9d1ca223c6911a5179ff1cff3c2a143b703bb5b41f198b8b3ed5bd2c474316177bda094a3ef34d06e2dcf2adb2815' + 'fd6454322cca1c45aa2e9dac455ca2961de498b418b3b1ca3c09ad7e8ddbe194d48d249cda5efcacd4fea3f569ef5941ad54d67361e02ed2a2ecfcb649a91c2f') prepare() { # Disable the check that adds -no-pie to LINKFLAGS, for gcc != 6 - sed -i 's,0] >,0] =,g' $pkgname-$pkgver-stable/platform/x11/detect.py + sed -i 's,0] >,0] =,g' $_pkgname-$pkgver-stable/platform/x11/detect.py } build() { @@ -37,9 +43,11 @@ rm -rf thirdparty/$_lib done - cd $pkgname-$pkgver-stable + +# Build one to generate mono glue + cd $_pkgname-$pkgver-stable export BUILD_NAME=arch_linux - scons -j16 \ + scons -j$(nproc) \ bits=64 \ colored=yes \ platform=x11 \ @@ -48,6 +56,32 @@ target=release_debug \ tools=yes \ use_llvm=no \ + module_mono_enabled=yes \ + mono_glue=no \ + CFLAGS="$CFLAGS -fPIC -Wl,-z,relro,-z,now -w" \ + CXXFLAGS="$CXXFLAGS -fPIC -Wl,-z,relro,-z,now -w" \ + LINKFLAGS="$LDFLAGS" \ + $system_libs + +# Generate godot mono glue + cd $srcdir/$_pkgname-$pkgver-stable + xvfb-run -s "-screen 0 1920x1080x24 -nolisten local" \ + ./bin/godot.x11.opt.tools.64.mono --generate-mono-glue $srcdir/$_pkgname-$pkgver-stable/modules/mono/glue + +# Build two with mono glue + cd $srcdir/$_pkgname-$pkgver-stable + export BUILD_NAME=arch_linux + scons -j$(nproc) \ + bits=64 \ + colored=yes \ + platform=x11 \ + pulseaudio=yes \ + system_certs_path=/etc/ssl/certs/ca-certificates.crt \ + target=release_debug \ + tools=yes \ + use_llvm=no \ + module_mono_enabled=yes \ + mono_glue=yes \ CFLAGS="$CFLAGS -fPIC -Wl,-z,relro,-z,now -w" \ CXXFLAGS="$CXXFLAGS -fPIC -Wl,-z,relro,-z,now -w" \ LINKFLAGS="$LDFLAGS" \ @@ -55,11 +89,15 @@ } package() { - cd $pkgname-$pkgver-stable + cd $_pkgname-$pkgver-stable + install -Dm644 misc/dist/linux/org.godotengine.Godot.desktop \ "$pkgdir/usr/share/applications/godot.desktop" install -Dm644 icon.svg "$pkgdir/usr/share/pixmaps/godot.svg" - install -Dm755 bin/godot.x11.opt.tools.64 "$pkgdir/usr/bin/$pkgname" + install -Dm755 bin/godot.x11.opt.tools.64.mono "$pkgdir/opt/$pkgname/godot.x11.opt.tools.64.mono" + install -Dm755 bin/libmonosgen-2.0.so "$pkgdir/opt/$pkgname/libmonosgen-2.0.so" + cp -r bin/GodotSharp "$pkgdir/opt/$pkgname/GodotSharp" + install -Dm755 "$srcdir/godot" "$pkgdir/usr/bin/godot" install -Dm644 LICENSE.txt "$pkgdir/usr/share/licenses/godot/LICENSE" install -Dm644 misc/dist/linux/godot.6 "$pkgdir/usr/share/man/man6/godot.6" install -Dm644 misc/dist/linux/org.godotengine.Godot.xml \