Add Makefile for building/installing on Linux

This commit is contained in:
Campbell 2024-07-22 02:53:06 -04:00
parent 1f82aa61c7
commit a5afdc6d6a
Signed by: NinjaCheetah
GPG Key ID: B547958AF96ED344
4 changed files with 29 additions and 4 deletions

View File

@ -31,10 +31,10 @@ jobs:
pip install -r requirements.txt pip install -r requirements.txt
- name: Build Application - name: Build Application
run: | 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 - name: Prepare Package for Upload
run: | run: |
mv wiipy.bin ~/wiipy mv wiipy ~/wiipy
cd ~ cd ~
tar cvf WiiPy.tar wiipy tar cvf WiiPy.tar wiipy
- name: Upload Application - name: Upload Application
@ -59,10 +59,10 @@ jobs:
pip install -r requirements.txt pip install -r requirements.txt
- name: Build Application - name: Build Application
run: | 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 - name: Prepare Package for Upload
run: | run: |
mv wiipy.bin ~/wiipy mv wiipy ~/wiipy
cd ~ cd ~
tar cvf WiiPy.tar wiipy tar cvf WiiPy.tar wiipy
- name: Upload Application - name: Upload Application

1
.gitignore vendored
View File

@ -25,6 +25,7 @@ share/python-wheels/
*.build/ *.build/
*.dist/ *.dist/
*.onefile-build/ *.onefile-build/
wiipy
.installed.cfg .installed.cfg
*.egg *.egg
MANIFEST MANIFEST

10
Makefile Normal file
View File

@ -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

View File

@ -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 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. 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
```