diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6e2863e4c30cf7412b7ff71ac53e39950a199290..d33795919a88f0a42874bbd5511eb4a8cdc0b58f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -184,7 +184,51 @@ gimp-clang-debian: - ninja -C _build - ninja -C _build test -## WINDOWS 64-bit CI ## +## WINDOWS 64-bit CI (native MSYS2) ## + +deps-win64-native: + stage: dependencies + variables: + MSYSTEM: "MINGW64" + CHERE_INVOKING: "yes" + tags: + - win32-ps + cache: + paths: + - _install/ + script: + - C:\msys64\usr\bin\pacman --noconfirm -Syyuu + - C:\msys64\usr\bin\bash -lc "bash -x ./build/windows/gitlab-ci/build-deps-msys2.sh" + artifacts: + name: "${CI_JOB_NAME}-${CI_COMMIT_REF_SLUG}" + when: always + expire_in: 2 hours + paths: + - _install + needs: [] + +gimp-win64-native: + stage: gimp + variables: + MSYSTEM: "MINGW64" + CHERE_INVOKING: "yes" + tags: + - win32-ps + script: + - C:\msys64\usr\bin\pacman --noconfirm -Syyuu + - C:\msys64\usr\bin\bash -lc "bash -x ./build/windows/gitlab-ci/build-gimp-msys2.sh" + artifacts: + name: "${CI_JOB_NAME}-${CI_COMMIT_REF_SLUG}" + when: always + expire_in: 2 days + paths: + - _install + cache: + paths: + - _ccache/ + needs: ["deps-win64-native"] + +## WINDOWS 64-bit CI (cross-build crossroad) ## deps-win64: rules: @@ -209,7 +253,7 @@ deps-win64: - pip3 install zstandard script: - export PATH="`pwd`/.local/bin:$PATH" - - crossroad w64 gimp --run="build/windows/crossbuild-gitlab-ci/build-deps.sh" + - crossroad w64 gimp --run="build/windows/gitlab-ci/build-deps-crossroad.sh" artifacts: name: "${CI_JOB_NAME}-${CI_COMMIT_REF_SLUG}" when: always @@ -250,7 +294,7 @@ gimp-win64: - _build/ - gimp-prefix/ -## WINDOWS 32-bit CI ## +## WINDOWS 32-bit CI (cross-build crossroad) ## deps-win32: rules: @@ -272,7 +316,7 @@ deps-win32: - pip3 install zstandard script: - export PATH="`pwd`/.local/bin:$PATH" - - crossroad w32 gimp --run="build/windows/crossbuild-gitlab-ci/build-deps.sh" + - crossroad w32 gimp --run="build/windows/gitlab-ci/build-deps-crossroad.sh" artifacts: name: "${CI_JOB_NAME}-${CI_COMMIT_REF_SLUG}" when: always @@ -404,28 +448,28 @@ win64-nightly: - glib-compile-schemas --targetdir=${GIMP_DISTRIB}/share/glib-2.0/schemas ${GIMP_DISTRIB}/share/glib-2.0/schemas # Package needed DLLs only - - python3 build/windows/crossbuild-gitlab-ci/dll_link.py ${GIMP_DISTRIB}/bin/gimp-2.99.exe ${GIMP_PREFIX}/ ${GIMP_DISTRIB} - - python3 build/windows/crossbuild-gitlab-ci/dll_link.py ${GIMP_DISTRIB}/bin/gimp-console-2.99.exe ${GIMP_PREFIX}/ ${GIMP_DISTRIB} - - python3 build/windows/crossbuild-gitlab-ci/dll_link.py ${GIMP_DISTRIB}/bin/gimp-test-clipboard-2.99.exe ${GIMP_PREFIX}/ ${GIMP_DISTRIB} - - python3 build/windows/crossbuild-gitlab-ci/dll_link.py ${GIMP_DISTRIB}/bin/gimptool-2.99.exe ${GIMP_PREFIX}/ ${GIMP_DISTRIB} + - python3 build/windows/gitlab-ci/dll_link.py ${GIMP_DISTRIB}/bin/gimp-2.99.exe ${GIMP_PREFIX}/ ${GIMP_DISTRIB} + - python3 build/windows/gitlab-ci/dll_link.py ${GIMP_DISTRIB}/bin/gimp-console-2.99.exe ${GIMP_PREFIX}/ ${GIMP_DISTRIB} + - python3 build/windows/gitlab-ci/dll_link.py ${GIMP_DISTRIB}/bin/gimp-test-clipboard-2.99.exe ${GIMP_PREFIX}/ ${GIMP_DISTRIB} + - python3 build/windows/gitlab-ci/dll_link.py ${GIMP_DISTRIB}/bin/gimptool-2.99.exe ${GIMP_PREFIX}/ ${GIMP_DISTRIB} - for dll in ${GIMP_DISTRIB}/lib/babl-0.1/*.dll; do - python3 build/windows/crossbuild-gitlab-ci/dll_link.py $dll ${GIMP_PREFIX}/ ${GIMP_DISTRIB}; + python3 build/windows/gitlab-ci/dll_link.py $dll ${GIMP_PREFIX}/ ${GIMP_DISTRIB}; done - for dll in ${GIMP_DISTRIB}/lib/gegl-0.4/*.dll; do - python3 build/windows/crossbuild-gitlab-ci/dll_link.py $dll ${GIMP_PREFIX}/ ${GIMP_DISTRIB}; + python3 build/windows/gitlab-ci/dll_link.py $dll ${GIMP_PREFIX}/ ${GIMP_DISTRIB}; done - for dll in ${GIMP_DISTRIB}/lib/gio/modules/*.dll; do - python3 build/windows/crossbuild-gitlab-ci/dll_link.py $dll ${GIMP_PREFIX}/ ${GIMP_DISTRIB}; + python3 build/windows/gitlab-ci/dll_link.py $dll ${GIMP_PREFIX}/ ${GIMP_DISTRIB}; done - for dll in ${GIMP_DISTRIB}/lib/gdk-pixbuf-2.0/2.10.0/loaders/*.dll; do - python3 build/windows/crossbuild-gitlab-ci/dll_link.py $dll ${GIMP_PREFIX}/ ${GIMP_DISTRIB}; + python3 build/windows/gitlab-ci/dll_link.py $dll ${GIMP_PREFIX}/ ${GIMP_DISTRIB}; done - for dll in ${GIMP_DISTRIB}/lib/gimp/2.99/modules/*.dll; do - python3 build/windows/crossbuild-gitlab-ci/dll_link.py $dll ${GIMP_PREFIX}/ ${GIMP_DISTRIB}; + python3 build/windows/gitlab-ci/dll_link.py $dll ${GIMP_PREFIX}/ ${GIMP_DISTRIB}; done - for dll in ${GIMP_DISTRIB}/lib/gimp/2.99/plug-ins/*/*.exe; do - python3 build/windows/crossbuild-gitlab-ci/dll_link.py $dll ${GIMP_PREFIX}/ ${GIMP_DISTRIB}; + python3 build/windows/gitlab-ci/dll_link.py $dll ${GIMP_PREFIX}/ ${GIMP_DISTRIB}; done needs: ["gimp-win64"] @@ -488,27 +532,27 @@ win32-nightly: - glib-compile-schemas --targetdir=${GIMP_DISTRIB}/share/glib-2.0/schemas ${GIMP_DISTRIB}/share/glib-2.0/schemas # Package needed DLLs only. - - python3 build/windows/crossbuild-gitlab-ci/dll_link.py ${GIMP_DISTRIB}/bin/gimp-2.99.exe ${GIMP_PREFIX}/ ${GIMP_DISTRIB} - - python3 build/windows/crossbuild-gitlab-ci/dll_link.py ${GIMP_DISTRIB}/bin/gimp-console-2.99.exe ${GIMP_PREFIX}/ ${GIMP_DISTRIB} - - python3 build/windows/crossbuild-gitlab-ci/dll_link.py ${GIMP_DISTRIB}/bin/gimp-test-clipboard-2.99.exe ${GIMP_PREFIX}/ ${GIMP_DISTRIB} - - python3 build/windows/crossbuild-gitlab-ci/dll_link.py ${GIMP_DISTRIB}/bin/gimptool-2.99.exe ${GIMP_PREFIX}/ ${GIMP_DISTRIB} + - python3 build/windows/gitlab-ci/dll_link.py ${GIMP_DISTRIB}/bin/gimp-2.99.exe ${GIMP_PREFIX}/ ${GIMP_DISTRIB} + - python3 build/windows/gitlab-ci/dll_link.py ${GIMP_DISTRIB}/bin/gimp-console-2.99.exe ${GIMP_PREFIX}/ ${GIMP_DISTRIB} + - python3 build/windows/gitlab-ci/dll_link.py ${GIMP_DISTRIB}/bin/gimp-test-clipboard-2.99.exe ${GIMP_PREFIX}/ ${GIMP_DISTRIB} + - python3 build/windows/gitlab-ci/dll_link.py ${GIMP_DISTRIB}/bin/gimptool-2.99.exe ${GIMP_PREFIX}/ ${GIMP_DISTRIB} - for dll in ${GIMP_DISTRIB}/lib/babl-0.1/*.dll; do - python3 build/windows/crossbuild-gitlab-ci/dll_link.py $dll ${GIMP_PREFIX}/ ${GIMP_DISTRIB}; + python3 build/windows/gitlab-ci/dll_link.py $dll ${GIMP_PREFIX}/ ${GIMP_DISTRIB}; done - for dll in ${GIMP_DISTRIB}/lib/gegl-0.4/*.dll; do - python3 build/windows/crossbuild-gitlab-ci/dll_link.py $dll ${GIMP_PREFIX}/ ${GIMP_DISTRIB}; + python3 build/windows/gitlab-ci/dll_link.py $dll ${GIMP_PREFIX}/ ${GIMP_DISTRIB}; done - for dll in ${GIMP_DISTRIB}/lib/gio/modules/*.dll; do - python3 build/windows/crossbuild-gitlab-ci/dll_link.py $dll ${GIMP_PREFIX}/ ${GIMP_DISTRIB}; + python3 build/windows/gitlab-ci/dll_link.py $dll ${GIMP_PREFIX}/ ${GIMP_DISTRIB}; done - for dll in ${GIMP_DISTRIB}/lib/gdk-pixbuf-2.0/2.10.0/loaders/*.dll; do - python3 build/windows/crossbuild-gitlab-ci/dll_link.py $dll ${GIMP_PREFIX}/ ${GIMP_DISTRIB}; + python3 build/windows/gitlab-ci/dll_link.py $dll ${GIMP_PREFIX}/ ${GIMP_DISTRIB}; done - for dll in ${GIMP_DISTRIB}/lib/gimp/2.99/modules/*.dll; do - python3 build/windows/crossbuild-gitlab-ci/dll_link.py $dll ${GIMP_PREFIX}/ ${GIMP_DISTRIB}; + python3 build/windows/gitlab-ci/dll_link.py $dll ${GIMP_PREFIX}/ ${GIMP_DISTRIB}; done - for dll in ${GIMP_DISTRIB}/lib/gimp/2.99/plug-ins/*/*.exe; do - python3 build/windows/crossbuild-gitlab-ci/dll_link.py $dll ${GIMP_PREFIX}/ ${GIMP_DISTRIB}; + python3 build/windows/gitlab-ci/dll_link.py $dll ${GIMP_PREFIX}/ ${GIMP_DISTRIB}; done needs: ["gimp-win32", "deps-win64"] diff --git a/build/windows/crossbuild-gitlab-ci/build-deps.sh b/build/windows/gitlab-ci/build-deps-crossroad.sh similarity index 100% rename from build/windows/crossbuild-gitlab-ci/build-deps.sh rename to build/windows/gitlab-ci/build-deps-crossroad.sh diff --git a/build/windows/gitlab-ci/build-deps-msys2.sh b/build/windows/gitlab-ci/build-deps-msys2.sh new file mode 100644 index 0000000000000000000000000000000000000000..31d400a95641ee5bb0daa983c5198a9ac67dbed3 --- /dev/null +++ b/build/windows/gitlab-ci/build-deps-msys2.sh @@ -0,0 +1,72 @@ +#!/bin/bash + +set -e + +if [[ "$MSYSTEM" == "MINGW32" ]]; then + export MSYS2_ARCH="i686" +else + export MSYS2_ARCH="x86_64" +fi + +# Why do we even have to remove these manually? The whole thing is +# messed up, but it looks like the Gitlab runner fails to clean properly +# (it spews a bunch of "failed to remove" warnings at runner start, then +# ends with a "error: failed to commit transaction (conflicting files)" +# listing the various files it failed to remove). +# Might be tied to: https://gitlab.com/gitlab-org/gitlab-runner/-/issues/1839 +rm -f /c/msys64/mingw64/bin/libpcre-1.dll +rm -f /c/msys64/mingw64/bin/libgio-2.0-0.dll +rm -f /c/msys64/mingw64/bin/libglib-2.0-0.dll +rm -f /c/msys64/mingw64/bin/libgmodule-2.0-0.dll +rm -f /c/msys64/mingw64/bin/libgobject-2.0-0.dll +rm -f /c/msys64/mingw64/bin/libpng16-16.dll +rm -f /c/msys64/mingw64/bin/gdk-pixbuf-pixdata.exe +rm -f /c/msys64/mingw64/bin/libgdk_pixbuf-2.0-0.dll +rm -f /c/msys64/mingw64/lib/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-png.dll + +# Update everything +pacman --noconfirm -Suy + +# Install the required packages +pacman --noconfirm -S --needed \ + base-devel \ + mingw-w64-$MSYS2_ARCH-toolchain \ + mingw-w64-$MSYS2_ARCH-meson \ + \ + mingw-w64-$MSYS2_ARCH-cairo \ + mingw-w64-$MSYS2_ARCH-gobject-introspection \ + mingw-w64-$MSYS2_ARCH-json-glib \ + mingw-w64-$MSYS2_ARCH-lcms2 \ + mingw-w64-$MSYS2_ARCH-lensfun \ + mingw-w64-$MSYS2_ARCH-libspiro \ + mingw-w64-$MSYS2_ARCH-maxflow \ + mingw-w64-$MSYS2_ARCH-openexr \ + mingw-w64-$MSYS2_ARCH-pango \ + mingw-w64-$MSYS2_ARCH-suitesparse \ + mingw-w64-$MSYS2_ARCH-vala + +export GIT_DEPTH=1 +export GIMP_PREFIX=`realpath ./_install` +export PATH="$GIMP_PREFIX/bin:$PATH" +export PKG_CONFIG_PATH="${GIMP_PREFIX}/lib/pkgconfig:$PKG_CONFIG_PATH" +export PKG_CONFIG_PATH="${GIMP_PREFIX}/share/pkgconfig:$PKG_CONFIG_PATH" +export LD_LIBRARY_PATH="${GIMP_PREFIX}/lib:${LD_LIBRARY_PATH}" +export ACLOCAL_FLAGS="-I/c/msys64/mingw64/share/aclocal" +export XDG_DATA_DIRS="${GIMP_PREFIX}/share:/mingw64/share/" + +git clone --depth=${GIT_DEPTH} https://gitlab.gnome.org/GNOME/babl.git _babl +git clone --depth=${GIT_DEPTH} https://gitlab.gnome.org/GNOME/gegl.git _gegl + +mkdir _babl/_build +cd _babl/_build +meson -Dprefix="${GIMP_PREFIX}" -Dwith-docs=false .. +ninja +ninja install + +mkdir ../../_gegl/_build +cd ../../_gegl/_build +meson -Dprefix="${GIMP_PREFIX}" -Ddocs=false \ + -Dcairo=enabled -Dumfpack=enabled \ + -Dopenexr=enabled -Dworkshop=true .. +ninja +ninja install diff --git a/build/windows/gitlab-ci/build-gimp-msys2.sh b/build/windows/gitlab-ci/build-gimp-msys2.sh new file mode 100644 index 0000000000000000000000000000000000000000..0ffb8a837c0c96a4e6e5bee348992dff34d17348 --- /dev/null +++ b/build/windows/gitlab-ci/build-gimp-msys2.sh @@ -0,0 +1,100 @@ +#!/bin/bash + +set -e + +if [[ "$MSYSTEM" == "MINGW32" ]]; then + export MSYS2_ARCH="i686" +else + export MSYS2_ARCH="x86_64" +fi + +# Why do we even have to remove these manually? The whole thing is +# messed up, but it looks like the Gitlab runner fails to clean properly +# (it spews a bunch of "failed to remove" warnings at runner start, then +# ends with a "error: failed to commit transaction (conflicting files)" +# listing the various files it failed to remove). +# Might be tied to: https://gitlab.com/gitlab-org/gitlab-runner/-/issues/1839 +rm -f /c/msys64/mingw64/bin/libpcre-1.dll +rm -f /c/msys64/mingw64/bin/libgio-2.0-0.dll +rm -f /c/msys64/mingw64/bin/libglib-2.0-0.dll +rm -f /c/msys64/mingw64/bin/libgmodule-2.0-0.dll +rm -f /c/msys64/mingw64/bin/libgobject-2.0-0.dll +rm -f /c/msys64/mingw64/bin/libpng16-16.dll +rm -f /c/msys64/mingw64/bin/gdk-pixbuf-pixdata.exe +rm -f /c/msys64/mingw64/bin/libgdk_pixbuf-2.0-0.dll +rm -f /c/msys64/mingw64/lib/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-png.dll + +# Update everything +pacman --noconfirm -Suy + +# Install the required packages +pacman --noconfirm -S --needed \ + base-devel \ + mingw-w64-$MSYS2_ARCH-toolchain \ + mingw-w64-$MSYS2_ARCH-ccache \ + \ + mingw-w64-$MSYS2_ARCH-appstream-glib \ + mingw-w64-$MSYS2_ARCH-atk \ + mingw-w64-$MSYS2_ARCH-cairo \ + mingw-w64-$MSYS2_ARCH-drmingw \ + mingw-w64-$MSYS2_ARCH-gexiv2 \ + mingw-w64-$MSYS2_ARCH-ghostscript \ + mingw-w64-$MSYS2_ARCH-glib-networking \ + mingw-w64-$MSYS2_ARCH-gobject-introspection \ + mingw-w64-$MSYS2_ARCH-gobject-introspection-runtime \ + mingw-w64-$MSYS2_ARCH-graphviz \ + mingw-w64-$MSYS2_ARCH-gtk3 \ + mingw-w64-$MSYS2_ARCH-gtk-doc \ + mingw-w64-$MSYS2_ARCH-iso-codes \ + mingw-w64-$MSYS2_ARCH-json-c \ + mingw-w64-$MSYS2_ARCH-json-glib \ + mingw-w64-$MSYS2_ARCH-lcms2 \ + mingw-w64-$MSYS2_ARCH-lensfun \ + mingw-w64-$MSYS2_ARCH-libarchive \ + mingw-w64-$MSYS2_ARCH-libheif \ + mingw-w64-$MSYS2_ARCH-libmypaint \ + mingw-w64-$MSYS2_ARCH-libspiro \ + mingw-w64-$MSYS2_ARCH-libwebp \ + mingw-w64-$MSYS2_ARCH-libwmf \ + mingw-w64-$MSYS2_ARCH-luajit \ + mingw-w64-$MSYS2_ARCH-maxflow \ + mingw-w64-$MSYS2_ARCH-mypaint-brushes \ + mingw-w64-$MSYS2_ARCH-openexr \ + mingw-w64-$MSYS2_ARCH-pango \ + mingw-w64-$MSYS2_ARCH-poppler \ + mingw-w64-$MSYS2_ARCH-poppler-data \ + mingw-w64-$MSYS2_ARCH-python3-gobject \ + mingw-w64-$MSYS2_ARCH-shared-mime-info \ + mingw-w64-$MSYS2_ARCH-suitesparse \ + mingw-w64-$MSYS2_ARCH-vala \ + mingw-w64-$MSYS2_ARCH-xpm-nox + +# XXX We've got a weird error when the prefix is in the current dir. +# Until we figure it out, this trick seems to work, even though it's +# completely ridiculous. +mv _install ~ + +export GIMP_PREFIX=`realpath ~/_install` +export PATH="$GIMP_PREFIX/bin:$PATH" +export PKG_CONFIG_PATH="${GIMP_PREFIX}/lib/pkgconfig:$PKG_CONFIG_PATH" +export PKG_CONFIG_PATH="${GIMP_PREFIX}/share/pkgconfig:$PKG_CONFIG_PATH" +export LD_LIBRARY_PATH="${GIMP_PREFIX}/lib:${LD_LIBRARY_PATH}" +export ACLOCAL_FLAGS="-I/c/msys64/mingw64/share/aclocal" +export XDG_DATA_DIRS="${GIMP_PREFIX}/share:/mingw64/share/" + +mkdir -p _ccache +export CCACHE_BASEDIR="$(pwd)" +export CCACHE_DIR="${CCACHE_BASEDIR}/_ccache" +export CC="ccache gcc" + +ccache --zero-stats +ccache --show-stats + +./autogen.sh --prefix="${GIMP_PREFIX}" +make -j4 +make install + +ccache --show-stats + +# XXX Moving back the prefix to be used as artifacts. +mv "${GIMP_PREFIX}" . diff --git a/build/windows/crossbuild-gitlab-ci/dll_link.py b/build/windows/gitlab-ci/dll_link.py similarity index 100% rename from build/windows/crossbuild-gitlab-ci/dll_link.py rename to build/windows/gitlab-ci/dll_link.py