Skip to content

Commit

Permalink
Fixed build and added support for arm64 builds.
Browse files Browse the repository at this point in the history
  • Loading branch information
ExpiredPopsicle committed Oct 27, 2024
1 parent e5687d5 commit 7dab6bf
Show file tree
Hide file tree
Showing 5 changed files with 77 additions and 64 deletions.
17 changes: 11 additions & 6 deletions Build/DownloadPythonRequirements.gd
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand All @@ -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.

Expand Down
12 changes: 8 additions & 4 deletions Build/build.bsh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
10 changes: 8 additions & 2 deletions addons/KiriPythonRPCWrapper/KiriPythonBuildExportPlugin.gd
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
14 changes: 7 additions & 7 deletions addons/KiriPythonRPCWrapper/platform_status.json
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -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"
}
}
88 changes: 43 additions & 45 deletions export_presets.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[preset.0]

name="Linux/X11"
name="Linux-x86_64"
platform="Linux"
runnable=true
advanced_options=false
Expand Down Expand Up @@ -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
Expand All @@ -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=""
Expand Down Expand Up @@ -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)

0 comments on commit 7dab6bf

Please sign in to comment.