gitlab-ci, build: Make 'aarch64' AppImage too

Partially reverts e01973b9

This makes the AppImage .sh script multiarch aware and
make Debian pipeline a GL 'matrix' for easier maintenance.

As consequence, making an arm64 .appimage is pretty easy now,
so let's make one since this arch is not that rare in Linux.
This commit is contained in:
Bruno 2024-12-20 18:49:42 -03:00
parent 461d5db07e
commit 46f716a0a3
No known key found for this signature in database
3 changed files with 223 additions and 134 deletions

View file

@ -82,17 +82,6 @@ workflow:
key: ${CI_JOB_NAME}${VARIANT} key: ${CI_JOB_NAME}${VARIANT}
paths: paths:
- _ccache/ - _ccache/
# Universal variables (works in all POSIX OSes and archs)
before_script:
- echo -e "\e[0Ksection_start:`date +%s`:environ[collapsed=true]\r\e[0KPreparing build environment"
- export PATH="$GIMP_PREFIX/bin:$PATH"
- gcc -print-multi-os-directory 2>/dev/null | grep ./ && export LIB_DIR=$(gcc -print-multi-os-directory | sed 's/\.\.\///g') || export LIB_DIR="lib"
- gcc -print-multiarch 2>/dev/null | grep . && export LIB_SUBDIR=$(echo $(gcc -print-multiarch)'/')
- export PKG_CONFIG_PATH="${GIMP_PREFIX}/${LIB_DIR}/${LIB_SUBDIR}pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}"
- export LD_LIBRARY_PATH="${GIMP_PREFIX}/${LIB_DIR}/${LIB_SUBDIR}${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
- export XDG_DATA_DIRS="${GIMP_PREFIX}/share:/usr/share${XDG_DATA_DIRS:+:$XDG_DATA_DIRS}"
- export GI_TYPELIB_PATH="${GIMP_PREFIX}/${LIB_DIR}/${LIB_SUBDIR}girepository-1.0${GI_TYPELIB_PATH:+:$GI_TYPELIB_PATH}"
- echo -e "\e[0Ksection_end:`date +%s`:environ\r\e[0K"
# Common artifacts behavior # Common artifacts behavior
artifacts: artifacts:
name: "${CI_JOB_NAME}${VARIANT}-${CI_COMMIT_REF_SLUG}-${CI_COMMIT_SHORT_SHA}" name: "${CI_JOB_NAME}${VARIANT}-${CI_COMMIT_REF_SLUG}-${CI_COMMIT_SHORT_SHA}"
@ -102,8 +91,6 @@ variables:
# Common cloning procedure # Common cloning procedure
GIT_DEPTH: "1" GIT_DEPTH: "1"
GIT_SUBMODULE_STRATEGY: none GIT_SUBMODULE_STRATEGY: none
# CI-wide Debian variables
GIMP_PREFIX: "${CI_PROJECT_DIR}/_install"
# Enable colorful output when supported (e.g. ninja, cppcheck) # Enable colorful output when supported (e.g. ninja, cppcheck)
CLICOLOR_FORCE: "1" CLICOLOR_FORCE: "1"
@ -118,6 +105,31 @@ stages:
## prepare build-oriented Docker images ## ## prepare build-oriented Docker images ##
.debian: .debian:
extends: .default
rules:
- if: '$CI_MERGE_REQUEST_LABELS =~ /.*5. AppImage package.*/'
interruptible: true
- if: '$GIMP_CI_APPIMAGE != null'
parallel:
matrix:
- RUNNER: [aarch64, x86_64_v2]
tags:
- $RUNNER
image: $CI_REGISTRY_IMAGE:build-debian-latest-${RUNNER}
before_script:
- export GIMP_PREFIX="${CI_PROJECT_DIR}/_install-${RUNNER}"
- echo -e "\e[0Ksection_start:`date +%s`:environ[collapsed=true]\r\e[0KPreparing build environment"
- export PATH="$GIMP_PREFIX/bin:$PATH"
- gcc -print-multi-os-directory 2>/dev/null | grep ./ && export LIB_DIR=$(gcc -print-multi-os-directory | sed 's/\.\.\///g') || export LIB_DIR="lib"
- gcc -print-multiarch 2>/dev/null | grep . && export LIB_SUBDIR=$(echo $(gcc -print-multiarch)'/')
- export PKG_CONFIG_PATH="${GIMP_PREFIX}/${LIB_DIR}/${LIB_SUBDIR}pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}"
- export LD_LIBRARY_PATH="${GIMP_PREFIX}/${LIB_DIR}/${LIB_SUBDIR}${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
- export XDG_DATA_DIRS="${GIMP_PREFIX}/share:/usr/share${XDG_DATA_DIRS:+:$XDG_DATA_DIRS}"
- export GI_TYPELIB_PATH="${GIMP_PREFIX}/${LIB_DIR}/${LIB_SUBDIR}girepository-1.0${GI_TYPELIB_PATH:+:$GI_TYPELIB_PATH}"
- echo -e "\e[0Ksection_end:`date +%s`:environ\r\e[0K"
.debian-x64:
extends: .debian
rules: rules:
- <<: *CI_MERGE - <<: *CI_MERGE
- <<: *CI_COMMIT - <<: *CI_COMMIT
@ -135,11 +147,14 @@ stages:
MESON_OPTIONS: "-Dvector-icons=false" MESON_OPTIONS: "-Dvector-icons=false"
VARIANT: "-raster" VARIANT: "-raster"
- if: '$GIMP_CI_CROSSROAD_WIN64 != null' - if: '$GIMP_CI_CROSSROAD_WIN64 != null'
- if: '$GIMP_CI_APPIMAGE != null'
- if: '$GIMP_CI_SOURCES != null' - if: '$GIMP_CI_SOURCES != null'
- <<: *CI_RELEASE - <<: *CI_RELEASE
parallel:
matrix:
- RUNNER: x86_64_v2
image-debian-x64: image-debian:
extends: .debian
rules: rules:
- !reference [.debian, rules] - !reference [.debian, rules]
stage: prepare stage: prepare
@ -148,7 +163,8 @@ image-debian-x64:
entrypoint: [""] entrypoint: [""]
variables: variables:
GIT_STRATEGY: none GIT_STRATEGY: none
cache: {} cache: []
before_script: []
script: script:
- export container=docker - export container=docker
- mkdir -p /kaniko/.docker - mkdir -p /kaniko/.docker
@ -226,17 +242,29 @@ image-debian-x64:
xvfb xvfb
xz-utils xz-utils
yelp-tools" >> Dockerfile yelp-tools" >> Dockerfile
- /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile --destination $CI_REGISTRY_IMAGE:build-debian-latest --cache=true --cache-ttl=120h - /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile --destination $CI_REGISTRY_IMAGE:build-debian-latest-${RUNNER} --cache=true --cache-ttl=120h
image-debian-x64:
extends: .debian-x64
rules:
- !reference [.debian-x64, rules]
stage: !reference [image-debian, stage]
image: !reference [image-debian, image]
variables: !reference [image-debian, variables]
cache: !reference [image-debian, cache]
before_script:
- !reference [image-debian, before_script]
script:
- !reference [image-debian, script]
## GNU/Linux 64-bit CIs (Debian bookworm) ## ## GNU/Linux 64-bit CIs (Debian bookworm) ##
deps-debian-x64: deps-debian:
extends: .default extends: .debian
rules: rules:
- !reference [.debian, rules] - !reference [.debian, rules]
needs: ["image-debian-x64"] needs: ["image-debian"]
stage: dependencies stage: dependencies
image: $CI_REGISTRY_IMAGE:build-debian-latest
variables: variables:
GIT_STRATEGY: none GIT_STRATEGY: none
script: script:
@ -251,8 +279,8 @@ deps-debian-x64:
fi fi
- git clone $babl_branch --depth=${GIT_DEPTH} https://gitlab.gnome.org/GNOME/babl.git - git clone $babl_branch --depth=${GIT_DEPTH} https://gitlab.gnome.org/GNOME/babl.git
- cd babl - cd babl
- meson setup _build -Dprefix="${GIMP_PREFIX}" - meson setup _build-${RUNNER} -Dprefix="${GIMP_PREFIX}"
- cd _build - cd _build-${RUNNER}
- ninja - ninja
- ninja install - ninja install
- ccache --show-stats - ccache --show-stats
@ -269,40 +297,75 @@ deps-debian-x64:
fi fi
- git clone $gegl_branch --depth=${GIT_DEPTH} https://gitlab.gnome.org/GNOME/gegl.git - git clone $gegl_branch --depth=${GIT_DEPTH} https://gitlab.gnome.org/GNOME/gegl.git
- cd gegl - cd gegl
- meson setup _build -Dprefix="${GIMP_PREFIX}" -Dworkshop=true - meson setup _build-${RUNNER} -Dprefix="${GIMP_PREFIX}" -Dworkshop=true
- cd _build - cd _build-${RUNNER}
- ninja - ninja
- ninja install - ninja install
- ccache --show-stats - ccache --show-stats
- echo -e "\e[0Ksection_end:`date +%s`:gegl_build\r\e[0K" - echo -e "\e[0Ksection_end:`date +%s`:gegl_build\r\e[0K"
artifacts: artifacts:
paths: paths:
- _install/ - _install-${RUNNER}/
- babl/_build/meson-logs/meson-log.txt - babl/_build-${RUNNER}/meson-logs/meson-log.txt
- babl/_build/config.h - babl/_build-${RUNNER}/config.h
- gegl/_build/meson-logs/meson-log.txt - gegl/_build-${RUNNER}/meson-logs/meson-log.txt
- gegl/_build/config.h - gegl/_build-${RUNNER}/config.h
expire_in: 2 hours expire_in: 2 hours
gimp-debian-x64: gimp-debian:
extends: .default extends: .debian
rules: rules:
- !reference [.debian, rules] - !reference [.debian, rules]
needs: ["deps-debian-x64"] needs: ["deps-debian"]
stage: gimp stage: gimp
image: $CI_REGISTRY_IMAGE:build-debian-latest
variables: variables:
GIT_SUBMODULE_STRATEGY: recursive GIT_SUBMODULE_STRATEGY: recursive
script:
# Build GIMP
- echo -e "\e[0Ksection_start:`date +%s`:gimp_build[collapsed=true]\r\e[0KBuilding GIMP"
- meson setup _build-${RUNNER} -Dprefix="${GIMP_PREFIX}"
-Drelocatable-bundle=yes
- cd _build-${RUNNER}
- ninja
- echo -e "\e[0Ksection_end:`date +%s`:gimp_build\r\e[0K"
# Create bundle
- echo -e "\e[0Ksection_start:`date +%s`:gimp_bundle[collapsed=true]\r\e[0KCreating bundle"
- ninja install &> ninja_install.log || cat ninja_install.log
- cd ..
- bash build/linux/appimage/3_dist-gimp-goappimage.sh --bundle-only &> goappimage.log || cat goappimage.log
- echo -e "\e[0Ksection_end:`date +%s`:gimp_bundle\r\e[0K"
artifacts:
paths:
- AppDir*/
- appimageignore*
- _build-${RUNNER}/config.h
expire_in: 2 days
deps-debian-x64:
extends: .debian-x64
rules:
- !reference [.debian-x64, rules]
needs: ["image-debian-x64"]
stage: !reference [deps-debian, stage]
variables: !reference [deps-debian, variables]
script:
- !reference [deps-debian, script]
artifacts: !reference [deps-debian, artifacts]
gimp-debian-x64:
extends: .debian-x64
rules:
- !reference [.debian-x64, rules]
needs: ["deps-debian-x64"]
stage: !reference [gimp-debian, stage]
variables: !reference [gimp-debian, variables]
script: script:
# Check building # Check building
- echo -e "\e[0Ksection_start:`date +%s`:gimp_build[collapsed=true]\r\e[0KBuilding GIMP" - echo -e "\e[0Ksection_start:`date +%s`:gimp_build[collapsed=true]\r\e[0KBuilding GIMP"
- mkdir -p _build && cd _build - meson setup _build-${RUNNER} -Dprefix="${GIMP_PREFIX}"
- meson setup .. -Dprefix="${GIMP_PREFIX}"
-Dgi-docgen=enabled
-Dg-ir-doc=true -Dg-ir-doc=true
-Drelocatable-bundle=no
-Denable-default-bin=enabled
$MESON_OPTIONS $MESON_OPTIONS
- cd _build-${RUNNER}
- ninja - ninja
- echo -e "\e[0Ksection_end:`date +%s`:gimp_build\r\e[0K" - echo -e "\e[0Ksection_end:`date +%s`:gimp_build\r\e[0K"
# Check execution # Check execution
@ -326,31 +389,16 @@ gimp-debian-x64:
- echo -e "\e[0Ksection_end:`date +%s`:gimp_install\r\e[0K" - echo -e "\e[0Ksection_end:`date +%s`:gimp_install\r\e[0K"
artifacts: artifacts:
paths: paths:
- _install/ - _install-${RUNNER}/
- _build/ - _build-${RUNNER}/meson-logs/meson-log.txt
- _build-${RUNNER}/meson-dist/
- _build-${RUNNER}/config.h
- _build-${RUNNER}/devel-docs/
reports: reports:
junit: "_build/meson-logs/testlog.junit.xml" junit: "_build-${RUNNER}/meson-logs/testlog.junit.xml"
expire_in: 2 days expire_in: 2 days
dist-appimage-weekly: ## Flatpak CI ##
extends: .default
rules:
- if: '$CI_MERGE_REQUEST_LABELS =~ /.*5. AppImage package.*/'
interruptible: true
- if: '$GIMP_CI_APPIMAGE != null'
needs: ["gimp-debian-x64"]
stage: distribution
image: $CI_REGISTRY_IMAGE:build-debian-latest
variables:
GIT_SUBMODULE_STRATEGY: recursive
script:
- bash build/linux/appimage/3_dist-gimp-goappimage.sh
artifacts:
expose_as: 'Linux appimage'
paths:
- build/linux/appimage/_Output/
- appimagetool.log
expire_in: 8 days
.flatpak-x64: .flatpak-x64:
extends: .default extends: .default
@ -361,7 +409,8 @@ dist-appimage-weekly:
tags: tags:
- flatpak - flatpak
image: 'quay.io/gnome_infrastructure/gnome-runtime-images:gnome-master' image: 'quay.io/gnome_infrastructure/gnome-runtime-images:gnome-master'
before_script: [] before_script:
- export GIMP_PREFIX="${CI_PROJECT_DIR}/_install"
deps-flatpak-x64: deps-flatpak-x64:
extends: .flatpak-x64 extends: .flatpak-x64
@ -413,14 +462,13 @@ gimp-flatpak-x64:
## WINDOWS 64-bit CI (cross-build crossroad) ## ## WINDOWS 64-bit CI (cross-build crossroad) ##
.win-cross: .win-cross:
extends: .default extends: .debian-x64
rules: rules:
- <<: *CI_MERGE - <<: *CI_MERGE
when: never when: never
- <<: *CI_COMMIT - <<: *CI_COMMIT
when: never when: never
- if: '$GIMP_CI_CROSSROAD_WIN64 != null' - if: '$GIMP_CI_CROSSROAD_WIN64 != null'
image: $CI_REGISTRY_IMAGE:build-debian-latest
deps-win-x64-cross: deps-win-x64-cross:
extends: .win-cross extends: .win-cross
@ -495,7 +543,6 @@ gimp-win-x64-cross:
variables: variables:
INSTALLER_OPTION: '-Dwindows-installer=true' INSTALLER_OPTION: '-Dwindows-installer=true'
STORE_OPTION: '-Dms-store=true' STORE_OPTION: '-Dms-store=true'
# We don't use the universal variables since we use PS
before_script: before_script:
# MSYS2 config # MSYS2 config
- $MSYS2_PREFIX = 'C:/msys64' - $MSYS2_PREFIX = 'C:/msys64'
@ -652,14 +699,13 @@ gimp-win-x86:
file-plug-in-tests: file-plug-in-tests:
# FIXME: Do we need another job testing this under Windows? MSYS2 usually has # FIXME: Do we need another job testing this under Windows? MSYS2 usually has
# the latest deps. It might be a good idea to test that too, maybe weekly? # the latest deps. It might be a good idea to test that too, maybe weekly?
extends: .default extends: .debian-x64
rules: rules:
# Don't run on release since the plug-in doesn't get installed in releases # Don't run on release since the plug-in doesn't get installed in releases
- <<: *CI_MERGE - <<: *CI_MERGE
- <<: *CI_COMMIT - <<: *CI_COMMIT
needs: ["deps-debian-x64", "gimp-debian-x64"] needs: ["deps-debian-x64", "gimp-debian-x64"]
stage: analysis stage: analysis
image: $CI_REGISTRY_IMAGE:build-debian-latest
variables: variables:
GIT_STRATEGY: none GIT_STRATEGY: none
GIMP_TESTS_DATA_FOLDER: "$CI_PROJECT_DIR/_data/gimp-test-images/" GIMP_TESTS_DATA_FOLDER: "$CI_PROJECT_DIR/_data/gimp-test-images/"
@ -670,8 +716,8 @@ file-plug-in-tests:
paths: paths:
- _data - _data
script: script:
- API_VER=$(grep GIMP_PKGCONFIG_VERSION _build/config.h | head -1 | sed 's/^.*"\([^"]*\)"$/\1/') - API_VER=$(grep GIMP_PKGCONFIG_VERSION _build*/config.h | head -1 | sed 's/^.*"\([^"]*\)"$/\1/')
- APP_VER=$(grep GIMP_APP_VERSION _build/config.h | head -1 | sed 's/^.*"\([^"]*\)"$/\1/') - APP_VER=$(grep GIMP_APP_VERSION _build*/config.h | head -1 | sed 's/^.*"\([^"]*\)"$/\1/')
- pkg-config --variable=gimplibdir gimp-${API_VER} 2>/dev/null | grep . && PLUG_IN_DIR=$(echo $(pkg-config --variable=gimplibdir gimp-${API_VER})'/plug-ins/') - pkg-config --variable=gimplibdir gimp-${API_VER} 2>/dev/null | grep . && PLUG_IN_DIR=$(echo $(pkg-config --variable=gimplibdir gimp-${API_VER})'/plug-ins/')
- export PYTHONPATH="${PLUG_IN_DIR}test-file-plug-ins" - export PYTHONPATH="${PLUG_IN_DIR}test-file-plug-ins"
- export GIMP_TESTS_CONFIG_FILE="${PLUG_IN_DIR}test-file-plug-ins/tests/batch-config.ini" - export GIMP_TESTS_CONFIG_FILE="${PLUG_IN_DIR}test-file-plug-ins/tests/batch-config.ini"
@ -747,7 +793,7 @@ sources-debian:
variables: variables:
GIT_STRATEGY: none GIT_STRATEGY: none
script: script:
- mv _build/meson-dist/gimp-*.tar.xz . - mv _build*/meson-dist/gimp-*.tar.xz .
- FILENAME=`ls gimp-*.tar.xz` && - FILENAME=`ls gimp-*.tar.xz` &&
sha256sum gimp-*.tar.xz > ${FILENAME}.SHA256SUMS && sha256sum gimp-*.tar.xz > ${FILENAME}.SHA256SUMS &&
sha512sum gimp-*.tar.xz > ${FILENAME}.SHA512SUMS sha512sum gimp-*.tar.xz > ${FILENAME}.SHA512SUMS
@ -772,8 +818,9 @@ dev-docs:
script: script:
- apt-get update - apt-get update
- apt-get install -y xz-utils - apt-get install -y xz-utils
- BABL_VER=$(grep BABL_VERSION babl/_build/config.h | head -1 | sed 's/^.*"\([^"]*\)"$/\1/') && - export GIMP_PREFIX=$(echo $PWD/_install*)
BABL_API_VER=$(grep BABL_API_VERSION babl/_build/config.h | head -1 | sed 's/^.*"\([^"]*\)"$/\1/') && - BABL_VER=$(grep BABL_VERSION babl/_build*/config.h | head -1 | sed 's/^.*"\([^"]*\)"$/\1/') &&
BABL_API_VER=$(grep BABL_API_VERSION babl/_build*/config.h | head -1 | sed 's/^.*"\([^"]*\)"$/\1/') &&
DIR_NAME=babl-api-docs-$BABL_VER && DIR_NAME=babl-api-docs-$BABL_VER &&
mkdir $DIR_NAME && mkdir $DIR_NAME &&
mv "${GIMP_PREFIX}/share/doc/babl-$BABL_API_VER" $DIR_NAME/ && mv "${GIMP_PREFIX}/share/doc/babl-$BABL_API_VER" $DIR_NAME/ &&
@ -781,9 +828,9 @@ dev-docs:
tar --dereference -cJf ${TAR_NAME} $DIR_NAME && tar --dereference -cJf ${TAR_NAME} $DIR_NAME &&
sha256sum $TAR_NAME > ${TAR_NAME}.SHA256SUMS && sha256sum $TAR_NAME > ${TAR_NAME}.SHA256SUMS &&
sha512sum $TAR_NAME > ${TAR_NAME}.SHA512SUMS sha512sum $TAR_NAME > ${TAR_NAME}.SHA512SUMS
- GEGL_MAJ_VER=$(grep GEGL_MAJOR_VERSION gegl/_build/config.h |head -1 |sed 's/^[^0-9]*\([0-9]*\).*$/\1/') && - GEGL_MAJ_VER=$(grep GEGL_MAJOR_VERSION gegl/_build*/config.h |head -1 |sed 's/^[^0-9]*\([0-9]*\).*$/\1/') &&
GEGL_MIN_VER=$(grep GEGL_MINOR_VERSION gegl/_build/config.h |head -1 |sed 's/^[^0-9]*\([0-9]*\).*$/\1/') && GEGL_MIN_VER=$(grep GEGL_MINOR_VERSION gegl/_build*/config.h |head -1 |sed 's/^[^0-9]*\([0-9]*\).*$/\1/') &&
GEGL_MIC_VER=$(grep GEGL_MICRO_VERSION gegl/_build/config.h |head -1 |sed 's/^[^0-9]*\([0-9]*\).*$/\1/') && GEGL_MIC_VER=$(grep GEGL_MICRO_VERSION gegl/_build*/config.h |head -1 |sed 's/^[^0-9]*\([0-9]*\).*$/\1/') &&
GEGL_VER="$GEGL_MAJ_VER.$GEGL_MIN_VER.$GEGL_MIC_VER" && GEGL_VER="$GEGL_MAJ_VER.$GEGL_MIN_VER.$GEGL_MIC_VER" &&
GEGL_API_VER="$GEGL_MAJ_VER.$GEGL_MIN_VER" && GEGL_API_VER="$GEGL_MAJ_VER.$GEGL_MIN_VER" &&
DIR_NAME=gegl-api-docs-$GEGL_VER && DIR_NAME=gegl-api-docs-$GEGL_VER &&
@ -793,12 +840,12 @@ dev-docs:
tar --dereference -cJf ${TAR_NAME} $DIR_NAME && tar --dereference -cJf ${TAR_NAME} $DIR_NAME &&
sha256sum $TAR_NAME > ${TAR_NAME}.SHA256SUMS && sha256sum $TAR_NAME > ${TAR_NAME}.SHA256SUMS &&
sha512sum $TAR_NAME > ${TAR_NAME}.SHA512SUMS sha512sum $TAR_NAME > ${TAR_NAME}.SHA512SUMS
- GIMP_VER=$(grep GIMP_VERSION _build/config.h | head -1 | sed 's/^.*"\([^"]*\)"$/\1/') && - GIMP_VER=$(grep GIMP_VERSION _build*/config.h | head -1 | sed 's/^.*"\([^"]*\)"$/\1/') &&
APP_VER=$(echo $GIMP_VER | sed 's/\([0-9]\+\.[0-9]\+\)\..*/\1/') && APP_VER=$(echo $GIMP_VER | sed 's/\([0-9]\+\.[0-9]\+\)\..*/\1/') &&
DIR_NAME=gimp-api-docs-$GIMP_VER && DIR_NAME=gimp-api-docs-$GIMP_VER &&
mkdir $DIR_NAME && mkdir $DIR_NAME &&
mv "${GIMP_PREFIX}/share/doc/gimp-$APP_VER" $DIR_NAME/reference && mv "${GIMP_PREFIX}/share/doc/gimp-$APP_VER" $DIR_NAME/reference &&
mv _build/devel-docs/g-ir-docs $DIR_NAME/ && mv _build*/devel-docs/g-ir-docs $DIR_NAME/ &&
TAR_NAME="$DIR_NAME.tar.xz" && TAR_NAME="$DIR_NAME.tar.xz" &&
tar --dereference -cJf ${TAR_NAME} $DIR_NAME && tar --dereference -cJf ${TAR_NAME} $DIR_NAME &&
sha256sum $TAR_NAME > ${TAR_NAME}.SHA256SUMS && sha256sum $TAR_NAME > ${TAR_NAME}.SHA256SUMS &&
@ -816,6 +863,21 @@ dev-docs:
- gimp-api-docs-*.tar.xz.SHA512SUMS - gimp-api-docs-*.tar.xz.SHA512SUMS
expire_in: 2 days expire_in: 2 days
dist-appimage-weekly:
extends: .default
rules:
- !reference [.debian, rules]
needs: ["gimp-debian"]
stage: distribution
cache: []
script:
- bash build/linux/appimage/3_dist-gimp-goappimage.sh _build-x86_64_v2
artifacts:
expose_as: 'Linux appimage'
paths:
- build/linux/appimage/_Output/
expire_in: 8 days
include: 'https://raw.githubusercontent.com/GNOME/citemplates/master/flatpak/flatpak_ci_initiative.yml' include: 'https://raw.githubusercontent.com/GNOME/citemplates/master/flatpak/flatpak_ci_initiative.yml'
dist-flatpak-weekly: dist-flatpak-weekly:
extends: extends:

