From 326c2a51c6bb6d05026ac04cf764b38a3e028359 Mon Sep 17 00:00:00 2001 From: Aetias Date: Thu, 6 Feb 2025 18:15:25 +0100 Subject: [PATCH] Auto-install wibo --- .gitignore | 1 + INSTALL.md | 3 +-- tools/configure.py | 2 +- tools/setup.py | 10 ++++++++++ 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 14723773..b510ca5d 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,4 @@ objdiff.json build.ninja .ninja_log* .ninja_lock +/wibo diff --git a/INSTALL.md b/INSTALL.md index 6d4acc03..5f694513 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -16,7 +16,6 @@ Contents: - Python 3.11+ and pip - GCC 9+ - Ninja - - **On Linux**: Wine/Wibo 3. Install the Python dependencies: ```shell python -m pip install -r tools/requirements.txt @@ -38,7 +37,7 @@ python tools/configure.py > Rerun `configure.py` often to ensure that all C/C++ code gets compiled. > [!NOTE] -> For Linux users: If you plan to use Wibo instead of Wine, run `configure.py` with `-w `. +> For Linux users: Wibo is used by default. If you want to use Wine instead, run `configure.py` with `-w `. 7. Put one or more base ROMs in the [`/extract/`](/extract/README.md) directory of this repository. Now you can run `ninja` to build a ROM for the chosen version. diff --git a/tools/configure.py b/tools/configure.py index 7f2c5b26..5ab6329d 100644 --- a/tools/configure.py +++ b/tools/configure.py @@ -10,7 +10,7 @@ import ninja_syntax parser = argparse.ArgumentParser(description="Generates build.ninja") -parser.add_argument('-w', type=str, default="wine", dest="wine", required=False, help="Path to Wine (linux only)") +parser.add_argument('-w', type=str, default="wibo", dest="wine", required=False, help="Path to Wine (linux only)") parser.add_argument('version', help='Game version') args = parser.parse_args() diff --git a/tools/setup.py b/tools/setup.py index 1af78e32..f81ca25d 100644 --- a/tools/setup.py +++ b/tools/setup.py @@ -6,6 +6,7 @@ import platform import stat DSD_VERSION = 'v0.4.0' +WIBO_VERSION = '0.6.16' tools_path = Path(__file__).parent @@ -42,3 +43,12 @@ response = requests.get('http://decomp.aetias.com/files/mwccarm.zip') zip_file = zipfile.ZipFile(io.BytesIO(response.content)) zip_file.extractall(tools_path) + +if system == "linux": + print('\nInstalling wibo...') + response = requests.get(f'https://github.com/decompals/wibo/releases/download/{WIBO_VERSION}/wibo') + wibo_path = root_path / 'wibo' + with open(wibo_path, 'wb') as f: + f.write(response.content) + wibo_path.chmod(wibo_path.stat().st_mode | stat.S_IEXEC) +