Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build script update #12

Merged
merged 3 commits into from
Jul 22, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
20 changes: 11 additions & 9 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,16 @@
appimagetool_ver = "13"

lib_hashes = { # sha-256
"SDL2-2.0.22.tar.gz": "fe7cbf3127882e3fc7259a75a0cb585620272c51745d3852ab9dd87960697f2e",
"SDL2-2.0.22.dmg": "72974672b8359057aa2f6d467c8adae8182a6caedd660e3936e23c3c683c3801",
"SDL2-devel-2.0.22-VC.zip": "96e99fe1273c084d19dc190a0db6caeb4d4dcbc0713eb86b36c5ca8e3dd8c783",
"appimagetool-x86_64.AppImage": "df3baf5ca5facbecfc2f3fa6713c29ab9cefa8fd8c1eac5d283b79cab33e4acb", # appimagetool v13
"SDL2-2.0.22.tar.gz": "fe7cbf3127882e3fc7259a75a0cb585620272c51745d3852ab9dd87960697f2e",
"SDL2-2.0.22.dmg": "72974672b8359057aa2f6d467c8adae8182a6caedd660e3936e23c3c683c3801",
"SDL2-devel-2.0.22-VC.zip": "32adc96d8b25e5671189f1f38a4fc7deb105fbb1b3ed78ffcb23f5b8f36b3922",
"appimagetool-x86_64.AppImage": "df3baf5ca5facbecfc2f3fa6713c29ab9cefa8fd8c1eac5d283b79cab33e4acb", # appimagetool v13
"appimagetool-aarch64.AppImage": "334e77beb67fc1e71856c29d5f3f324ca77b0fde7a840fdd14bd3b88c25c341f",
}

NPROC = multiprocessing.cpu_count()
SYSTEM = platform.system()
MACHINE = platform.machine()

if SYSTEM == "Windows":
os.system("") # hack to get ANSI color escapes to work
Expand Down Expand Up @@ -184,7 +186,7 @@ def zipdir(zipname, topleveldir, arc_topleveldir):
def prepare_dependencies_windows():
rmtree_if_exists(F"{libs_dir}/SDL2-{sdl_ver}")

sdl_zip_path = get_package(F"http://libsdl.org/release/SDL2-devel-{sdl_ver}-VC.zip")
sdl_zip_path = get_package(F"https://libsdl.org/release/SDL2-devel-{sdl_ver}-VC.zip")
shutil.unpack_archive(sdl_zip_path, libs_dir)

def prepare_dependencies_macos():
Expand All @@ -193,7 +195,7 @@ def prepare_dependencies_macos():

rmtree_if_exists(sdl2_framework_target_path)

sdl_dmg_path = get_package(F"http://libsdl.org/release/SDL2-{sdl_ver}.dmg")
sdl_dmg_path = get_package(F"https://libsdl.org/release/SDL2-{sdl_ver}.dmg")

# Mount the DMG and copy SDL2.framework to extern/
with tempfile.TemporaryDirectory() as mount_point:
Expand All @@ -212,7 +214,7 @@ def prepare_dependencies_linux():
sdl_build_dir = F"{sdl_source_dir}/build"
rmtree_if_exists(sdl_source_dir)

sdl_zip_path = get_package(F"http://libsdl.org/release/SDL2-{sdl_ver}.tar.gz")
sdl_zip_path = get_package(F"https://libsdl.org/release/SDL2-{sdl_ver}.tar.gz")
shutil.unpack_archive(sdl_zip_path, libs_dir)

with chdir(sdl_source_dir):
Expand All @@ -228,7 +230,7 @@ def get_artifact_name():
elif SYSTEM == "Darwin":
return F"{game_name}-{game_ver}-mac.dmg"
elif SYSTEM == "Linux":
return F"{game_name}-{game_ver}-linux-x86_64.AppImage"
return F"{game_name}-{game_ver}-linux-{MACHINE}.AppImage"
else:
die("Unknown system for print_artifact_name")

Expand Down Expand Up @@ -283,7 +285,7 @@ def package_macos(proj: Project):
F"{dist_dir}/{get_artifact_name()}"])

def package_linux(proj):
appimagetool_path = get_package(F"https://github.com/AppImage/AppImageKit/releases/download/{appimagetool_ver}/appimagetool-x86_64.AppImage")
appimagetool_path = get_package(F"https://github.com/AppImage/AppImageKit/releases/download/{appimagetool_ver}/appimagetool-{MACHINE}.AppImage")
os.chmod(appimagetool_path, 0o755)

appdir = F"{cache_dir}/{game_name}-{game_ver}.AppDir"
Expand Down