Packages carry their ONNX Runtime; a DEB per Ubuntu LTS

ONNX Runtime stamps its symbols with each release's version, so the
1.0.0 RPM demanded Fedora 42's exact runtime (issue #5) and the Arch
package would break on the next update. The RPM and the Arch package
now bundle Microsoft's 1.21.0 build, as the DEB does, and the images
test against it. The RPM builds on Fedora 43. A DEB built on Ubuntu
26.04 joins 24.04's, and ubuntu.sh picks by codename.

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
雷电芽衣andClaude committed 2026-09-26 14:22:16 -04:00
1 parent 2807b77e8c
commit 2d219dd115
12 files changed
+98 -37

No files matched your search

+7 -2
View File
@@ -1,10 +1,15 @@
#!/usr/bin/env bash
# Builds and tests the app in one distribution's own container.
set -euo pipefail
distro=${1:?"usage: distro-check.sh arch|fedora|nixos"}
distro=${1:?"usage: distro-check.sh arch|fedora|nixos|resolute"}
here=$(cd "$(dirname "$0")" && pwd)
repo=$(cd "$here/.." && pwd)
docker build -t "omaphoto-$distro" "$here/distro/$distro"
# Ubuntu 26.04 is the dev image on another base.
if [ "$distro" = resolute ]; then
docker build -t omaphoto-resolute --build-arg BASE=ubuntu:26.04 -f "$repo/Dockerfile.dev" "$here"
else
docker build -t "omaphoto-$distro" "$here/distro/$distro"
fi
steps="cmake -S . -B /tmp/build -G Ninja -DOMAPHOTO_WERROR=ON && cmake --build /tmp/build && ctest --test-dir /tmp/build --output-on-failure --timeout 120"
# Not root, as dev.sh: tests refuse what root may do.
user=1000:1000
+15 -2
View File
@@ -1,8 +1,21 @@
# Arch and Omarchy: Qt, GCC and ONNX Runtime as shipped.
# Arch and Omarchy: Qt and GCC as shipped.
FROM archlinux:latest
RUN pacman -Syu --noconfirm --needed base-devel cmake ninja pkgconf qt6-base qt6-imageformats libheif libde265 \
fontconfig onnxruntime-cpu ttf-dejavu curl \
fontconfig ttf-dejavu curl \
&& pacman -Scc --noconfirm
# The ONNX Runtime the packages carry: Microsoft's own build.
RUN curl -fsSL -o /tmp/ort.tgz \
https://github.com/microsoft/onnxruntime/releases/download/v1.21.0/onnxruntime-linux-x64-1.21.0.tgz \
&& echo "7485c7e7aac6501b27e353dcbe068e45c61ab51fbaf598d13970dfae669d20bf /tmp/ort.tgz" | sha256sum -c - \
&& mkdir -p /tmp/ort /usr/local/include/onnxruntime /usr/local/lib64 \
&& tar -xzf /tmp/ort.tgz -C /tmp/ort --strip-components=1 \
&& cp -r /tmp/ort/include/. /usr/local/include/onnxruntime/ \
&& mkdir -p /usr/local/lib/cmake && mv /tmp/ort/lib/cmake/onnxruntime /usr/local/lib/cmake/ \
&& cp -a /tmp/ort/lib/. /usr/local/lib64/ \
&& mkdir -p /usr/local/share/doc/onnxruntime \
&& cp /tmp/ort/LICENSE /tmp/ort/ThirdPartyNotices.txt /usr/local/share/doc/onnxruntime/ \
&& echo /usr/local/lib64 > /etc/ld.so.conf.d/onnxruntime.conf && ldconfig \
&& rm -rf /tmp/ort /tmp/ort.tgz
# U²-Net for Remove Background, pinned by its checksum.
RUN mkdir -p /usr/local/share/omaphoto \
&& curl -fsSL -o /usr/local/share/omaphoto/u2net.onnx \
+17 -4
View File
@@ -1,9 +1,22 @@
# Fedora's own Qt and ONNX Runtime; HEVC from RPM Fusion.
FROM fedora:42
RUN dnf install -y https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-42.noarch.rpm \
# Fedora 43, the oldest still supported; HEVC from RPM Fusion.
FROM fedora:43
RUN dnf install -y https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-43.noarch.rpm \
&& dnf install -y gcc-c++ cmake ninja-build pkgconf qt6-qtbase-devel qt6-qtimageformats libheif-devel libheif-freeworld \
fontconfig-devel onnxruntime-devel dejavu-sans-fonts dejavu-serif-fonts dejavu-sans-mono-fonts curl rpm-build file \
fontconfig-devel dejavu-sans-fonts dejavu-serif-fonts dejavu-sans-mono-fonts curl rpm-build file \
&& dnf clean all
# The ONNX Runtime the packages carry: Microsoft's own build.
RUN curl -fsSL -o /tmp/ort.tgz \
https://github.com/microsoft/onnxruntime/releases/download/v1.21.0/onnxruntime-linux-x64-1.21.0.tgz \
&& echo "7485c7e7aac6501b27e353dcbe068e45c61ab51fbaf598d13970dfae669d20bf /tmp/ort.tgz" | sha256sum -c - \
&& mkdir -p /tmp/ort /usr/local/include/onnxruntime /usr/local/lib64 \
&& tar -xzf /tmp/ort.tgz -C /tmp/ort --strip-components=1 \
&& cp -r /tmp/ort/include/. /usr/local/include/onnxruntime/ \
&& mkdir -p /usr/local/lib/cmake && mv /tmp/ort/lib/cmake/onnxruntime /usr/local/lib/cmake/ \
&& cp -a /tmp/ort/lib/. /usr/local/lib64/ \
&& mkdir -p /usr/local/share/doc/onnxruntime \
&& cp /tmp/ort/LICENSE /tmp/ort/ThirdPartyNotices.txt /usr/local/share/doc/onnxruntime/ \
&& echo /usr/local/lib64 > /etc/ld.so.conf.d/onnxruntime.conf && ldconfig \
&& rm -rf /tmp/ort /tmp/ort.tgz
# U²-Net for Remove Background, pinned by its checksum.
RUN mkdir -p /usr/local/share/omaphoto \
&& curl -fsSL -o /usr/local/share/omaphoto/u2net.onnx \
-1
View File
@@ -21,5 +21,4 @@ curl -fL --proto '=https' -o "$work/$package" "$base/$package"
curl -fsSL --proto '=https' -o "$work/SHA256SUMS" "$base/SHA256SUMS"
# The package must match the checksum published beside it.
(cd "$work" && grep " $package\$" SHA256SUMS | sha256sum -c -)
# pacman asks which ONNX Runtime build provides onnxruntime.
sudo pacman -U "$work/$package"
+9 -6
View File
@@ -1,14 +1,17 @@
#!/usr/bin/env bash
# Installs OmaPhoto's latest DEB on Ubuntu 24.04 and derivatives.
# Installs OmaPhoto's latest DEB on Ubuntu LTS and derivatives.
set -euo pipefail
base=https://github.com/ZacharyZhang-NY/OmaPhoto/releases/latest/download
package=omaphoto_amd64.deb
. /etc/os-release
# The DEB names Ubuntu 24.04's libraries; derivatives name their base.
if [ "${UBUNTU_CODENAME:-}" != noble ]; then
echo "This script is for Ubuntu 24.04 and systems built on it; this system is ${PRETTY_NAME:-unknown}." >&2
# Each DEB names its LTS's libraries; derivatives name their base.
case "${UBUNTU_CODENAME:-}" in
noble | resolute) ;;
*)
echo "This script is for Ubuntu 24.04 or 26.04 and systems built on them; this system is ${PRETTY_NAME:-unknown}." >&2
exit 1
fi
;;
esac
package=omaphoto-${UBUNTU_CODENAME}_amd64.deb
if [ "$(uname -m)" != x86_64 ]; then
echo "OmaPhoto's packages are built for x86_64 alone." >&2
exit 1