View file

@ -23,14 +23,15 @@ if [ -f "*appimagetool*.AppImage" ]; then
rm *appimagetool*.AppImage rm *appimagetool*.AppImage
fi fi
if [ "$GITLAB_CI" ]; then if [ "$GITLAB_CI" ]; then
apt-get install -y --no-install-recommends wget >/dev/null 2>&1 apt-get update >/dev/null 2>&1
apt-get install -y --no-install-recommends ca-certificates wget >/dev/null 2>&1
fi fi
export ARCH=$(uname -m) export HOST_ARCH=$(uname -m)
export APPIMAGE_EXTRACT_AND_RUN=1 export APPIMAGE_EXTRACT_AND_RUN=1
## For now, we always use the latest go-appimagetool for bundling. See: https://github.com/probonopd/go-appimage/issues/275 ## For now, we always use the latest go-appimagetool for bundling. See: https://github.com/probonopd/go-appimage/issues/275
wget -c https://github.com/$(wget -q https://github.com/probonopd/go-appimage/releases/expanded_assets/continuous -O - | grep "appimagetool-.*-${ARCH}.AppImage" | head -n 1 | cut -d '"' -f 2) >/dev/null 2>&1 wget -c https://github.com/$(wget -q https://github.com/probonopd/go-appimage/releases/expanded_assets/continuous -O - | grep "appimagetool-.*-${HOST_ARCH}.AppImage" | head -n 1 | cut -d '"' -f 2) >/dev/null 2>&1
echo "(INFO): Downloaded go-appimagetool: $(echo appimagetool-*.AppImage | sed -e 's/appimagetool-//' -e "s/-${ARCH}.AppImage//")" echo "(INFO): Downloaded go-appimagetool: $(echo appimagetool-*.AppImage | sed -e 's/appimagetool-//' -e "s/-${HOST_ARCH}.AppImage//")"
go_appimagetool='go-appimagetool.AppImage' go_appimagetool='go-appimagetool.AppImage'
mv appimagetool-*.AppImage $go_appimagetool mv appimagetool-*.AppImage $go_appimagetool
chmod +x "$go_appimagetool" chmod +x "$go_appimagetool"
@ -41,7 +42,10 @@ if [ "$GITLAB_CI" ]; then
fi fi
## standard appimagetool is needed for squashing the .appimage file. See: https://github.com/probonopd/go-appimage/issues/86 ## standard appimagetool is needed for squashing the .appimage file. See: https://github.com/probonopd/go-appimage/issues/86
wget "https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-${ARCH}.AppImage" >/dev/null 2>&1 if [ "$GITLAB_CI" ]; then
apt-get install -y --no-install-recommends file zsync >/dev/null 2>&1
fi
wget "https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-${HOST_ARCH}.AppImage" >/dev/null 2>&1
standard_appimagetool='legacy-appimagetool.AppImage' standard_appimagetool='legacy-appimagetool.AppImage'
mv appimagetool-*.AppImage $standard_appimagetool mv appimagetool-*.AppImage $standard_appimagetool
chmod +x "$standard_appimagetool" chmod +x "$standard_appimagetool"
@ -50,10 +54,10 @@ echo -e "\e[0Ksection_end:`date +%s`:apmg_tlkt\r\e[0K"
# 2. GET GLOBAL VARIABLES # 2. GET GLOBAL VARIABLES
echo -e "\e[0Ksection_start:`date +%s`:apmg_info\r\e[0KGetting AppImage global info" echo -e "\e[0Ksection_start:`date +%s`:apmg_info\r\e[0KGetting AppImage global info"
if [ "$1" ]; then if [ "$1" != '' ] && [[ ! "$1" =~ "--" ]]; then
export BUILD_DIR="$1" export BUILD_DIR="$1"
else else
export BUILD_DIR="$PWD/_build" export BUILD_DIR=$(echo $PWD/_build*$RUNNER)
fi fi
## Get info about GIMP version ## Get info about GIMP version
@ -66,21 +70,12 @@ else
fi fi
export APP_ID="org.gimp.GIMP.$CHANNEL" export APP_ID="org.gimp.GIMP.$CHANNEL"
echo "(INFO): App ID: $APP_ID | Version: $GIMP_VERSION" echo "(INFO): App ID: $APP_ID | Version: $GIMP_VERSION"
## Prefixes to get files to copy
UNIX_PREFIX='/usr'
if [ -z "$GITLAB_CI" ] && [ -z "$GIMP_PREFIX" ]; then
export GIMP_PREFIX="$PWD/../_install"
fi
## Paths to receive copied files
APP_DIR="$PWD/AppDir"
USR_DIR="$APP_DIR/usr"
echo -e "\e[0Ksection_end:`date +%s`:apmg_info\r\e[0K" echo -e "\e[0Ksection_end:`date +%s`:apmg_info\r\e[0K"
# 3. GIMP FILES # 3. GIMP FILES
echo -e "\e[0Ksection_start:`date +%s`:apmg_files[collapsed=true]\r\e[0KPreparing GIMP files in AppDir/usr" if [ "$(ls -dq ./AppDir* 2>/dev/null | wc -l)" != '2' ]; then
echo -e "\e[0Ksection_start:`date +%s`:apmg_files[collapsed=true]\r\e[0KPreparing GIMP files in AppDir-$HOST_ARCH/usr"
## 3.1. Special re-building (only if needed) ## 3.1. Special re-building (only if needed)
@ -111,6 +106,17 @@ fi
## 3.2. Bundle files ## 3.2. Bundle files
#Prefixes to get files to copy
UNIX_PREFIX='/usr'
if [ -z "$GITLAB_CI" ] && [ -z "$GIMP_PREFIX" ]; then
export GIMP_PREFIX="$PWD/../_install"
fi
#Paths to receive copied files
APP_DIR="$PWD/AppDir-$HOST_ARCH"
USR_DIR="$APP_DIR/usr"
prep_pkg () prep_pkg ()
{ {
if [ "$GITLAB_CI" ]; then if [ "$GITLAB_CI" ]; then
@ -202,8 +208,12 @@ wipe_usr ()
## Prepare AppDir ## Prepare AppDir
mkdir -p $APP_DIR mkdir -p $APP_DIR
bund_usr "$UNIX_PREFIX" "lib64/ld-*.so.*" --go bund_usr "$UNIX_PREFIX" "lib*/ld-*.so.*" --go
conf_app LD_LINUX "lib64/ld-*.so.*" if [ "$HOST_ARCH" = 'aarch64' ]; then
conf_app LD_LINUX "lib/ld-*.so.*"
else
conf_app LD_LINUX "lib64/ld-*.so.*"
fi
## Bundle base (bare minimum to run GTK apps) ## Bundle base (bare minimum to run GTK apps)
### Glib needed files (to be able to use file dialogs) ### Glib needed files (to be able to use file dialogs)
@ -306,9 +316,14 @@ bund_usr "$GIMP_PREFIX" "share/applications/*.desktop" --rename $APP_ID.desktop
"./$go_appimagetool" -s deploy $USR_DIR/share/applications/$APP_ID.desktop &> appimagetool.log || cat appimagetool.log "./$go_appimagetool" -s deploy $USR_DIR/share/applications/$APP_ID.desktop &> appimagetool.log || cat appimagetool.log
## Manual adjustments (go-appimagetool don't handle Linux FHS gracefully yet) ## Manual adjustments (go-appimagetool don't handle Linux FHS gracefully yet)
### Undo the mess which breaks babl and GEGL. See: https://github.com/probonopd/go-appimage/issues/315
cp -r $APP_DIR/lib/* $USR_DIR/${LIB_DIR}
rm -r $APP_DIR/lib
### Ensure that LD is in right dir. See: https://github.com/probonopd/go-appimage/issues/49 ### Ensure that LD is in right dir. See: https://github.com/probonopd/go-appimage/issues/49
cp -r $APP_DIR/lib64 $USR_DIR if [ "$HOST_ARCH" = 'x86_64' ]; then
rm -r $APP_DIR/lib64 cp -r $APP_DIR/lib64 $USR_DIR
rm -r $APP_DIR/lib64
fi
chmod +x "$APP_DIR/$LD_LINUX" chmod +x "$APP_DIR/$LD_LINUX"
exec_array=($(find "$USR_DIR/bin" "$USR_DIR/$LIB_DIR" ! -iname "*.so*" -type f -exec head -c 4 {} \; -exec echo " {}" \; | grep ^.ELF)) exec_array=($(find "$USR_DIR/bin" "$USR_DIR/$LIB_DIR" ! -iname "*.so*" -type f -exec head -c 4 {} \; -exec echo " {}" \; | grep ^.ELF))
for exec in "${exec_array[@]}"; do for exec in "${exec_array[@]}"; do
@ -316,41 +331,45 @@ for exec in "${exec_array[@]}"; do
patchelf --set-interpreter "./$LD_LINUX" "$exec" >/dev/null 2>&1 || continue patchelf --set-interpreter "./$LD_LINUX" "$exec" >/dev/null 2>&1 || continue
fi fi
done done
### Undo the mess which breaks babl and GEGL. See: https://github.com/probonopd/go-appimage/issues/315 ## Unnecessary files created or bundled by go-appimagetool
cp -r $APP_DIR/lib/* $USR_DIR/${LIB_DIR} mv build/linux/appimage/AppRun $APP_DIR
rm -r $APP_DIR/lib mv build/linux/appimage/AppRun.bak build/linux/appimage/AppRun
## Unnecessary files bundled by go-appimagetool
echo "usr/${LIB_DIR}/${LIB_SUBDIR}gconv echo "usr/${LIB_DIR}/${LIB_SUBDIR}gconv
usr/${LIB_DIR}/${LIB_SUBDIR}gdk-pixbuf-*/gdk-pixbuf-query-loaders usr/${LIB_DIR}/${LIB_SUBDIR}gdk-pixbuf-*/gdk-pixbuf-query-loaders
usr/share/doc usr/share/doc
usr/share/themes usr/share/themes
etc" > .appimageignore etc" > appimageignore-$HOST_ARCH
echo -e "\e[0Ksection_end:`date +%s`:apmg_files\r\e[0K" echo -e "\e[0Ksection_end:`date +%s`:apmg_files\r\e[0K"
fi
if [ "$1" = '--bundle-only' ] || [ "$2" = '--bundle-only' ]; then
exit 0
fi
# 4. PREPARE .APPIMAGE-SPECIFIC "SOURCE" # 4. PREPARE .APPIMAGE-SPECIFIC "SOURCE"
echo -e "\e[0Ksection_start:`date +%s`:apmg_source[collapsed=true]\r\e[0KMaking AppImage assets" appdir_array=($(find . -maxdepth 1 -iname "AppDir*"))
for APP_DIR in "${appdir_array[@]}"; do
export ARCH=$(echo $APP_DIR | sed -e 's|AppDir-||' -e 's|./||')
echo -e "\e[0Ksection_start:`date +%s`:${ARCH}_source[collapsed=true]\r\e[0KMaking AppImage assets for $ARCH"
export USR_DIR="$APP_DIR/usr"
## 4.1. Finish AppRun configuration ## 4.1. Finish AppRun configuration
echo '(INFO): copying configured AppRun' echo '(INFO): finishing AppRun configuration'
sed -i '/_WILD/d' build/linux/appimage/AppRun sed -i '/_WILD/d' "$APP_DIR/AppRun"
sed -i "s/APP_ID/$APP_ID/" build/linux/appimage/AppRun sed -i "s/APP_ID/$APP_ID/" "$APP_DIR/AppRun"
mv build/linux/appimage/AppRun $APP_DIR
chmod +x $APP_DIR/AppRun chmod +x $APP_DIR/AppRun
mv build/linux/appimage/AppRun.bak build/linux/appimage/AppRun
## 4.2. Copy icon assets (similarly to flatpaks's 'rename-icon') ## 4.2. Copy icon assets (similarly to flatpaks's 'rename-icon')
echo "(INFO): copying $APP_ID.svg asset to AppDir" echo "(INFO): copying $APP_ID.svg asset to AppDir"
find "$USR_DIR/share/icons/hicolor" -iname *.svg -execdir ln -s "{}" $APP_ID.svg \; find "$USR_DIR/share/icons/hicolor" -iname *.svg -execdir ln -sf "{}" $APP_ID.svg \;
find "$USR_DIR/share/icons/hicolor" -iname *.png -execdir ln -s "{}" $APP_ID.png \; find "$USR_DIR/share/icons/hicolor" -iname *.png -execdir ln -sf "{}" $APP_ID.png \;
cp -L "$USR_DIR/share/icons/hicolor/scalable/apps/$APP_ID.svg" $APP_DIR cp -L "$USR_DIR/share/icons/hicolor/scalable/apps/$APP_ID.svg" $APP_DIR
## 4.3. Configure .desktop asset (similarly to flatpaks's 'rename-desktop-file') ## 4.3. Configure .desktop asset (similarly to flatpaks's 'rename-desktop-file')
echo "(INFO): configuring $APP_ID.desktop" echo "(INFO): configuring $APP_ID.desktop"
sed -i "s/Icon=gimp/Icon=$APP_ID/g" "$USR_DIR/share/applications/${APP_ID}.desktop" sed -i "s/Icon=gimp/Icon=$APP_ID/g" "$USR_DIR/share/applications/${APP_ID}.desktop"
gimp_app_version=$(grep GIMP_APP_VERSION $BUILD_DIR/config.h | head -1 | sed 's/^.*"\([^"]*\)"$/\1/') gimp_app_version=$(grep GIMP_APP_VERSION $BUILD_DIR/config.h | head -1 | sed 's/^.*"\([^"]*\)"$/\1/')
ln -s -r "$USR_DIR/bin/gimp-$gimp_app_version" "$USR_DIR/bin/$APP_ID" ln -sfr "$USR_DIR/bin/gimp-$gimp_app_version" "$USR_DIR/bin/$APP_ID"
sed -i "s/gimp-$gimp_app_version/$APP_ID/g" "$USR_DIR/share/applications/${APP_ID}.desktop" sed -i "s/gimp-$gimp_app_version/$APP_ID/g" "$USR_DIR/share/applications/${APP_ID}.desktop"
cp "$USR_DIR/share/applications/${APP_ID}.desktop" $APP_DIR cp "$USR_DIR/share/applications/${APP_ID}.desktop" $APP_DIR
@ -358,18 +377,21 @@ cp "$USR_DIR/share/applications/${APP_ID}.desktop" $APP_DIR
echo "(INFO): configuring $APP_ID.appdata.xml" echo "(INFO): configuring $APP_ID.appdata.xml"
sed -i "s/org.gimp.GIMP/${APP_ID}/g" "$USR_DIR/share/metainfo/${APP_ID}.appdata.xml" sed -i "s/org.gimp.GIMP/${APP_ID}/g" "$USR_DIR/share/metainfo/${APP_ID}.appdata.xml"
sed -i "s/gimp.desktop/${APP_ID}.desktop/g" "$USR_DIR/share/metainfo/${APP_ID}.appdata.xml" sed -i "s/gimp.desktop/${APP_ID}.desktop/g" "$USR_DIR/share/metainfo/${APP_ID}.appdata.xml"
echo -e "\e[0Ksection_end:`date +%s`:apmg_source\r\e[0K" echo -e "\e[0Ksection_end:`date +%s`:${ARCH}_source\r\e[0K"
# 5. CONSTRUCT .APPIMAGE # 5. CONSTRUCT .APPIMAGE
APPIMAGETOOL_APP_NAME="GIMP-${CHANNEL}-${ARCH}.AppImage" APPIMAGETOOL_APP_NAME="GIMP-${CHANNEL}-${ARCH}.AppImage"
echo -e "\e[0Ksection_start:`date +%s`:apmg_making[collapsed=true]\r\e[0KSquashing $APPIMAGETOOL_APP_NAME" echo -e "\e[0Ksection_start:`date +%s`:${ARCH}_making[collapsed=true]\r\e[0KSquashing $APPIMAGETOOL_APP_NAME"
"./$standard_appimagetool" -n $APP_DIR $APPIMAGETOOL_APP_NAME -u "zsync|https://gitlab.gnome.org/GNOME/gimp/-/jobs/artifacts/master/raw/build/linux/appimage/_Output/${APPIMAGETOOL_APP_NAME}.zsync?job=dist-appimage-weekly" "./$standard_appimagetool" -n $APP_DIR $APPIMAGETOOL_APP_NAME --exclude-file appimageignore-$ARCH #-u "zsync|https://gitlab.gnome.org/GNOME/gimp/-/jobs/artifacts/master/raw/build/linux/appimage/_Output/${APPIMAGETOOL_APP_NAME}.zsync?job=dist-appimage-weekly"
rm -r $APP_DIR file "./$APPIMAGETOOL_APP_NAME"
#standard appimagetool does not output runtime version at squashing. See: https://github.com/AppImage/appimagetool/issues/80 #standard appimagetool does not output runtime version at squashing. See: https://github.com/AppImage/appimagetool/issues/80
chmod +x "./$APPIMAGETOOL_APP_NAME" chmod +x "./$APPIMAGETOOL_APP_NAME"
"./$APPIMAGETOOL_APP_NAME" --appimage-version if [ "$ARCH" = "$HOST_ARCH" ]; then
echo -e "\e[0Ksection_end:`date +%s`:apmg_making\r\e[0K" "./$APPIMAGETOOL_APP_NAME" --appimage-version
fi
echo -e "\e[0Ksection_end:`date +%s`:${ARCH}_making\r\e[0K"
done
if [ "$GITLAB_CI" ]; then if [ "$GITLAB_CI" ]; then
mkdir -p build/linux/appimage/_Output/ mkdir -p build/linux/appimage/_Output/

View file

@ -22,20 +22,25 @@ fi
# FIXME: We need native/Linux gimp-console. # FIXME: We need native/Linux gimp-console.
# https://gitlab.gnome.org/GNOME/gimp/-/issues/6393 # https://gitlab.gnome.org/GNOME/gimp/-/issues/6393
if [ "$1" ]; then
export BUILD_DIR="$1"
else
export BUILD_DIR=$(echo _build*$RUNNER)
fi
if [ ! -d "$BUILD_DIR" ]; then
echo -e "\033[31m(ERROR)\033[0m: Before running this script, first build GIMP natively in $BUILD_DIR"
fi
if [ -z "$GITLAB_CI" ] && [ -z "$GIMP_PREFIX" ]; then if [ -z "$GITLAB_CI" ] && [ -z "$GIMP_PREFIX" ]; then
export GIMP_PREFIX="$PWD/../_install" export GIMP_PREFIX="$PWD/../_install"
fi fi
if [ ! -d '_build' ]; then
echo -e '\033[31m(ERROR)\033[0m: Before running this script, first build GIMP natively in _build'
fi
if [ ! -d "$GIMP_PREFIX" ]; then if [ ! -d "$GIMP_PREFIX" ]; then
echo -e "\033[31m(ERROR)\033[0m: Before running this script, first install GIMP natively in $GIMP_PREFIX" echo -e "\033[31m(ERROR)\033[0m: Before running this script, first install GIMP natively in $GIMP_PREFIX"
fi fi
if [ ! -d '_build' ] || [ ! -d "$GIMP_PREFIX" ]; then if [ ! -d "$BUILD_DIR" ] || [ ! -d "$GIMP_PREFIX" ]; then
echo 'Patches are very welcome: https://gitlab.gnome.org/GNOME/gimp/-/issues/6393' echo 'Patches are very welcome: https://gitlab.gnome.org/GNOME/gimp/-/issues/6393'
exit 1 exit 1
fi fi
GIMP_APP_VERSION=$(grep GIMP_APP_VERSION _build/config.h | head -1 | sed 's/^.*"\([^"]*\)"$/\1/') GIMP_APP_VERSION=$(grep GIMP_APP_VERSION $BUILD_DIR/config.h | head -1 | sed 's/^.*"\([^"]*\)"$/\1/')
GIMP_CONSOLE_PATH=$PWD/${PARENT_DIR}.local/bin/gimp-console-$GIMP_APP_VERSION GIMP_CONSOLE_PATH=$PWD/${PARENT_DIR}.local/bin/gimp-console-$GIMP_APP_VERSION
echo "#!/bin/sh" > $GIMP_CONSOLE_PATH echo "#!/bin/sh" > $GIMP_CONSOLE_PATH
IFS=$'\n' VAR_ARRAY=($(cat .gitlab-ci.yml | sed -n '/export PATH=/,/GI_TYPELIB_PATH}\"/p' | sed 's/ - //')) IFS=$'\n' VAR_ARRAY=($(cat .gitlab-ci.yml | sed -n '/export PATH=/,/GI_TYPELIB_PATH}\"/p' | sed 's/ - //'))