From a5afdc6d6a41dbff2765ef1b0cea1c154eff9872 Mon Sep 17 00:00:00 2001 From: NinjaCheetah <58050615+NinjaCheetah@users.noreply.github.com> Date: Mon, 22 Jul 2024 02:53:06 -0400 Subject: [PATCH] Add Makefile for building/installing on Linux --- .github/workflows/python-build.yaml | 8 ++++---- .gitignore | 1 + Makefile | 10 ++++++++++ README.md | 14 ++++++++++++++ 4 files changed, 29 insertions(+), 4 deletions(-) create mode 100644 Makefile diff --git a/.github/workflows/python-build.yaml b/.github/workflows/python-build.yaml index 1f1ea09..ebbd546 100644 --- a/.github/workflows/python-build.yaml +++ b/.github/workflows/python-build.yaml @@ -31,10 +31,10 @@ jobs: pip install -r requirements.txt - name: Build Application run: | - python -m nuitka --show-progress --assume-yes-for-downloads --onefile wiipy.py + python -m nuitka --show-progress --assume-yes-for-downloads --onefile wiipy.py -o wiipy - name: Prepare Package for Upload run: | - mv wiipy.bin ~/wiipy + mv wiipy ~/wiipy cd ~ tar cvf WiiPy.tar wiipy - name: Upload Application @@ -59,10 +59,10 @@ jobs: pip install -r requirements.txt - name: Build Application run: | - python -m nuitka --show-progress --assume-yes-for-downloads --onefile wiipy.py + python -m nuitka --show-progress --assume-yes-for-downloads --onefile wiipy.py -o wiipy - name: Prepare Package for Upload run: | - mv wiipy.bin ~/wiipy + mv wiipy ~/wiipy cd ~ tar cvf WiiPy.tar wiipy - name: Upload Application diff --git a/.gitignore b/.gitignore index 64ae49c..7633308 100644 --- a/.gitignore +++ b/.gitignore @@ -25,6 +25,7 @@ share/python-wheels/ *.build/ *.dist/ *.onefile-build/ +wiipy .installed.cfg *.egg MANIFEST diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..db98992 --- /dev/null +++ b/Makefile @@ -0,0 +1,10 @@ +CC=python -m nuitka + +linux: + $(CC) --show-progress --assume-yes-for-downloads --onefile wiipy.py -o wiipy + +linux-install: + install wiipy /usr/bin/ + +clean: + rm wiipy diff --git a/README.md b/README.md index 3968201..69e17cb 100644 --- a/README.md +++ b/README.md @@ -28,3 +28,17 @@ If you'd like to compile WiiPy from Python into something a little more native, 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): +```shell +make linux +``` + +Then, run the install command with `sudo` (or your favorite alternative): +```shell +sudo make linux-install +```