[gimp] Build libjxl in crossroad Win64 CI



commit 0236308d69e710f46880ce58012b943b587cec06
Author: Daniel Novomesky <dnovomesky gmail com>
Date:   Wed Sep 29 09:43:39 2021 +0200

    Build libjxl in crossroad Win64 CI

 .gitlab-ci.yml                                  |  5 ++++-
 build/windows/gitlab-ci/build-deps-crossroad.sh | 22 ++++++++++++++++++++++
 2 files changed, 26 insertions(+), 1 deletion(-)
---
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 8322f31146..424cda0e48 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -96,7 +96,7 @@ build-image-win64:
     - echo "FROM debian:testing" > Dockerfile
     - echo "RUN apt-get update" >> Dockerfile
     - echo "RUN apt-get install -y --no-install-recommends \\" >> Dockerfile
-    - echo "build-essential cpio g++-mingw-w64-x86-64 gcc-mingw-w64-x86-64 git intltool libgdk-pixbuf2.0-dev 
libglib2.0-bin meson pkg-config python3 python3-distutils python3-docutils python3-pip rpm xsltproc" >> 
Dockerfile
+    - echo "build-essential cmake cpio g++-mingw-w64-x86-64 gcc-mingw-w64-x86-64 git intltool 
libgdk-pixbuf2.0-dev libglib2.0-bin meson pkg-config python3 python3-distutils python3-docutils python3-pip 
rpm xsltproc" >> Dockerfile
 
     - /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile --destination 
$CI_REGISTRY_IMAGE:build-win64-latest --cache=true --cache-ttl=120h
 
@@ -451,6 +451,9 @@ deps-win64:
     - pip3 install zstandard
   script:
     - export PATH="`pwd`/.local/bin:$PATH"
+    # libjxl uses C++ features that require posix threads
+    - update-alternatives --set x86_64-w64-mingw32-g++ /usr/bin/x86_64-w64-mingw32-g++-posix
+    - update-alternatives --set x86_64-w64-mingw32-gcc /usr/bin/x86_64-w64-mingw32-gcc-posix
     - crossroad w64 gimp --run="build/windows/gitlab-ci/build-deps-crossroad.sh"
   artifacts:
     name: "${CI_JOB_NAME}-${CI_COMMIT_REF_SLUG}"
diff --git a/build/windows/gitlab-ci/build-deps-crossroad.sh b/build/windows/gitlab-ci/build-deps-crossroad.sh
index 35fef20485..4b906c102c 100644
--- a/build/windows/gitlab-ci/build-deps-crossroad.sh
+++ b/build/windows/gitlab-ci/build-deps-crossroad.sh
@@ -49,6 +49,28 @@ if [ $? -ne 0 ]; then
 fi
 
 if [ "x$CROSSROAD_PLATFORM" = "xw64" ]; then
+    # build libjxl (not available in MSYS2 yet)
+    crossroad install brotli highway && \
+    git clone --depth=1 --branch v0.6.x --recursive https://github.com/libjxl/libjxl.git libjxl && cd libjxl 
&& \
+    mkdir _build && cd _build && \
+    crossroad cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DJPEGXL_ENABLE_PLUGINS=OFF -DBUILD_TESTING=OFF 
-DJPEGXL_WARNINGS_AS_ERRORS=OFF -DJPEGXL_ENABLE_SJPEG=OFF -DJPEGXL_ENABLE_BENCHMARK=OFF 
-DJPEGXL_ENABLE_EXAMPLES=OFF -DJPEGXL_ENABLE_MANPAGES=OFF -DJPEGXL_ENABLE_SKCMS=ON 
-DJPEGXL_FORCE_SYSTEM_BROTLI=ON -DJPEGXL_FORCE_SYSTEM_HWY=ON -DJPEGXL_ENABLE_JNI=OFF 
-DJPEGXL_ENABLE_TCMALLOC=OFF -DJPEGXL_ENABLE_TOOLS=OFF -DCMAKE_CXX_FLAGS="-DHWY_COMPILE_ONLY_SCALAR" .. && \
+    ninja && ninja install || exit 1
+
+    # move DLLs into correct location
+    if [ -f ${CROSSROAD_PREFIX}/lib/libjxl.dll ]; then
+      mv --target-directory=${CROSSROAD_PREFIX}/bin ${CROSSROAD_PREFIX}/lib/libjxl.dll
+    fi
+
+    if [ -f ${CROSSROAD_PREFIX}/lib/libjxl_threads.dll ]; then
+      mv --target-directory=${CROSSROAD_PREFIX}/bin ${CROSSROAD_PREFIX}/lib/libjxl_threads.dll
+    fi
+
+    # install image/jxl mime type
+    mkdir -p ${CROSSROAD_PREFIX}/share/mime/packages
+    cp --target-directory=${CROSSROAD_PREFIX}/share/mime/packages ../plugins/mime/image-jxl.xml
+
+    cd ../..
+
     # Generate the loaders.cache file for GUI image support.
     # Note: this is mostly for distribution so I initially wanted to
     # have these in "win64-nightly" job but "win32-nightly" also


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]