feat: Added scripts to build a redistribuable Linux binary

This commit is contained in:
Fabien LOISON 2024-03-20 14:04:17 +01:00
parent b8308c5098
commit ea76ed0d2d
No known key found for this signature in database
GPG Key ID: FF90CA148348048E
5 changed files with 99 additions and 0 deletions

1
.gitignore vendored
View File

@ -17,3 +17,4 @@ _*.c*
.pytest_cache/
*.tags
/__misc__/
yoga-bin.*

View File

@ -0,0 +1,38 @@
# YOGA binary for Linux
> YOGA: Yummy Optimizer for Gorgeous Assets
YOGA is a command-line tool that:
* converts and optimizes images from various format to JPEG, PNG and WebP,
* converts and optimizes 3D models from various formats to glTF and GLB.
## Install
YOGA does not need any installation. Just unzip the content of this archive
and you are ready to go! :)
## Usage
YOGA is a CLI (command line) program. To use it, open a terminal in this folder
and just use one of the following commands, depending on the terminal you are
using.
./yoga.bin -h
## Links
Project page and source code:
* https://github.com/wanadev/yoga
Documentation:
* https://wanadev.github.io/yoga/
Please report any issue on our bug tracker:
* https://github.com/wanadev/yoga/issues

28
linux-bin/README.md Normal file
View File

@ -0,0 +1,28 @@
# YOGA Linux binary
This forlder contains scripts to compile yoga as an executable binary for Linux.
## Requirements
* Python 3.x
* Python 3 headers (Debian/Ubuntu: `apt install python3-dev`)
* Virtualenv (Debian/Ubuntu: `apt install python3-venv`)
* Build tools and CMake (Debian/Ubuntu: `apt install build-essential cmake`)
## Build standalone version from source
Clone this repository:
git clone https://github.com/wanadev/yoga.git
cd yoga
git submodule init
git submodule update
Run the build script (from the root directory of this repository):
./linux-bin/build.sh
Once the build finished, you will find the result in the `yoga-bin.dist` folder. To run YOGA, use the `yoga` executable:
./yoga-bin.dist/yoga.bin -h

31
linux-bin/build.sh Executable file
View File

@ -0,0 +1,31 @@
#!/bin/bash
# Create and/or activate the virtual env
mkdir -p build/
if [ ! -d build/__env__/ ] ; then
python3 -m venv build/__env__/
source build/__env__/bin/activate
pip install -r linux-bin/requirements.txt
pip install -e .
else
source build/__env__/bin/activate
fi
# Build YOGA
python -m nuitka \
--standalone \
--follow-imports \
--include-package=PIL \
linux-bin/yoga-bin.py
# Rename YOGA binary
mv yoga-bin.dist/yoga-bin.bin yoga-bin.dist/yoga.bin
# Copy additional files
cp LICENSE yoga-bin.dist/LICENSE
cp linux-bin/README-linux-dist.md yoga-bin.dist/README.md

View File

@ -0,0 +1 @@
nuitka==2.1.2