diff --git a/testing/godot/APKBUILD b/testing/godot/APKBUILD
index fadd481d38d588ab0ee49e705be0b52d65e545f6..e60f881600340fbe00c23481b372befa275c852a 100644
--- a/testing/godot/APKBUILD
+++ b/testing/godot/APKBUILD
@@ -1,12 +1,12 @@
 # Contributor: Díaz Urbaneja Diego <sodomon2@gmail.com>
 # Maintainer: Díaz Urbaneja Diego <sodomon2@gmail.com>
 pkgname=godot
-pkgver=3.4.4
-pkgrel=1
+pkgver=3.5
+pkgrel=0
 pkgdesc="Multi-platform 2D and 3D game engine"
 url="https://godotengine.org"
 license="MIT"
-arch="armv7 x86_64" # Other architectures untested
+arch="all" # Only armv7 and x86_64 are tested, give other architectures a try
 makedepends="
 	alsa-lib-dev
 	bullet-dev
@@ -36,49 +36,104 @@ makedepends="
 	zlib-dev
 	zstd-dev
 	"
-subpackages="$pkgname-doc"
+depends="ca-certificates-bundle"
+subpackages="$pkgname-doc $pkgname-headless $pkgname-templates"
 source="https://github.com/godotengine/godot/archive/$pkgver-stable/godot-$pkgver-stable.tar.gz
 	no-execinfo.patch
 	"
 options="!check" # No tests
 builddir="$srcdir"/godot-"$pkgver"-stable
+_sconsflags="
+	builtin_bullet=false
+	builtin_certs=false
+	builtin_enet=false
+	builtin_freetype=false
+	builtin_libogg=false
+	builtin_libpng=false
+	builtin_libtheora=false
+	builtin_libvorbis=false
+	builtin_libvpx=false
+	builtin_libwebp=false
+	builtin_mbedtls=false
+	builtin_miniupnpc=false
+	builtin_opus=false
+	builtin_pcre2=false
+	builtin_wslay=false
+	builtin_zlib=false
+	builtin_zstd=false
+	system_certs_path=/etc/ssl/cert.pem
+	"
+
+case "$CARCH" in
+	aarch64|x86_64)
+		makedepends="$makedepends embree-dev"
+		_sconsflags="$_sconsflags builtin_embree=false"
+		;;
+	*)
+		# The raycast module requires embree which is enabled on all 64bit
+		# arches but actually supports only amd64 and arm64.
+		_sconsflags="$_sconsflags module_raycast_enabled=false"
+		;;
+esac
+
+# Thirdparty dependency OpenImage Denoise only supports x86_64.
+if [ "$CARCH" != "x86_64" ]; then
+	_sconsflags="$_sconsflags module_denoise_enabled=false"
+fi
 
 build() {
-	scons -j${JOBS:-1} \
-		platform=linuxbsd \
-		target=release_debug \
-		bits=default \
-		platform=x11 \
-		builtin_bullet=false \
-		builtin_enet=false \
-		builtin_freetype=false \
-		builtin_libogg=false \
-		builtin_libpng=false \
-		builtin_libtheora=false \
-		builtin_libvorbis=false \
-		builtin_libvpx=false \
-		builtin_libwebp=false \
-		builtin_wslay=false \
-		builtin_mbedtls=false \
-		builtin_miniupnpc=false \
-		builtin_opus=false \
-		builtin_pcre2=false \
-		builtin_zlib=false \
-		builtin_zstd=false
+	# x11      release_debug tools
+	# headless release_debug tools
+	# x11      release       template
+	# x11      release_debug template
+	# server   release       template
+	# server   release_debug template
+	for platform in x11 server; do
+		for target in release release_debug; do
+			for tools in yes no; do
+				if [ "$tools" = "yes" ] && [ "$target" = "release" ]; then
+					continue
+				fi
+				scons -j${JOBS:-1} \
+					platform=$platform \
+					target=$target \
+					tools=$tools \
+					$_sconsflags
+			done
+		done
+	done
 }
 
 package() {
+	pkgdesc="$pkgdesc (GUI editor)"
 	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
-	test -f bin/godot.x11.opt.tools.32 && \
-		install -D -m755 bin/godot.x11.opt.tools.32 "$pkgdir"/usr/bin/godot
-	test -f bin/godot.x11.opt.tools.64 && \
-		install -D -m755 bin/godot.x11.opt.tools.64 "$pkgdir"/usr/bin/godot
-	install -D -m644 misc/dist/linux/godot.6 "$pkgdir"/usr/share/man/man6/godot.6
+	install -Dm644 icon.png "$pkgdir"/usr/share/icons/hicolor/256x256/apps/godot.png
+	install -Dm644 icon.svg "$pkgdir"/usr/share/icons/hicolor/scalable/apps/godot.svg
+	install -Dm644 misc/dist/linux/godot.6 "$pkgdir"/usr/share/man/man6/godot.6
+	install -Dm755 bin/godot.x11.opt.tools.[36pr]* "$pkgdir"/usr/bin/godot
+	install -Dm755 bin/godot_server.x11.opt.tools.[36pr]* "$pkgdir"/usr/bin/godot-headless
+	install -Dm755 bin/godot.x11.opt.[36pr]* "$pkgdir"/usr/bin/godot-client
+	install -Dm755 bin/godot.x11.opt.debug.[36pr]* "$pkgdir"/usr/bin/godot-client-debug
+	install -Dm755 bin/godot_server.x11.opt.[36pr]* "$pkgdir"/usr/bin/godot-server
+	install -Dm755 bin/godot_server.x11.opt.debug.[36pr]* "$pkgdir"/usr/bin/godot-server-debug
+}
+
+headless() {
+	pkgdesc="$pkgdesc (headless editor)"
+	amove usr/bin/godot-headless
+}
+
+# use for packaging games and playing with musl libc or non-x86 CPU
+templates() {
+	pkgdesc="$pkgdesc (client and server)"
+	amove usr/bin/godot-client
+	amove usr/bin/godot-client-debug
+	amove usr/bin/godot-server
+	amove usr/bin/godot-server-debug
 }
 
 sha512sums="
-bfe6a04569c1a0a1dd8eb98869b22c35207c653fd5ad9e4429568474b27ab745558474dc276e4ba72dadfe4d0781c8651bc58f69a2448a382f57eb2c0ac22ee9  godot-3.4.4-stable.tar.gz
+7bb6552792ae53d9b5c8fc07df2984ea0ff2a6f3d8e1416101464bb1a3a727d88ce8facc518c994958f96f34aa3fa6383552ff54c6b9cb2988fd3ad8ad012e6c  godot-3.5-stable.tar.gz
 a3853b7e23b0684e44dbf67c7cbddfa3ea8b1154347a1aa58870d66a213d05bb1ad8b6fdc4106239e0c1a1efcd174b0544ff0d6bbb516a0fe9f516ad2514400b  no-execinfo.patch
 "