Fix AUR package build for Python 3.12

This commit is contained in:
Aaron D. Lee
2026-01-10 15:21:44 -05:00
parent 8d90a888cf
commit de9d1de881

View File

@@ -1,15 +1,15 @@
# Maintainer: Aaron D. Lee <your-email@example.com> # Maintainer: Aaron D. Lee <your-email@example.com>
pkgname=stegasoo-git pkgname=stegasoo-git
pkgver=4.2.0.r0.g0000000 pkgver=4.1.7.r0.g1acb5a3
pkgrel=1 pkgrel=1
pkgdesc="Secure steganography with hybrid photo + passphrase + PIN authentication" pkgdesc="Secure steganography with hybrid photo + passphrase + PIN authentication"
arch=('x86_64') arch=('x86_64')
url="https://github.com/adlee-was-taken/stegasoo" url="https://github.com/adlee-was-taken/stegasoo"
license=('MIT') license=('MIT')
# Use python312 from AUR to future-proof against 3.13 (jpegio compatibility) # NOTE: Requires Python 3.12 (jpegio not compatible with 3.13 yet)
depends=( depends=(
'python312' 'python312' # AUR package - jpegio requires 3.12
) )
makedepends=( makedepends=(
'git' 'git'
@@ -23,6 +23,9 @@ conflicts=('stegasoo')
source=("${pkgname}::git+https://github.com/adlee-was-taken/stegasoo.git#branch=main") source=("${pkgname}::git+https://github.com/adlee-was-taken/stegasoo.git#branch=main")
sha256sums=('SKIP') sha256sums=('SKIP')
# Python 3.12 from AUR package
_python="/usr/bin/python3.12"
pkgver() { pkgver() {
cd "$pkgname" cd "$pkgname"
git describe --long --tags 2>/dev/null | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g' || \ git describe --long --tags 2>/dev/null | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g' || \
@@ -32,15 +35,16 @@ pkgver() {
build() { build() {
cd "$pkgname" cd "$pkgname"
# Create venv with python3.12 echo "Using Python: $_python ($($_python --version))"
python3.12 -m venv --system-site-packages "$srcdir/venv"
source "$srcdir/venv/bin/activate"
# Install build deps # Bootstrap pip for python312
pip install --upgrade pip wheel hatchling build $_python -m ensurepip --user --upgrade
# Install build dependencies
$_python -m pip install --user build hatchling
# Build wheel # Build wheel
python -m build --wheel --no-isolation $_python -m build --wheel --no-isolation
} }
package() { package() {
@@ -50,10 +54,11 @@ package() {
install -dm755 "$pkgdir/opt/stegasoo" install -dm755 "$pkgdir/opt/stegasoo"
# Create fresh venv in package # Create fresh venv in package
python3.12 -m venv "$pkgdir/opt/stegasoo/venv" $_python -m venv "$pkgdir/opt/stegasoo/venv"
# Install the wheel with all extras # Install the wheel with all extras
"$pkgdir/opt/stegasoo/venv/bin/pip" install --no-cache-dir dist/*.whl[all] local wheel=$(ls dist/*.whl | head -1)
"$pkgdir/opt/stegasoo/venv/bin/pip" install --no-cache-dir "${wheel}[all]"
# Create symlinks to /usr/bin # Create symlinks to /usr/bin
install -dm755 "$pkgdir/usr/bin" install -dm755 "$pkgdir/usr/bin"
@@ -65,7 +70,7 @@ package() {
# Install docs # Install docs
install -Dm644 README.md "$pkgdir/usr/share/doc/$pkgname/README.md" install -Dm644 README.md "$pkgdir/usr/share/doc/$pkgname/README.md"
# Install systemd service files (optional) # Install systemd service files
install -Dm644 /dev/stdin "$pkgdir/usr/lib/systemd/system/stegasoo-web.service" <<EOF install -Dm644 /dev/stdin "$pkgdir/usr/lib/systemd/system/stegasoo-web.service" <<EOF
[Unit] [Unit]
Description=Stegasoo Web UI Description=Stegasoo Web UI
@@ -75,7 +80,6 @@ After=network.target
Type=simple Type=simple
User=stegasoo User=stegasoo
Environment="PATH=/opt/stegasoo/venv/bin" Environment="PATH=/opt/stegasoo/venv/bin"
WorkingDirectory=/opt/stegasoo/venv/lib/python3.12/site-packages/frontends/web
ExecStart=/opt/stegasoo/venv/bin/gunicorn -b 127.0.0.1:5000 app:app ExecStart=/opt/stegasoo/venv/bin/gunicorn -b 127.0.0.1:5000 app:app
Restart=on-failure Restart=on-failure
RestartSec=5 RestartSec=5
@@ -93,7 +97,6 @@ After=network.target
Type=simple Type=simple
User=stegasoo User=stegasoo
Environment="PATH=/opt/stegasoo/venv/bin" Environment="PATH=/opt/stegasoo/venv/bin"
WorkingDirectory=/opt/stegasoo/venv/lib/python3.12/site-packages/frontends/api
ExecStart=/opt/stegasoo/venv/bin/uvicorn main:app --host 127.0.0.1 --port 8000 ExecStart=/opt/stegasoo/venv/bin/uvicorn main:app --host 127.0.0.1 --port 8000
Restart=on-failure Restart=on-failure
RestartSec=5 RestartSec=5