builds godot
-rw-r--r--.github/2d-build-modules.py104
-rw-r--r--.github/actions/build-godot/action.yml7
-rw-r--r--.github/actions/build-upload-image/action.yml8
-rw-r--r--.github/actions/get-version/action.yml2
-rw-r--r--.github/actions/release/action.yml12
-rw-r--r--.github/actions/setup/action.yml7
-rw-r--r--.github/workflows/manual-build-2d.yml9
-rw-r--r--.github/workflows/manual-build-normal.yml7
-rw-r--r--.github/workflows/reusable-build.yml132
-rwxr-xr-xREADME.md8
-rw-r--r--patches/fix_buffer_underrun.patch24
-rw-r--r--patches/no-arg-handling.patch337
-rw-r--r--patches/no-touchpad-gamepad.patch26
13 files changed, 257 insertions, 426 deletions
diff --git a/.github/2d-build-modules.py b/.github/2d-build-modules.py
index 1dc359e..0c3fb29 100644
--- a/.github/2d-build-modules.py
+++ b/.github/2d-build-modules.py
@@ -1,69 +1,69 @@
-brotli = "yes" # compression and woff2
-dbus = "no" # screensaver and portal
+module_bmp_enabled = "no"
+module_csg_enabled = "no"
+module_enet_enabled = "no"
+module_etc_enabled = "no"
+module_gltf_enabled = "no"
+module_gridmap_enabled = "no"
+module_hdr_enabled = "no"
+module_jpg_enabled = "no"
+module_lightmapper_cpu_enabled = "no"
+module_webm_enabled = "no"
debug_symbols = "no"
+optimize = "size"
+lto = "auto"
+production = "yes"
deprecated = "no"
+minizip = "yes"
+vulkan = "yes"
+opengl3 = "yes"
+openxr = "no"
+pulseaudio = "yes"
+dbus = "yes"
+speechd = "no"
+fontconfig = "yes"
+udev = "yes"
+x11 = "yes"
+touch = "yes"
execinfo = "no"
-fontconfig = "yes" # system fonts
-graphite = "yes"
-lto = "auto"
-minizip = "no" # zip support
-module_astcenc_enabled = "no" # adaptive scalable data compression format
module_basis_universal_enabled = "yes"
-module_bmp_enabled = "no" # BMP file format
-module_camera_enabled = "no" # windows and macos camera access
-module_csg_enabled = "no" # 3D csg boxes
-module_cvtt_enabled = "no" # yet another image format
-module_dds_enabled = "no" # ditto (but this is multiple)
-module_denoise_enabled = "no" # 3d lightmap denoising
-module_enet_enabled = "no" # multiplayer backend
-module_etc_enabled = "no" # image compression (again)
-module_etcpak_enabled = "no" # ^
-module_freetype_enabled = "yes" # font rendering
+module_camera_enabled = "yes"
+module_cvtt_enabled = "no"
+module_dds_enabled = "no"
+module_denoise_enabled = "no"
+module_etcpak_enabled = "no"
+brotli = "yes"
+module_freetype_enabled = "yes"
module_gdscript_enabled = "yes"
module_glslang_enabled = "yes"
-module_gltf_enabled = "no" # gltf loading
-module_gridmap_enabled = "no" # gridmap
-module_hdr_enabled = "no" # hdr images
-module_jpg_enabled = "no" # jpg images
-module_jsonrpc_enabled = "no" # godot/modules/jsonrpc/jsonrpc.cpp
+module_jsonrpc_enabled = "no"
module_lightmapper_rd_enabled = "no"
-module_mbedtls_enabled = "no" # TLS and crypto
+module_mbedtls_enabled = "no"
module_meshoptimizer_enabled = "no"
-module_minimp3_enabled = "no" # mp3 player
+module_minimp3_enabled = "no"
module_mobile_vr_enabled = "no"
-module_mono_enabled = "no" # .NET
+module_mono_enabled = "no"
module_msdfgen_enabled = "no"
-module_multiplayer_enabled = "no" # godot multiplayer
-module_navigation_enabled = "yes" # navigation!!
-module_noise_enabled = "yes" # noise generation
-openxr = "no" # XR
-module_openxr_enabled = "no"
+module_multiplayer_enabled = "no"
+module_navigation_enabled = "yes"
+module_noise_enabled = "no"
module_ogg_enabled = "yes"
-module_raycast_enabled = "no" # lightmap raytracing
+module_openxr_enabled = "no"
+module_raycast_enabled = "yes"
module_regex_enabled = "yes"
-module_squish_enabled = "yes" # S3TC lossy compression format
-module_svg_enabled = "yes" # svg is necessary for editor
-module_text_server_fb_enabled = "no" # the text server
-module_text_server_adv_enabled = "yes" # the cooler text server
-module_tga_enabled = "no" # more image formats
-module_theora_enabled = "no" # ogg theora video format
-module_tinyexr_enabled = "no" # image
+module_squish_enabled = "no"
+module_svg_enabled = "yes"
+graphite = "yes"
+module_text_server_adv_enabled = "yes"
+module_text_server_fb_enabled = "yes"
+module_tga_enabled = "no"
+module_theora_enabled = "no"
+module_tinyexr_enabled = "no"
module_upnp_enabled = "no" # universal plug and play
-module_vhacd_enabled = "no" # 3d surface stuff
-module_vorbis_enabled = "yes" # vorbis audio
-module_webp_enabled = "yes" # lossy compression format
+module_vhacd_enabled = "no"
+module_vorbis_enabled = "yes"
+module_webp_enabled = "yes"
module_webrtc_enabled = "no"
module_websocket_enabled = "no"
module_webxr_enabled = "no"
-module_xatlas_unwrap_enabled = "no" # lightmapping stuff
+module_xatlas_unwrap_enabled = "no"
module_zip_enabled = "no"
-opengl3 = "yes"
-optimize = "size"
-production = "yes"
-pulseaudio = "yes" # linux audio
-speechd = "no" # tts
-touch = "yes" # touchscreen
-udev = "yes"
-vulkan = "no" # use opengl3, this is the size build
-use_volk = "no"
-x11 = "yes" # x11 rendering
diff --git a/.github/actions/build-godot/action.yml b/.github/actions/build-godot/action.yml
index dc6e09d..e30436e 100644
--- a/.github/actions/build-godot/action.yml
+++ b/.github/actions/build-godot/action.yml
@@ -16,7 +16,7 @@ runs:
using: "composite"
steps:
- name: Setup
- uses: bend-n/godot-builds/.github/actions/setup@main
+ uses: bend-n/godot-builds/.github/actions/[email protected]
with:
ref: ${{ env.ref }}
@@ -51,8 +51,9 @@ runs:
scons_flags=${{ env.flags }}
cores=$(nproc) || cores=$(sysctl -n hw.ncpu)
[[ -n "${{ inputs.flags }}" ]] && scons_flags="${{ inputs.flags }}"
- [[ ${{ inputs.target }} == "editor" ]] && scons_flags="${scons_flags//disable_3d=yes/}" # remove disable_3d=yes if editor
- scons -j$((cores+2)) p=${{ inputs.platform }} target=${{ inputs.target }} use_lto=yes udev=yes $scons_flags
+ [[ ${{ env.tools }} == "yes" ]] && scons_flags="${scons_flags//disable_3d=yes/}" # remove disable_3d=yes if editor
+ echo "Running `scons -j$((cores+2)) p=${{ inputs.platform }} target=${{ inputs.target }} use_lto=yes udev=yes tools=${{ env.tools }} $scons_flags`"
+ scons -j$((cores+2)) p=${{ inputs.platform }} target=${{ inputs.target }} use_lto=yes udev=yes "tools=${{ env.tools }}" $scons_flags
strip bin/* || true
ls bin
echo ::endgroup::
diff --git a/.github/actions/build-upload-image/action.yml b/.github/actions/build-upload-image/action.yml
index 4fbf2c5..172a05e 100644
--- a/.github/actions/build-upload-image/action.yml
+++ b/.github/actions/build-upload-image/action.yml
@@ -16,19 +16,19 @@ runs:
- uses: actions/checkout@v3
- name: Get version
- uses: bend-n/godot-builds/.github/actions/get-version@main
+ uses: bend-n/godot-builds/.github/actions/[email protected]
- name: Get templates
uses: actions/download-artifact@v3
with:
name: templates
- - name: Get editor
+ - name: Get headless editor
uses: actions/download-artifact@v3
with:
- name: linuxbsd-editor-release
+ name: server-editor-release
- - run: mv godot.linuxbsd.editor.x86_64 godot && chmod -v +x godot
+ - run: mv godot_server.x11.opt.tools.64 godot && chmod -v +x godot
shell: bash
- name: Login to GitHub Container Registry
diff --git a/.github/actions/get-version/action.yml b/.github/actions/get-version/action.yml
index 3387547..fe72950 100644
--- a/.github/actions/get-version/action.yml
+++ b/.github/actions/get-version/action.yml
@@ -5,7 +5,7 @@ runs:
using: "composite"
steps:
- name: Setup
- uses: bend-n/godot-builds/.github/actions/setup@main
+ uses: bend-n/godot-builds/.github/actions/[email protected]
with:
ref: ${{ env.ref }}
diff --git a/.github/actions/release/action.yml b/.github/actions/release/action.yml
index ad49765..1c42329 100644
--- a/.github/actions/release/action.yml
+++ b/.github/actions/release/action.yml
@@ -14,7 +14,7 @@ runs:
using: "composite"
steps:
- name: Get version
- uses: bend-n/godot-builds/.github/actions/get-version@main
+ uses: bend-n/godot-builds/.github/actions/[email protected]
- name: Get templates
uses: actions/download-artifact@v3
@@ -26,9 +26,15 @@ runs:
with:
name: linuxbsd-editor-release
+ - name: Get headless
+ uses: actions/download-artifact@v3
+ with:
+ name: server-editor-release
+
- name: Compress
run: |
- mv godot.linuxbsd.editor.x86_64 ${{ env.fstart }}_linux.x86_64
+ mv godot.x11.opt.tools.64 ${{ env.fstart }}_linux.x86_64
+ mv godot_server.x11.opt.tools.64 ${{ env.fstart }}_linux_headless.64
mv templates.tpz ${{ env.fstart }}_export_templates.tpz
shell: bash
env:
@@ -42,7 +48,9 @@ runs:
files: |
${{ env.fstart }}_export_templates.tpz
${{ env.fstart }}_linux.x86_64
+ ${{ env.fstart }}_linux_headless.64
token: ${{ inputs.github-token }}
prerelease: ${{ env.prerelease }}
+ fail_on_unmatched_files: true
env:
fstart: ${{ inputs.name }}_v${{ env.version-name }}
diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml
index 68be9c4..ca3d7e2 100644
--- a/.github/actions/setup/action.yml
+++ b/.github/actions/setup/action.yml
@@ -40,6 +40,9 @@ runs:
# Patch godot
(cd repo && mv "${{ env.modules }}" ../godot/custom.py && mv patches ../godot)
cd godot
- echo "applying $(find patches/* | tr '\n' ' ')..."
- git apply patches/* || echo "::warning::Some patches failed"
+ for patch in patches/*; do git apply --ignore-whitespace "$patch" || err="$patch"; done
+ if [[ -n $err ]]; then
+ echo "::error file={${err}}::Go update your patch"
+ exit 1
+ fi
shell: bash
diff --git a/.github/workflows/manual-build-2d.yml b/.github/workflows/manual-build-2d.yml
index 694a46f..77bbc9a 100644
--- a/.github/workflows/manual-build-2d.yml
+++ b/.github/workflows/manual-build-2d.yml
@@ -7,20 +7,15 @@ on:
type: string
description: which ref to build
required: true
- release:
- type: string
- default: "yes"
- description: to make a release
-
+
jobs:
two-dimensions:
name: Build ${{ inputs.ref }}
- uses: bend-n/godot-builds/.github/workflows/reusable-build.yml@main
+ uses: bend-n/godot-builds/.github/workflows/[email protected]
with:
ref: ${{ inputs.ref }}
name: godot-2d
build-name: bendn.2D
modules-path: ./.github/2d-build-modules.py
flags: ""
- make-release: ${{ inputs.release }}
secrets: inherit
diff --git a/.github/workflows/manual-build-normal.yml b/.github/workflows/manual-build-normal.yml
index 95a6212..f58e373 100644
--- a/.github/workflows/manual-build-normal.yml
+++ b/.github/workflows/manual-build-normal.yml
@@ -7,10 +7,6 @@ on:
type: string
description: which ref to build
required: true
- release:
- type: string
- default: "yes"
- description: to make a release
# turn on when the godot5 is in dev
# schedule:
# - cron: '30 20 * * *'
@@ -18,12 +14,11 @@ on:
jobs:
all-dimensions:
name: Build ${{ inputs.ref }}
- uses: bend-n/godot-builds/.github/workflows/reusable-build.yml@main
+ uses: bend-n/godot-builds/.github/workflows/[email protected]
with:
ref: ${{ inputs.ref }}
name: godot
build-name: bendn
modules-path: ./.github/normal-build-modules.py
flags: ""
- make-release: ${{ inputs.release }}
secrets: inherit
diff --git a/.github/workflows/reusable-build.yml b/.github/workflows/reusable-build.yml
index fabd372..0b6f9f7 100644
--- a/.github/workflows/reusable-build.yml
+++ b/.github/workflows/reusable-build.yml
@@ -19,10 +19,6 @@ on:
build-name:
type: string
required: true
- make-release:
- type: string
- default: "yes"
- required: true
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ inputs.ref }}
@@ -33,6 +29,7 @@ env:
ref: ${{ inputs.ref }}
flags: ${{ inputs.flags }}
modules: ${{ inputs.modules-path }}
+ tools: no
jobs:
linux:
@@ -40,38 +37,38 @@ jobs:
runs-on: ubuntu-20.04
strategy:
matrix:
- target: [template_release, template_debug]
+ target: [release, release_debug]
bits: [64]
steps:
- name: Compilation
- uses: bend-n/godot-builds/.github/actions/build-godot@main
+ uses: bend-n/godot-builds/.github/actions/[email protected]
with:
target: ${{ matrix.target }}
flags: bits=${{ matrix.bits }} ${{ env.flags }}
platform: linuxbsd
- name: Upload artifact
- uses: bend-n/godot-builds/.github/actions/upload-artifact@main
+ uses: bend-n/godot-builds/.github/actions/[email protected]
with:
- path: godot/bin/*.x86_64
+ path: godot/bin/*.64
windows:
strategy:
matrix:
- target: [template_release, template_debug]
+ target: [release, release_debug]
bits: [64]
name: Win temps
runs-on: windows-latest
steps:
- name: Compilation
- uses: bend-n/godot-builds/.github/actions/build-godot@main
+ uses: bend-n/godot-builds/.github/actions/[email protected]
with:
target: ${{ matrix.target }}
flags: bits=${{ matrix.bits }} ${{ env.flags }}
platform: windows
- name: Upload artifact
- uses: bend-n/godot-builds/.github/actions/upload-artifact@main
+ uses: bend-n/godot-builds/.github/actions/[email protected]
with:
path: godot/bin/*.exe
@@ -80,7 +77,7 @@ jobs:
runs-on: ubuntu-20.04
strategy:
matrix:
- target: [template_release, template_debug]
+ target: [release, release_debug]
steps:
- name: Set up Java 11
uses: actions/setup-java@v3
@@ -89,14 +86,14 @@ jobs:
distribution: temurin
- name: Compilation (armv7)
- uses: bend-n/godot-builds/.github/actions/build-godot@main
+ uses: bend-n/godot-builds/.github/actions/[email protected]
with:
target: ${{ matrix.target }}
flags: android_arch=armv7 ${{ env.flags }}
platform: android
- name: Compilation (arm64v8)
- uses: bend-n/godot-builds/.github/actions/build-godot@main
+ uses: bend-n/godot-builds/.github/actions/[email protected]
with:
target: ${{ matrix.target }}
flags: android_arch=arm64v8 ${{ env.flags }}
@@ -108,14 +105,14 @@ jobs:
(cd platform/android/java && ./gradlew generateGodotTemplates)
- name: Upload artifact
- uses: bend-n/godot-builds/.github/actions/upload-artifact@main
+ uses: bend-n/godot-builds/.github/actions/[email protected]
with:
path: godot/bin/*.apk
macos:
strategy:
matrix:
- target: [template_release, template_debug]
+ target: [release, release_debug]
name: macOS temps
runs-on: macos-latest
@@ -140,14 +137,14 @@ jobs:
echo 'Vulkan SDK installed successfully! You can now build Godot by running "scons".'
- name: Compilation(x86_64)
- uses: bend-n/godot-builds/.github/actions/build-godot@main
+ uses: bend-n/godot-builds/.github/actions/[email protected]
with:
flags: arch=x86_64 ${{ env.flags }}
target: ${{ matrix.target }}
platform: macos
- name: Compilation(arm64)
- uses: bend-n/godot-builds/.github/actions/build-godot@main
+ uses: bend-n/godot-builds/.github/actions/[email protected]
with:
flags: arch=arm64 ${{ env.flags }}
target: ${{ matrix.target }}
@@ -157,21 +154,21 @@ jobs:
run: |
[[ "${{ matrix.target }}" == *"debug"* ]] && target='.debug'
cd godot
- intel=bin/godot.macos.*.x86_64
- arm=bin/godot.macos.*.arm64
- lipo -create $intel $arm -output "bin/godot.macos.opt$target.universal"
- strip "bin/godot.macos.opt$target.universal"
+ intel=bin/godot.osx.*.x86_64
+ arm=bin/godot.osx.*.arm64
+ lipo -create $intel $arm -output "bin/godot.osx.opt$target.universal"
+ strip "bin/godot.osx.opt$target.universal"
- name: Upload artifact
- uses: bend-n/godot-builds/.github/actions/upload-artifact@main
+ uses: bend-n/godot-builds/.github/actions/[email protected]
with:
path: godot/bin/*.universal
- web:
+ javascript:
strategy:
matrix:
- target: [template_release, template_debug]
- flags: [dlink_enabled=yes, ""]
+ target: [release, release_debug]
+ flags: [gdnative_enabled=yes, threads_enabled=yes, ""]
name: JS temps
runs-on: ubuntu-20.04
@@ -185,19 +182,19 @@ jobs:
run: emcc -v
- name: Compilation
- uses: bend-n/godot-builds/.github/actions/build-godot@main
+ uses: bend-n/godot-builds/.github/actions/[email protected]
with:
target: ${{ matrix.target }}
flags: ${{ env.flags }} ${{ matrix.flags }}
- platform: web
+ platform: javascript
- name: Upload artifact
- uses: bend-n/godot-builds/.github/actions/upload-artifact@main
+ uses: bend-n/godot-builds/.github/actions/[email protected]
with:
path: godot/bin/*.zip
templates:
- needs: [web, macos, windows, linux, android]
+ needs: [javascript, macos, windows, linux, android]
name: Bundle all templates
runs-on: ubuntu-latest
env:
@@ -218,84 +215,79 @@ jobs:
- name: Prepare files
run: |
- rel="template_release"
- bug="template_debug"
- mkdir -vp "$tmps"
+ mkdir -vp ${tmps}
echo "Preparing linux"
- linux="godot.linuxbsd"
- mv "linux/$linux.$bug.x86_64" "$tmps/linux_debug.x86_64"
- mv "linux/$linux.$rel.x86_64" "$tmps/linux_release.x86_64"
-
+ mv linux/godot.x11.opt.64 ${tmps}/linux_x11_64_release
+ mv linux/godot.x11.opt.debug.64 ${tmps}/linux_x11_64_debug
echo "Preparing windows"
- windows="godot.windows"
- mv "windows/$windows.$bug.x86_64.console.exe" "$tmps/windows_debug_x86_64_console.exe"
- mv "windows/$windows.$bug.x86_64.exe" "$tmps/windows_debug_x86_64.exe"
- mv "windows/$windows.$rel.x86_64.console.exe" "$tmps/windows_release_x86_64_console.exe"
- mv "windows/$windows.$rel.x86_64.exe" "$tmps/windows_release_x86_64.exe"
-
+ mv windows/godot.windows.opt.64.exe ${tmps}/windows_64_release.exe
+ mv windows/godot.windows.opt.debug.64.exe ${tmps}/windows_64_debug.exe
echo "Preparing android"
- mv "android/android_debug.apk" "$tmps/android_debug.apk"
- mv "android/android_release.apk" "$tmps/android_release.apk"
-
+ mv android/android_debug.apk ${tmps}/android_debug.apk
+ mv android/android_release.apk ${tmps}/android_release.apk
echo "Preparing macos"
- mac="godot.macos.opt"
- cp -r "godot-repo/misc/dist/macos_template.app" "."
- mkdir -p "macos_template.app/Contents/MacOS"
- cp "macos/$mac.universal" "macos_template.app/Contents/MacOS/godot_macos_release.universal"
- cp "macos/$mac.debug.universal" "macos_template.app/Contents/MacOS/godot_macos_debug.universal"
- chmod +x macos_template.app/Contents/MacOS/godot_macos_*.universal
- zip -q -9 -r "$tmps/macos.zip" "macos_template.app"
-
+ cp -r godot-repo/misc/dist/osx_template.app .
+ mkdir -p osx_template.app/Contents/MacOS
+ cp macos/godot.osx.opt.universal osx_template.app/Contents/MacOS/godot_osx_release.64
+ cp macos/godot.osx.opt.debug.universal osx_template.app/Contents/MacOS/godot_osx_debug.64
+ chmod +x osx_template.app/Contents/MacOS/godot_osx_*.64
+ zip -q -9 -r ${tmps}/osx.zip osx_template.app
echo "Preparing web"
- web="godot.web"
- mv "web/$web.$rel.wasm32.zip" "$tmps/web_release.zip"
- mv "web/$web.$bug.wasm32.zip" "$tmps/web_debug.zip"
- mv "web/$web.$rel.wasm32.dlink.zip" "$tmps/web_dlink_release.zip"
- mv "web/$web.$bug.wasm32.dlink.zip" "$tmps/web_dlink_debug.zip"
+ mv javascript/godot.javascript.opt.zip ${tmps}/webassembly_release.zip
+ mv javascript/godot.javascript.opt.debug.zip ${tmps}/webassembly_debug.zip
+ mv javascript/godot.javascript.opt.threads.zip ${tmps}/webassembly_threads_release.zip
+ mv javascript/godot.javascript.opt.debug.threads.zip ${tmps}/webassembly_threads_debug.zip
+ mv javascript/godot.javascript.opt.gdnative.zip ${tmps}/webassembly_gdnative_release.zip
+ mv javascript/godot.javascript.opt.debug.gdnative.zip ${tmps}/webassembly_gdnative_debug.zip
- name: Prepare bundle
run: cd "${tmps}" && zip -qr9 templates.tpz ./*
- name: Upload artifact
- uses: bend-n/godot-builds/.github/actions/upload-artifact@main
+ uses: bend-n/godot-builds/.github/actions/[email protected]
with:
path: ${{ env.tmps }}/templates.tpz
editor:
+ strategy:
+ matrix:
+ platform: [server, linuxbsd]
+
name: Linux editor
runs-on: ubuntu-20.04
steps:
- name: Compilation
- uses: bend-n/godot-builds/.github/actions/build-godot@main
+ uses: bend-n/godot-builds/.github/actions/[email protected]
with:
- platform: linuxbsd
- target: editor
+ platform: ${{ matrix.platform }}
+ target: release_debug
+ env:
+ tools: yes
+ flags: "" # override flags
- name: Upload artifact
- uses: bend-n/godot-builds/.github/actions/upload-artifact@main
+ uses: bend-n/godot-builds/.github/actions/[email protected]
with:
- name: linuxbsd-editor-release
- path: godot/bin/*.x86_64
+ name: ${{ matrix.platform }}-editor-release
+ path: godot/bin/*.64
image:
- if: inputs.make-release == 'yes'
permissions: write-all
name: Docker image
runs-on: ubuntu-latest
needs: [editor, templates]
steps:
- - uses: bend-n/godot-builds/.github/actions/build-upload-image@main
+ - uses: bend-n/godot-builds/.github/actions/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
name: ${{ inputs.name }}
release:
- if: inputs.make-release == 'yes'
name: Create/update a release
runs-on: ubuntu-latest
needs: [editor, templates]
steps:
- - uses: bend-n/godot-builds/.github/actions/release@main
+ - uses: bend-n/godot-builds/.github/actions/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
name: ${{ inputs.name }}
diff --git a/README.md b/README.md
index 1b4f114..2df9921 100755
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
# godot builds
-[![version](https://img.shields.io/badge/4.x-blue?logo=godot-engine&logoColor=white&label=godot&style=for-the-badge)](https://godotengine.org)
+[![version](https://img.shields.io/badge/3.5+-blue?logo=godot-engine&logoColor=white&label=godot&style=for-the-badge)](https://godotengine.org)
[![aur](https://img.shields.io/aur/version/godot2d?color=informative&logo=archlinux&logoColor=white&style=for-the-badge)](https://aur.archlinux.org/packages/godot2d "Aur package")
<a href='https://ko-fi.com/bendn' title='Buy me a coffee' target='_blank'><img height='28' src='https://ko-fi.com/img/githubbutton_sm.svg' alt='Buy me a coffee'> </a>
@@ -21,7 +21,7 @@ For a full example, see this [template](https://github.com/bend-n/godot-template
build-windows:
runs-on: ubuntu-latest
container:
- image: ghcr.io/bend-n/godot-2d:4.0
+ image: ghcr.io/bend-n/godot-2d:3.5
name: Build windows
steps:
- name: Build (Windows)
@@ -42,7 +42,7 @@ build-windows:
build-windows:
runs-on: ubuntu-latest
container:
- image: ghcr.io/bend-n/godot-2d:4.0
+ image: ghcr.io/bend-n/godot-2d:3.5
name: Build windows
steps:
- name: Checkout
@@ -50,7 +50,7 @@ build-windows:
- name: Setup godot
run: |
- RELEASE=stable; GODOT_VERSION=4.0.rc;
+ RELEASE=stable; GODOT_VERSION=3.5.stable;
mkdir -v -p ~/.local/share/godot/templates
mv /root/.local/share/godot/templates/${GODOT_VERSION}.${RELEASE} ~/.local/share/godot/templates/${GODOT_VERSION}.${RELEASE}
diff --git a/patches/fix_buffer_underrun.patch b/patches/fix_buffer_underrun.patch
deleted file mode 100644
index b429e09..0000000
--- a/patches/fix_buffer_underrun.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-From ff6378a52bc81692d4f3552fbbe5ad628ef1ab20 Mon Sep 17 00:00:00 2001
-From: Ellen Poe <[email protected]>
-Date: Mon, 10 Apr 2023 13:38:10 +0700
-Subject: [PATCH] Fix AudioStreamGenerator stopping playback after a buffer
- underrun
-
----
- servers/audio_server.cpp | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/servers/audio_server.cpp b/servers/audio_server.cpp
-index 0344bf322d68..5e71d7af0550 100644
---- a/servers/audio_server.cpp
-+++ b/servers/audio_server.cpp
-@@ -354,7 +354,7 @@ void AudioServer::_mix_step() {
- playback->stream_playback->tag_used_streams();
- }
-
-- if (mixed_frames != buffer_size) {
-+ if (!playback->stream_playback->is_playing()) {
- // We know we have at least the size of our lookahead buffer for fade-out purposes.
-
- float fadeout_base = 0.94;
-
diff --git a/patches/no-arg-handling.patch b/patches/no-arg-handling.patch
index 027f95f..1323545 100644
--- a/patches/no-arg-handling.patch
+++ b/patches/no-arg-handling.patch
@@ -1,261 +1,130 @@
-diff --git a/doc/classes/OS.xml b/doc/classes/OS.xml
-index 47f39aedf4..d020f52d74 100644
---- a/doc/classes/OS.xml
-+++ b/doc/classes/OS.xml
-@@ -176,7 +176,7 @@
- }
- [/csharp]
- [/codeblocks]
-- [b]Note:[/b] Passing custom user arguments directly is not recommended, as the engine may discard or modify them. Instead, the best way is to use the standard UNIX double dash ([code]--[/code]) and then pass custom arguments, which the engine itself will ignore. These can be read via [method get_cmdline_user_args].
-+ [b]Note:[/b] Most arguments will be ignored by godot in release templates, so passing custom user args will be safe. If you want to pass engine arguments like `--rendering-driver`, use the standard UNIX double dash ([code]--[/code]), and then pass your arguments, which the engine will then ignore. Arguments after [code]--[/code] are then accessible via [method get_cmdline_user_args].
- </description>
- </method>
- <method name="get_cmdline_user_args">
-@@ -185,9 +185,9 @@
- Similar to [method get_cmdline_args], but this returns the user arguments (any argument passed after the double dash [code]--[/code] or double plus [code]++[/code] argument). These are left untouched by Godot for the user. [code]++[/code] can be used in situations where [code]--[/code] is intercepted by another program (such as [code]startx[/code]).
- For example, in the command line below, [code]--fullscreen[/code] will not be returned in [method get_cmdline_user_args] and [code]--level 1[/code] will only be returned in [method get_cmdline_user_args]:
- [codeblock]
-- godot --fullscreen -- --level 1
-+ godot --display-driver vulkan -- --level 1
- # Or:
-- godot --fullscreen ++ --level 1
-+ godot --display-driver vulkan ++ --level 1
- [/codeblock]
- </description>
- </method>
diff --git a/main/main.cpp b/main/main.cpp
-index 5e0187cc7f..1f3b8aec6f 100644
+index 37ef4332..ecc30d7e 100644
--- a/main/main.cpp
+++ b/main/main.cpp
-@@ -166,19 +166,20 @@ static bool editor = false;
+@@ -128,7 +128,9 @@ static int audio_driver_idx = -1;
+ static bool editor = false;
static bool project_manager = false;
- static bool cmdline_tool = false;
static String locale;
--static bool show_help = false;
--static uint64_t quit_after = 0;
- static OS::ProcessID editor_pid = 0;
-+#if defined(TOOLS_ENABLED) || defined(DEBUG_ENABLED)
-+static uint64_t quit_after = 0;
-+static bool show_help = false;
-+static String debug_server_uri;
++#ifdef TOOLS_ENABLED
+ static bool show_help = false;
+#endif
- #ifdef TOOLS_ENABLED
-+HashMap<Main::CLIScope, Vector<String>> forwardable_cli_arguments;
- static bool found_project = false;
- static bool auto_build_solutions = false;
--static String debug_server_uri;
- #ifndef DISABLE_DEPRECATED
- static int converter_max_kb_file = 4 * 1024; // 4MB
- static int converter_max_line_length = 100000;
- #endif // DISABLE_DEPRECATED
--
--HashMap<Main::CLIScope, Vector<String>> forwardable_cli_arguments;
- #endif
- bool use_startup_benchmark = false;
- String startup_benchmark_file;
-@@ -331,6 +332,7 @@ void finalize_theme_db() {
+ static bool auto_quit = false;
+ static OS::ProcessID allow_focus_steal_pid = 0;
+ static bool delta_sync_after_draw = false;
+@@ -239,6 +241,7 @@ void finalize_navigation_server() {
#define MAIN_PRINT(m_txt)
#endif
-+#if defined(TOOLS_ENABLED) || defined(DEBUG_ENABLED)
++#ifdef TOOLS_ENABLED
void Main::print_help(const char *p_binary) {
print_line(String(VERSION_NAME) + " v" + get_full_version_string() + " - " + String(VERSION_WEBSITE));
OS::get_singleton()->print("Free and open source software under the terms of the MIT license.\n");
-@@ -468,6 +470,7 @@ void Main::print_help(const char *p_binary) {
- #endif
+@@ -256,11 +259,9 @@ void Main::print_help(const char *p_binary) {
OS::get_singleton()->print("\n");
+
+ OS::get_singleton()->print("Run options:\n");
+-#ifdef TOOLS_ENABLED
+ OS::get_singleton()->print(" -e, --editor Start the editor instead of running the scene.\n");
+ OS::get_singleton()->print(" -p, --project-manager Start the project manager, even if a project is auto-detected.\n");
+ OS::get_singleton()->print(" --debug-server <address> Start the editor debug server (<IP>:<port>, e.g. 127.0.0.1:6007)\n");
+-#endif
+ OS::get_singleton()->print(" -q, --quit Quit after the first iteration.\n");
+ OS::get_singleton()->print(" -l, --language <locale> Use a specific locale (<locale> being a two-letter code).\n");
+ OS::get_singleton()->print(" --path <directory> Path to a project (<directory> must contain a 'project.godot' file).\n");
+@@ -355,6 +356,7 @@ void Main::print_help(const char *p_binary) {
+ OS::get_singleton()->print(").\n");
+ #endif
}
+#endif
- #ifdef TESTS_ENABLED
- // The order is the same as in `Main::setup()`, only core and some editor types
-@@ -818,25 +821,26 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
-
- if (adding_user_args) {
- user_args.push_back(I->get());
-- } else if (I->get() == "-h" || I->get() == "--help" || I->get() == "/?") { // display help
-+ }
-+#if defined(TOOLS_ENABLED) || defined(DEBUG_ENABLED)
-+ else if (I->get() == "-h" || I->get() == "--help" || I->get() == "/?") { // display help
+ /* Engine initialization
+ *
+@@ -493,13 +495,22 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
+ #endif
+ List<String>::Element *N = I->next();
+-
++#ifdef TOOLS_ENABLED
+ if (I->get() == "-h" || I->get() == "--help" || I->get() == "/?") { // display help
+-
show_help = true;
exit_code = ERR_HELP; // Hack to force an early exit in `main()` with a success code.
goto error;
-
++#else
++ if (I->get() == "--main-pack") { // needed for JS bindings
++ if (I->next()) {
++ main_pack = I->next()->get();
++ N = I->next()->next();
++ } else {
++ OS::get_singleton()->print("Missing path to main pack file, aborting.\n");
++ goto error;
++ };
++#endif
++#ifdef TOOLS_ENABLED
} else if (I->get() == "--version") {
print_line(get_full_version_string());
exit_code = ERR_HELP; // Hack to force an early exit in `main()` with a success code.
- goto error;
--
- } else if (I->get() == "-v" || I->get() == "--verbose") { // verbose output
-
- OS::get_singleton()->_verbose_stdout = true;
- } else if (I->get() == "-q" || I->get() == "--quiet") { // quieter output
-
- quiet_stdout = true;
--
-- } else if (I->get() == "--audio-driver") { // audio driver
-+ }
-+#endif // important args
-+ else if (I->get() == "--audio-driver") { // audio driver
-
- if (I->next()) {
- audio_driver = I->next()->get();
-@@ -952,12 +956,6 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
- OS::get_singleton()->print("Missing GPU index argument, aborting.\n");
- goto error;
- }
-- } else if (I->get() == "--gpu-validation") {
-- Engine::singleton->use_validation_layers = true;
--#ifdef DEBUG_ENABLED
-- } else if (I->get() == "--gpu-abort") {
-- Engine::singleton->abort_on_gpu_errors = true;
--#endif
- } else if (I->get() == "--tablet-driver") {
- if (I->next()) {
- tablet_driver = I->next()->get();
-@@ -966,7 +964,16 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
- OS::get_singleton()->print("Missing tablet driver argument, aborting.\n");
- goto error;
- }
-- } else if (I->get() == "--single-window") { // force single window
-+ }
-+#if defined(TOOLS_ENABLED) || defined(DEBUG_ENABLED)
-+#ifdef DEBUG_ENABLED
-+ else if (I->get() == "--gpu-validation") {
-+ Engine::singleton->use_validation_layers = true;
-+ } else if (I->get() == "--gpu-abort") {
-+ Engine::singleton->abort_on_gpu_errors = true;
-+ }
-+#endif
-+ else if (I->get() == "--single-window") { // force single window
-
- single_window = true;
- } else if (I->get() == "-t" || I->get() == "--always-on-top") { // force always-on-top window
-@@ -1002,7 +1009,6 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
- OS::get_singleton()->print("Missing resolution argument, aborting.\n");
- goto error;
- }
--
- } else if (I->get() == "--screen") { // set window screen
-
- if (I->next()) {
-@@ -1014,7 +1020,6 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
- OS::get_singleton()->print("Missing screen argument, aborting.\n");
- goto error;
- }
--
- } else if (I->get() == "--position") { // set window position
-
- if (I->next()) {
-@@ -1038,16 +1043,13 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
- OS::get_singleton()->print("Missing position argument, aborting.\n");
+@@ -737,7 +748,6 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
+ OS::get_singleton()->print("Missing render thread mode argument, aborting.\n");
goto error;
}
--
- } else if (I->get() == "--headless") { // enable headless mode (no audio, no rendering).
+-#ifdef TOOLS_ENABLED
+ } else if (I->get() == "-e" || I->get() == "--editor") { // starts editor
- audio_driver = NULL_AUDIO_DRIVER;
- display_driver = NULL_DISPLAY_DRIVER;
--
- } else if (I->get() == "--profiling") { // enable profiling
+ editor = true;
+@@ -773,7 +783,6 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
- use_debug_profiler = true;
--
- } else if (I->get() == "-l" || I->get() == "--language") { // language
-
- if (I->next()) {
-@@ -1057,7 +1059,6 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
- OS::get_singleton()->print("Missing language argument, aborting.\n");
- goto error;
- }
--
- } else if (I->get() == "--remote-fs") { // remote filesystem
+ editor = true;
+ main_args.push_back(I->get());
+-#endif
+ } else if (I->get() == "--path") { // set path of project to start or edit
if (I->next()) {
-@@ -1238,7 +1239,6 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
- OS::get_singleton()->print("Missing list of breakpoints, aborting.\n");
- goto error;
+@@ -806,9 +815,7 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
+ } else {
+ project_path = path;
}
--
- } else if (I->get() == "--frame-delay") { // force frame delay
+-#ifdef TOOLS_ENABLED
+ editor = true;
+-#endif
+ } else if (I->get() == "-b" || I->get() == "--breakpoints") { // add breakpoints
if (I->next()) {
-@@ -1248,7 +1248,6 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
- OS::get_singleton()->print("Missing frame delay argument, aborting.\n");
+@@ -840,15 +847,6 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
goto error;
}
--
- } else if (I->get() == "--time-scale") { // force time scale
- if (I->next()) {
-@@ -1258,8 +1257,9 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
- OS::get_singleton()->print("Missing time scale argument, aborting.\n");
- goto error;
- }
--
- } else if (I->get() == "--main-pack") {
-+ }
-+#endif // essential arg for html builds
-+ else if (I->get() == "--main-pack") {
- if (I->next()) {
- main_pack = I->next()->get();
- N = I->next()->next();
-@@ -1267,12 +1267,14 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
- OS::get_singleton()->print("Missing path to main pack file, aborting.\n");
- goto error;
- };
--
-- } else if (I->get() == "-d" || I->get() == "--debug") {
-+ }
-+#if defined(TOOLS_ENABLED) || defined(DEBUG_ENABLED)
-+ else if (I->get() == "-d" || I->get() == "--debug") {
- debug_uri = "local://";
+- if (I->next()) {
+- main_pack = I->next()->get();
+- N = I->next()->next();
+- } else {
+- OS::get_singleton()->print("Missing path to main pack file, aborting.\n");
+- goto error;
+- };
+-
+ } else if (I->get() == "-d" || I->get() == "--debug") {
+ debug_mode = "local";
OS::get_singleton()->_debug_stdout = true;
-+ }
- #if defined(DEBUG_ENABLED)
-- } else if (I->get() == "--debug-collisions") {
-+ else if (I->get() == "--debug-collisions") {
- debug_collisions = true;
- } else if (I->get() == "--debug-paths") {
- debug_paths = true;
-@@ -1352,7 +1354,6 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
- OS::get_singleton()->print("Missing --xr-mode argument, aborting.\n");
- goto error;
- }
--
- } else if (I->get() == "--startup-benchmark") {
- use_startup_benchmark = true;
- } else if (I->get() == "--startup-benchmark-file") {
-@@ -1364,24 +1365,21 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
- OS::get_singleton()->print("Missing <path> argument for --startup-benchmark-file <path>.\n");
- goto error;
- }
--
-- } else if (I->get() == "--" || I->get() == "++") {
-+ }
+@@ -897,6 +895,7 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
+ OS::get_singleton()->disable_crash_handler();
+ } else if (I->get() == "--skip-breakpoints") {
+ skip_breakpoints = true;
+#endif
-+ else if (I->get() == "--" || I->get() == "++") {
- adding_user_args = true;
} else {
main_args.push_back(I->get());
}
--
- I = N;
- }
--
- #ifdef TOOLS_ENABLED
- if (editor && project_manager) {
- OS::get_singleton()->print(
- "Error: Command line arguments implied opening both editor and project manager, which is not possible. Aborting.\n");
+@@ -909,7 +908,6 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
+ OS::get_singleton()->print("Error: Command line arguments implied opening both editor and project manager, which is not possible. Aborting.\n");
goto error;
}
-#endif
--
+
// Network file system needs to be configured before globals, since globals are based on the
// 'project.godot' file which will only be available through the network if this is enabled
- FileAccessNetwork::configure();
-@@ -1403,7 +1401,7 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
+@@ -932,7 +930,7 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
FileAccess::make_default<FileAccessNetwork>(FileAccess::ACCESS_RESOURCES);
}
@@ -264,27 +133,45 @@ index 5e0187cc7f..1f3b8aec6f 100644
if (globals->setup(project_path, main_pack, upwards, editor) == OK) {
#ifdef TOOLS_ENABLED
found_project = true;
-@@ -1910,9 +1908,11 @@ error:
+@@ -1001,12 +999,6 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
+ if (editor) {
+ packed_data->set_disabled(true);
+ globals->set_disable_feature_overrides(true);
+- }
+-
+-#endif
+-
+-#ifdef TOOLS_ENABLED
+- if (editor) {
+ Engine::get_singleton()->set_editor_hint(true);
+ main_args.push_back("--editor");
+ if (!init_windowed) {
+@@ -1281,7 +1273,6 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
+ return OK;
+
+ error:
+-
+ video_driver = "";
+ audio_driver = "";
+ tablet_driver = "";
+@@ -1290,9 +1281,11 @@ error:
args.clear();
main_args.clear();
-+#if defined(TOOLS_ENABLED) || defined(DEBUG_ENABLED)
++#ifdef TOOLS_ENABLED
if (show_help) {
print_help(execpath);
}
+#endif
- EngineDebugger::deinitialize();
+ if (performance) {
+ memdelete(performance);
+@@ -1338,7 +1331,7 @@ error:
-@@ -3311,9 +3311,11 @@ bool Main::iteration() {
- movie_writer->add_frame(vp_tex);
- }
-
-+#if defined(TOOLS_ENABLED) || defined(DEBUG_ENABLED)
- if ((quit_after > 0) && (Engine::get_singleton()->_process_frames >= quit_after)) {
- exit = true;
- }
-+#endif
+ Error Main::setup2(Thread::ID p_main_tid_override) {
+ // Print engine name and version
+- print_line(String(VERSION_NAME) + " v" + get_full_version_string() + " - " + String(VERSION_WEBSITE));
++ print_line("v" + get_full_version_string());
- if (fixed_fps != -1) {
- return exit;
+ #if !defined(NO_THREADS)
+ if (p_main_tid_override) {
diff --git a/patches/no-touchpad-gamepad.patch b/patches/no-touchpad-gamepad.patch
deleted file mode 100644
index 41116af..0000000
--- a/patches/no-touchpad-gamepad.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-From bc17abceea50eafee49824b8d93fbc2a94facc26 Mon Sep 17 00:00:00 2001
-From: Marcel Admiraal <[email protected]>
-Date: Tue, 22 Mar 2022 11:20:17 +0000
-Subject: [PATCH] Improve detection of gamepads on Linux
-
-Requires gamepads to have a right x and y axis.
----
- platform/linuxbsd/joypad_linux.cpp | 5 ++---
- 1 file changed, 2 insertions(+), 3 deletions(-)
-
-diff --git a/platform/linuxbsd/joypad_linux.cpp b/platform/linuxbsd/joypad_linux.cpp
-index 65d53b266f7d..475107293f31 100644
---- a/platform/linuxbsd/joypad_linux.cpp
-+++ b/platform/linuxbsd/joypad_linux.cpp
-@@ -333,9 +333,8 @@ void JoypadLinux::open_joypad(const char *p_path) {
- }
-
- // Check if the device supports basic gamepad events
-- bool has_abs_left = (test_bit(ABS_X, absbit) && test_bit(ABS_Y, absbit));
-- bool has_abs_right = (test_bit(ABS_RX, absbit) && test_bit(ABS_RY, absbit));
-- if (!(test_bit(EV_KEY, evbit) && test_bit(EV_ABS, evbit) && (has_abs_left || has_abs_right))) {
-+ if (!(test_bit(EV_KEY, evbit) && test_bit(EV_ABS, evbit) &&
-+ test_bit(ABS_RX, absbit) && test_bit(ABS_RY, absbit))) {
- close(fd);
- return;
- }