AppImage packaging: containerized build, host-only py_func/lua_func
build.sh runs appimage-builder in a Debian Bookworm container (Podman or Docker) so it works on Arch / non-Debian hosts. Uses single src/requirements.txt; TESTIUM_VERSION exported in runtime.env.
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -26,6 +26,7 @@ package/appimage/*.AppImage
|
|||||||
package/appimage/src
|
package/appimage/src
|
||||||
package/appimage/*.py
|
package/appimage/*.py
|
||||||
AppDir
|
AppDir
|
||||||
|
*.squashfs
|
||||||
doc/manual/doxygen
|
doc/manual/doxygen
|
||||||
doc/manual/sphinx/build/*
|
doc/manual/sphinx/build/*
|
||||||
doc/manual/sphinx/source/_build/*
|
doc/manual/sphinx/source/_build/*
|
||||||
|
|||||||
@@ -24,9 +24,8 @@ AppDir:
|
|||||||
|
|
||||||
runtime:
|
runtime:
|
||||||
env:
|
env:
|
||||||
SEQUENCER_REV: '{{APP_VERSION}}'
|
TESTIUM_VERSION: '{{APP_VERSION}}'
|
||||||
PYTHONPATH: $APPDIR/usr/lib/python3.11/site-packages:$APPDIR/usr/lib/python3.11
|
PYTHONPATH: $APPDIR/usr/lib/python3.11/site-packages:$APPDIR/usr/lib/python3.11
|
||||||
QT_QPA_PLATFORM: xcb
|
|
||||||
|
|
||||||
path_mappings:
|
path_mappings:
|
||||||
- /usr/share/matplotlib/mpl-data/matplotlibrc:$APPDIR/etc/matplotlibrc
|
- /usr/share/matplotlib/mpl-data/matplotlibrc:$APPDIR/etc/matplotlibrc
|
||||||
@@ -69,12 +68,13 @@ AppDir:
|
|||||||
|
|
||||||
# Set python 3.11 as default
|
# Set python 3.11 as default
|
||||||
ln -fs python3.11 $TARGET_APPDIR/usr/bin/python3
|
ln -fs python3.11 $TARGET_APPDIR/usr/bin/python3
|
||||||
# Install pip
|
|
||||||
if [ ! -f "get-pip.py" ]; then curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py; fi
|
# Bootstrap pip into the AppDir Python
|
||||||
|
if [ ! -f "get-pip.py" ]; then curl -sS https://bootstrap.pypa.io/get-pip.py -o get-pip.py; fi
|
||||||
python3.11 get-pip.py --break-system-packages
|
python3.11 get-pip.py --break-system-packages
|
||||||
|
|
||||||
# Install application dependencies in AppDir
|
# Install application dependencies in AppDir
|
||||||
python3.11 -m pip install --break-system-packages --upgrade --isolated --no-input --ignore-installed --prefix=$TARGET_APPDIR/usr -r requirements.txt
|
python3.11 -m pip install --break-system-packages --upgrade --isolated --no-input --ignore-installed --prefix=$TARGET_APPDIR/usr -r ../../src/requirements.txt
|
||||||
|
|
||||||
export PIP_CONFIG_FILE=$HOME/.pip/pip.conf
|
export PIP_CONFIG_FILE=$HOME/.pip/pip.conf
|
||||||
python3.11 -m pip install --break-system-packages --upgrade --isolated --no-input --ignore-installed --prefix=$TARGET_APPDIR/usr ../../src/dist/testium-{{APP_VERSION}}-py3-none-any.whl
|
python3.11 -m pip install --break-system-packages --upgrade --isolated --no-input --ignore-installed --prefix=$TARGET_APPDIR/usr ../../src/dist/testium-{{APP_VERSION}}-py3-none-any.whl
|
||||||
|
|||||||
@@ -1,12 +1,53 @@
|
|||||||
#!/usr/bin/bash
|
#!/bin/bash
|
||||||
|
# Build the testium AppImage inside a Debian container (Podman or Docker).
|
||||||
|
# The resulting .AppImage file is written to this directory.
|
||||||
|
|
||||||
export APP_VERSION=$(<../../src/VERSION)
|
set -e
|
||||||
|
|
||||||
appimage-builder --recipe AppImageBuilder.yml
|
REPO_ROOT="$(cd "$(dirname "$0")/../.." && pwd)"
|
||||||
|
APP_VERSION="$(<"$REPO_ROOT/src/VERSION")"
|
||||||
|
|
||||||
RESULT=$?
|
if command -v podman &>/dev/null; then
|
||||||
if [ -n "$1" ] && [ "$1" = "install" ]; then
|
RUNTIME=podman
|
||||||
if [ $RESULT -eq 0 ]; then
|
elif command -v docker &>/dev/null; then
|
||||||
install -v "testium-${APP_VERSION}-x86_64.AppImage" "${HOME}/.local/bin/testium"
|
RUNTIME=docker
|
||||||
fi
|
else
|
||||||
|
echo "Error: neither podman nor docker found." >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
echo "Using $RUNTIME — building testium $APP_VERSION AppImage..."
|
||||||
|
|
||||||
|
# APPIMAGE_EXTRACT_AND_RUN=1 lets appimagetool run without FUSE in the container.
|
||||||
|
$RUNTIME run --rm \
|
||||||
|
--privileged \
|
||||||
|
-e APPIMAGE_EXTRACT_AND_RUN=1 \
|
||||||
|
-v "$REPO_ROOT:/work" \
|
||||||
|
-w /work/package/appimage \
|
||||||
|
debian:bookworm bash -c "
|
||||||
|
set -e
|
||||||
|
export DEBIAN_FRONTEND=noninteractive
|
||||||
|
|
||||||
|
apt-get update -qq
|
||||||
|
apt-get install -y -qq \
|
||||||
|
python3 python3-pip python3-venv python3-build \
|
||||||
|
dpkg-dev fakeroot squashfs-tools wget curl file binutils \
|
||||||
|
libglib2.0-0 patchelf zsync > /dev/null
|
||||||
|
|
||||||
|
# Build the wheel
|
||||||
|
cd /work/src
|
||||||
|
python3 -m build --wheel --outdir dist/ > /dev/null
|
||||||
|
cd /work/package/appimage
|
||||||
|
|
||||||
|
# Install appimage-builder
|
||||||
|
pip3 install appimage-builder --quiet --break-system-packages
|
||||||
|
|
||||||
|
# Run the build
|
||||||
|
export APP_VERSION=$APP_VERSION
|
||||||
|
appimage-builder --recipe AppImageBuilder.yml --skip-test
|
||||||
|
"
|
||||||
|
|
||||||
|
echo "Done: testium-${APP_VERSION}-x86_64.AppImage"
|
||||||
|
|
||||||
|
if [ "${1}" = "install" ]; then
|
||||||
|
install -v "testium-${APP_VERSION}-x86_64.AppImage" "${HOME}/.local/bin/testium"
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -1,3 +0,0 @@
|
|||||||
tables
|
|
||||||
pandas
|
|
||||||
scapy
|
|
||||||
Reference in New Issue
Block a user