Updated Makefile and build instructions

This commit is contained in:
Campbell 2024-11-15 19:05:29 -05:00
parent 71450b5204
commit 42fc37de65
Signed by: NinjaCheetah
GPG Key ID: 670C282B3291D63D
3 changed files with 21 additions and 22 deletions

View File

@ -1,5 +1,4 @@
# This workflow will install Python dependencies, run tests and lint with a single version of Python # This workflow will install Python dependencies and then build WiiPy for all platforms
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
name: Python application name: Python application
@ -30,8 +29,7 @@ jobs:
python -m pip install --upgrade pip python -m pip install --upgrade pip
pip install -r requirements.txt pip install -r requirements.txt
- name: Build Application - name: Build Application
run: | run: make all
python -m nuitka --show-progress --assume-yes-for-downloads --onefile wiipy.py --onefile-tempdir-spec="{CACHE_DIR}/NinjaCheetah/WiiPy" -o wiipy
- name: Prepare Package for Upload - name: Prepare Package for Upload
run: | run: |
mv wiipy ~/wiipy mv wiipy ~/wiipy
@ -58,8 +56,7 @@ jobs:
python -m pip install --upgrade pip python -m pip install --upgrade pip
pip install -r requirements.txt pip install -r requirements.txt
- name: Build Application - name: Build Application
run: | run: make all
python -m nuitka --show-progress --assume-yes-for-downloads --onefile wiipy.py --onefile-tempdir-spec="{CACHE_DIR}/NinjaCheetah/WiiPy" -o wiipy
- name: Prepare Package for Upload - name: Prepare Package for Upload
run: | run: |
mv wiipy ~/wiipy mv wiipy ~/wiipy
@ -88,8 +85,7 @@ jobs:
python -m pip install --upgrade pip python -m pip install --upgrade pip
pip install -r requirements.txt pip install -r requirements.txt
- name: Build Application - name: Build Application
run: | run: .\Build.ps1
python -m nuitka --show-progress --assume-yes-for-downloads --onefile wiipy.py --onefile-tempdir-spec="{CACHE_DIR}/NinjaCheetah/WiiPy"
- name: Upload Application - name: Upload Application
uses: actions/upload-artifact@v4.3.0 uses: actions/upload-artifact@v4.3.0
with: with:

View File

@ -1,9 +1,9 @@
CC=python -m nuitka CC=python -m nuitka
linux: all:
$(CC) --show-progress --assume-yes-for-downloads --onefile wiipy.py --onefile-tempdir-spec="{CACHE_DIR}/NinjaCheetah/WiiPy" -o wiipy $(CC) --show-progress --assume-yes-for-downloads --onefile wiipy.py --onefile-tempdir-spec="{CACHE_DIR}/NinjaCheetah/WiiPy" -o wiipy
linux-install: install:
install wiipy /usr/bin/ install wiipy /usr/bin/
clean: clean:

View File

@ -18,7 +18,7 @@ pip install -r requirements.txt
## Usage ## Usage
Basic usage for WiiPy is very simple. Basic usage for WiiPy is very simple.
```shell ```shell
python3 wiipy.py <subcommand> python3 wiipy.py <command>
``` ```
You can use `--help` to see a list of all commands, or use `<command> --help` to see usage instructions for that command. This also applies to subcommands, with the syntax `<command> <subcommand> --help`. You can use `--help` to see a list of all commands, or use `<command> --help` to see usage instructions for that command. This also applies to subcommands, with the syntax `<command> <subcommand> --help`.
@ -26,24 +26,27 @@ Available subcommands will expand as support for more features are added into li
## Compiling ## Compiling
If you'd like to compile WiiPy from Python into something a little more native, you can use one of the following commands. Make sure you've installed Nuitka first (it's included in `requirements.txt`). If you'd like to compile WiiPy from Python into something a little more native, you can use one of the following commands. Make sure that you're in your venv, and that you've installed Nuitka first (it's included in `requirements.txt`).
```shell
python -m nuitka --show-progress --assume-yes-for-downloads --onefile wiipy.py
```
On macOS and Linux, this will give you a binary named `wiipy.bin` in the same directory as the Python file. On Windows, you'll get a binary named `wiipy.exe` instead.
### For Linux Users:
A Makefile has been included to both build and install WiiPy on Linux. This will install `wiipy` to `/usr/bin/`.
First, use make to build WiiPy (this automates the step above): ### Linux and macOS
A Makefile is available to both build and install WiiPy on Linux and macOS. This will give you an executable named `wiipy` in the root of the project directory.
```shell ```shell
make linux make all
``` ```
Then, run the install command with `sudo` (or your favorite alternative): Optionally, you can install WiiPy so that it's available system-wide. This will install it into `/usr/bin/`.
```shell ```shell
sudo make linux-install sudo make install
``` ```
### Windows
On Windows, you can use the PowerShell script `Build.ps1` in place of the Makefile. This will give you an executable mamed `wiipy.exe` in the root of the project directory.
```shell
.\Build.ps1
```
### A Note About Scripts ### A Note About Scripts
WiiPy's source includes a directory named `scripts`, which is currently where miscellaneous libWiiPy-based scripts live. Note that they are not part of WiiPy releases, and are not tested the same way the WiiPy is. They are simply here for those who may find them useful. WiiPy's source includes a directory named `scripts`, which is currently where miscellaneous libWiiPy-based scripts live. Note that they are not part of WiiPy releases, and are not tested the same way the WiiPy is. They are simply here for those who may find them useful.