Fix Ubuntu OpenJPEG provisioning (#113)
Some checks failed
Native code generation / deterministic (push) Successful in 14m51s
Imaging and meshing gate / native (push) Failing after 2m1s
JPEG 2000 feature / linux (push) Successful in 2m42s
Native Rust workspace compile / compile (push) Has been cancelled

This commit is contained in:
2026-08-10 11:57:42 +00:00
parent ed516a1a5d
commit b64020d45b
5 changed files with 87 additions and 10 deletions

47
tools/install_openjpeg_2_5_4.sh Executable file
View File

@@ -0,0 +1,47 @@
#!/bin/sh
set -eu
OPENJPEG_VERSION=2.5.4
OPENJPEG_COMMIT=6c4a29b00211eb0430fa0e5e890f1ce5c80f409f
if [ "$#" -ne 1 ] || [ -z "$1" ]; then
echo "usage: $0 INSTALL_PREFIX" >&2
exit 2
fi
install_prefix=$1
pkg_config_path="$install_prefix/lib/pkgconfig"
if [ -f "$pkg_config_path/libopenjp2.pc" ] &&
PKG_CONFIG_PATH="$pkg_config_path" pkg-config --exact-version "$OPENJPEG_VERSION" libopenjp2
then
exit 0
fi
work_dir=$(mktemp -d "${TMPDIR:-/tmp}/metacrate-openjpeg.XXXXXX")
trap 'rm -rf "$work_dir"' EXIT HUP INT TERM
source_dir="$work_dir/source"
build_dir="$work_dir/build"
git clone --branch "v$OPENJPEG_VERSION" --depth 1 \
https://github.com/uclouvain/openjpeg.git "$source_dir"
actual_commit=$(git -C "$source_dir" rev-parse HEAD)
if [ "$actual_commit" != "$OPENJPEG_COMMIT" ]; then
echo "OpenJPEG v$OPENJPEG_VERSION resolved to unexpected commit $actual_commit" >&2
exit 1
fi
cmake -S "$source_dir" -B "$build_dir" \
-DBUILD_CODEC=OFF \
-DBUILD_SHARED_LIBS=ON \
-DBUILD_TESTING=OFF \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_LIBDIR=lib \
-DCMAKE_INSTALL_PREFIX="$install_prefix"
cmake --build "$build_dir" --parallel
cmake --install "$build_dir"
PKG_CONFIG_PATH="$pkg_config_path" pkg-config --exact-version "$OPENJPEG_VERSION" libopenjp2