diff --git a/build_patch/patch.diff b/build_patch/patch.diff new file mode 100644 index 0000000..c18a321 --- /dev/null +++ b/build_patch/patch.diff @@ -0,0 +1,29 @@ +233a234 +> import os # @UnresolvedImport +236a238,263 +> +> # MODS STUFF +> APP_ID = 1895350 +> +> if not renpy.android: +> try: # Android will try to run this for some reason and fail +> mod_paths = [ +> f"../../workshop/content/{APP_ID}/", +> f"/Users/{os.getlogin()}/Library/Application Support/Steam/steamapps/workshop/content/{APP_ID}/", +> os.path.expanduser(f"~/Library/Application Support/Steam/steamapps/workshop/content/{APP_ID}/") +> ] +> except: +> mod_paths = [] +> +> new_paths = [] +> for path in mod_paths: +> try: +> if os.path.exists(path): +> for name in os.listdir(path): +> full_path = os.path.join(path, name) +> if os.path.isdir(full_path): +> new_paths.append(full_path) +> except Exception as e: +> renpy.display.log.write(f"Error while adding mod search paths: {e}") +> +> searchpath += new_paths diff --git a/build_patch/patch.py b/build_patch/patch.py new file mode 100644 index 0000000..6015aa5 --- /dev/null +++ b/build_patch/patch.py @@ -0,0 +1,19 @@ +class PatchTask: + def __init__(self, config, input_dir, output_dir): + self.config = config + self.input_dir = input_dir + self.output_dir = output_dir + + def pre_build(self): + import subprocess + print("================Initiating patching==================") + + try: + subprocess.run(["patch", f"/tmp/cache/{self.config['ver']}/renpy.py", "./build_patch/patch.diff"]) + except Exception as e: + print(e) + raise e + print("================File Patched==================") + + def post_build(self): + pass diff --git a/renconstruct.toml b/renconstruct.toml index da3563c..e3646c4 100644 --- a/renconstruct.toml +++ b/renconstruct.toml @@ -25,6 +25,7 @@ [options] clear_output_dir = false # whether to clear the output directory on startup + task_dir = "./build_patch/" [renutil] version = "8.2.3" # the Ren'Py version to use (required)