From d318d7b5f927fedd1d1b13ec684759ff8d6eae29 Mon Sep 17 00:00:00 2001 From: vaporvee Date: Tue, 27 Feb 2024 18:38:55 +0100 Subject: [PATCH] threw git submodules away because of lack of features --- .gitignore | 4 +++- .gitmodules | 4 ---- setup.py | 23 +++++++++++++++++++---- src/lib/godot-cpp | 1 - 4 files changed, 22 insertions(+), 10 deletions(-) delete mode 100644 .gitmodules delete mode 160000 src/lib/godot-cpp diff --git a/.gitignore b/.gitignore index afbc092..4631f90 100644 --- a/.gitignore +++ b/.gitignore @@ -19,8 +19,10 @@ build/ *.exp *.lib -#Clean files from the Game SDK +#Clean files from setup.py src/lib/discord_game_sdk/ +src/lib/godot-cpp/ +src/lib/godot-cpp.zip # release.py release/ diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index 8c61246..0000000 --- a/.gitmodules +++ /dev/null @@ -1,4 +0,0 @@ -[submodule "src/lib/godot-cpp"] - path = src/lib/godot-cpp - url = https://github.com/godotengine/godot-cpp - branch = 4.1 diff --git a/setup.py b/setup.py index 4bd416f..3145923 100644 --- a/setup.py +++ b/setup.py @@ -3,11 +3,28 @@ from distutils.dir_util import copy_tree import shutil import os import sys +import urllib.request +godot_cpp_url = "https://github.com/godotengine/godot-cpp/archive/refs/tags/godot-4.1.2-stable.zip" + +godot_cpp_download_path = "src/lib/godot-cpp.zip" + +urllib.request.urlretrieve(godot_cpp_url, godot_cpp_download_path) + +print(f"Downloaded godot-cpp to {godot_cpp_download_path}") + +godot_cpp_zip_file_path = "src/lib/godot-cpp.zip" +godot_cpp_destination_dir = "src/lib/godot-cpp/" +os.makedirs(godot_cpp_destination_dir, exist_ok=True) +with zipfile.ZipFile(godot_cpp_zip_file_path, 'r') as zip_ref: + files_to_extract = [f for f in zip_ref.namelist() if f.startswith('godot-cpp-godot-4.1.2-stable/')] + for file in files_to_extract: + adjusted_path = file.replace('godot-cpp-godot-4.1.2-stable/', '', 1) + zip_ref.extract(file, godot_cpp_destination_dir + adjusted_path) + +print("Extracted godot-cpp-godot-4.1.2-stable to src/lib/godot-cpp/") with zipfile.ZipFile("src/lib/discord_game_sdk.zip", "r") as zip_ref: zip_ref.extractall("src/lib/discord_game_sdk/") - -# Patch the SDK to actually build, since it's missing an include with open("src/lib/discord_game_sdk/cpp/types.h", "r+") as f: s = f.read() f.seek(0) @@ -53,5 +70,3 @@ if sys.platform == "darwin": # Remove the ones it's made of os.remove("src/lib/discord_game_sdk/bin/discord_game_sdk.dylib") os.remove("src/lib/discord_game_sdk/bin/discord_game_sdk_aarch64.dylib") - -os.system("git submodule update --init --remote") diff --git a/src/lib/godot-cpp b/src/lib/godot-cpp deleted file mode 160000 index 4b63d79..0000000 --- a/src/lib/godot-cpp +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 4b63d795e4279838d988399f008eec47eb2dcc7f