From 7dab6bf93b0175ff7c9c255a0ecd3b2ed9a3f9b6 Mon Sep 17 00:00:00 2001 From: Kiri Date: Sun, 27 Oct 2024 16:18:18 -0700 Subject: [PATCH] Fixed build and added support for arm64 builds. --- Build/DownloadPythonRequirements.gd | 17 ++-- Build/build.bsh | 12 ++- .../KiriPythonBuildExportPlugin.gd | 10 ++- .../KiriPythonRPCWrapper/platform_status.json | 14 +-- export_presets.cfg | 88 +++++++++---------- 5 files changed, 77 insertions(+), 64 deletions(-) diff --git a/Build/DownloadPythonRequirements.gd b/Build/DownloadPythonRequirements.gd index a346a75..062ccbc 100644 --- a/Build/DownloadPythonRequirements.gd +++ b/Build/DownloadPythonRequirements.gd @@ -12,14 +12,16 @@ func _initialize(): func _process(_delta): if frame_count == 0: + frame_count += 1 # Instantiate the updater. updater = load("res://addons/KiriPythonRPCWrapper/UpdateUI/PythonBuildUpdateUI.tscn").instantiate() root.add_child(updater) # Start Python downloads per-platform. - updater._start_github_download("Windows") - updater._start_github_download("Linux") + updater._start_github_download("Windows-x86_64") + updater._start_github_download("Linux-x86_64") + updater._start_github_download("Linux-arm64") # FIXME: MacOS. for platform in updater._current_downloads.keys(): @@ -33,14 +35,17 @@ func _process(_delta): quit(1)) # FIXME: Add MacOS. - if updater._check_platform_file_ready("Windows") and \ - updater._check_platform_file_ready("Linux"): + if updater._check_platform_file_ready("Windows-x86_64") and \ + updater._check_platform_file_ready("Linux-x86_64") and \ + updater._check_platform_file_ready("Linux-arm64"): # Download pip requirements. var succeeded = true - if not updater.download_platform_requirements("Windows", true): + if not updater.download_platform_requirements("Windows-x86_64", true): succeeded = false - if not updater.download_platform_requirements("Linux", true): + if not updater.download_platform_requirements("Linux-x86_64", true): + succeeded = false + if not updater.download_platform_requirements("Linux-arm64", true): succeeded = false # FIXME: MacOS. diff --git a/Build/build.bsh b/Build/build.bsh index 5b0239e..86e256e 100755 --- a/Build/build.bsh +++ b/Build/build.bsh @@ -69,17 +69,21 @@ source Build/build_vars.sh # Actually do the builds. "${GODOT}" --headless --path . \ - --export-release "Linux/X11" Build/Builds/SnekStudio_Linux/snekstudio + --export-release "Linux-x86_64" Build/Builds/SnekStudio_Linux-x86_64/snekstudio "${GODOT}" --headless --path . \ - --export-debug "Windows Desktop" Build/Builds/SnekStudio_Windows/snekstudio.exe + --export-release "Linux-arm64" Build/Builds/SnekStudio_Linux-arm64/snekstudio + +"${GODOT}" --headless --path . \ + --export-debug "Windows-x86_64" Build/Builds/SnekStudio_Windows-x86_64/snekstudio.exe # Package them. pushd . cd Build/Builds -tar czvf "SnekStudio_Linux_${VERSION}.tar.gz" SnekStudio_Linux -zip -r "SnekStudio_Windows_${VERSION}.zip" SnekStudio_Windows +tar czvf "SnekStudio_Linux-x86_64_${VERSION}.tar.gz" SnekStudio_Linux-x86_64 +tar czvf "SnekStudio_Linux-arm64_${VERSION}.tar.gz" SnekStudio_Linux-arm64 +zip -r "SnekStudio_Windows-x86_64_${VERSION}.zip" SnekStudio_Windows-x86_64 # Make the output directory diff --git a/addons/KiriPythonRPCWrapper/KiriPythonBuildExportPlugin.gd b/addons/KiriPythonRPCWrapper/KiriPythonBuildExportPlugin.gd index 7ce8720..16f7a6a 100644 --- a/addons/KiriPythonRPCWrapper/KiriPythonBuildExportPlugin.gd +++ b/addons/KiriPythonRPCWrapper/KiriPythonBuildExportPlugin.gd @@ -19,10 +19,16 @@ func _export_begin( var platform_list = [] + print("Export features: ", features) + if "linux" in features: - platform_list.append("Linux") + if "x86_64" in features: + platform_list.append("Linux-x86_64") + if "arm64" in features: + platform_list.append("Linux-arm64") if "windows" in features: - platform_list.append("Windows") + if "x86_64" in features: + platform_list.append("Windows-x86_64") # FIXME: MacOS stuff? for platform in platform_list: diff --git a/addons/KiriPythonRPCWrapper/platform_status.json b/addons/KiriPythonRPCWrapper/platform_status.json index 55cc9a8..aac938e 100644 --- a/addons/KiriPythonRPCWrapper/platform_status.json +++ b/addons/KiriPythonRPCWrapper/platform_status.json @@ -1,17 +1,17 @@ { "platforms": { - "Linux-x86_64": { - "complete_filename": "cpython-3.12.5+20240814-x86_64-unknown-linux-gnu-install_only_stripped.tar.gz", - "download_url": "https://github.com/indygreg/python-build-standalone/releases/download/20240814/cpython-3.12.5%2B20240814-x86_64-unknown-linux-gnu-install_only_stripped.tar.gz", - "file_size": 21984711, - "sort": "cpython-00000003-00000012-00000005-20240814-x86_64-unknown-linux-gnu-install_only_stripped-tar-gz" - }, "Linux-arm64": { "complete_filename": "cpython-3.12.7+20241016-aarch64-unknown-linux-gnu-install_only_stripped.tar.gz", "download_url": "https://github.com/indygreg/python-build-standalone/releases/download/20241016/cpython-3.12.7%2B20241016-aarch64-unknown-linux-gnu-install_only_stripped.tar.gz", "file_size": 17865102, "sort": "cpython-00000003-00000012-00000007-20241016-aarch64-unknown-linux-gnu-install_only_stripped-tar-gz" }, + "Linux-x86_64": { + "complete_filename": "cpython-3.12.5+20240814-x86_64-unknown-linux-gnu-install_only_stripped.tar.gz", + "download_url": "https://github.com/indygreg/python-build-standalone/releases/download/20240814/cpython-3.12.5%2B20240814-x86_64-unknown-linux-gnu-install_only_stripped.tar.gz", + "file_size": 21984711, + "sort": "cpython-00000003-00000012-00000005-20240814-x86_64-unknown-linux-gnu-install_only_stripped-tar-gz" + }, "Windows-x86_64": { "complete_filename": "cpython-3.12.5+20240814-x86_64-pc-windows-msvc-shared-install_only_stripped.tar.gz", "download_url": "https://github.com/indygreg/python-build-standalone/releases/download/20240814/cpython-3.12.5%2B20240814-x86_64-pc-windows-msvc-shared-install_only_stripped.tar.gz", @@ -26,4 +26,4 @@ } }, "requirements": "mediapipe==0.10.14\npsutil==6.0.0\ncv2-enumerate-cameras==1.1.10\nnumpy==1.26.0\n\n" -} +} \ No newline at end of file diff --git a/export_presets.cfg b/export_presets.cfg index 722e422..1755037 100644 --- a/export_presets.cfg +++ b/export_presets.cfg @@ -1,6 +1,6 @@ [preset.0] -name="Linux/X11" +name="Linux-x86_64" platform="Linux" runnable=true advanced_options=false @@ -45,7 +45,47 @@ debug/export_console_script=1 [preset.1] -name="Windows Desktop" +name="Linux-arm64" +platform="Linux" +runnable=false +advanced_options=false +dedicated_server=false +custom_features="" +export_filter="all_resources" +include_filter="" +exclude_filter="" +export_path="../Build/SnekStudio.arm64" +encryption_include_filters="" +encryption_exclude_filters="" +encrypt_pck=false +encrypt_directory=false +script_export_mode=2 + +[preset.1.options] + +custom_template/debug="" +custom_template/release="" +debug/export_console_wrapper=1 +binary_format/embed_pck=false +texture_format/s3tc_bptc=true +texture_format/etc2_astc=true +binary_format/architecture="arm64" +ssh_remote_deploy/enabled=false +ssh_remote_deploy/host="user@host_ip" +ssh_remote_deploy/port="22" +ssh_remote_deploy/extra_args_ssh="" +ssh_remote_deploy/extra_args_scp="" +ssh_remote_deploy/run_script="#!/usr/bin/env bash +export DISPLAY=:0 +unzip -o -q \"{temp_dir}/{archive_name}\" -d \"{temp_dir}\" +\"{temp_dir}/{exe_name}\" {cmd_args}" +ssh_remote_deploy/cleanup_script="#!/usr/bin/env bash +kill $(pgrep -x -f \"{temp_dir}/{exe_name} {cmd_args}\") +rm -rf \"{temp_dir}\"" + +[preset.2] + +name="Windows-x86_64" platform="Windows Desktop" runnable=true advanced_options=false @@ -61,7 +101,7 @@ encrypt_pck=false encrypt_directory=false script_export_mode=2 -[preset.1.options] +[preset.2.options] custom_template/debug="" custom_template/release="" @@ -112,45 +152,3 @@ texture_format/s3tc=true texture_format/etc=false texture_format/etc2=false debug/export_console_script=1 - -[preset.2] - -name="Web" -platform="Web" -runnable=true -advanced_options=false -dedicated_server=false -custom_features="" -export_filter="all_resources" -include_filter="" -exclude_filter="" -export_path="" -encryption_include_filters="" -encryption_exclude_filters="" -encrypt_pck=false -encrypt_directory=false -script_export_mode=2 - -[preset.2.options] - -custom_template/debug="" -custom_template/release="" -variant/extensions_support=false -variant/thread_support=false -vram_texture_compression/for_desktop=true -vram_texture_compression/for_mobile=false -html/export_icon=true -html/custom_html_shell="" -html/head_include="" -html/canvas_resize_policy=2 -html/focus_canvas_on_start=true -html/experimental_virtual_keyboard=false -progressive_web_app/enabled=false -progressive_web_app/ensure_cross_origin_isolation_headers=true -progressive_web_app/offline_page="" -progressive_web_app/display=1 -progressive_web_app/orientation=0 -progressive_web_app/icon_144x144="" -progressive_web_app/icon_180x180="" -progressive_web_app/icon_512x512="" -progressive_web_app/background_color=Color(0, 0, 0, 1)