gitlab-ci, build: Implement GL collapsed logs (like GHA/CircleCI 'steps')

This provides us fine-grained info on how much time each step take,
making easier to spot stuckness and to quickly understand the logs.

'gimp' jobs normally do not take advantage on this due to log limits
(they expand and crop the log), so I adapted them to only output errors.

---

Also, to reduce logs, all jobs were reviewed with proper GIT_* variables.
This commit is contained in:
Bruno 2024-12-11 13:47:09 -03:00
parent 5577ae851e
commit 1309e98fb9
No known key found for this signature in database
12 changed files with 362 additions and 262 deletions

View File

@ -84,6 +84,7 @@ workflow:
- _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)'/')
@ -91,6 +92,7 @@ workflow:
- 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
artifacts:
name: "${CI_JOB_NAME}${VARIANT}-${CI_COMMIT_REF_SLUG}-${CI_COMMIT_SHORT_SHA}"
@ -99,7 +101,7 @@ workflow:
variables:
# Common cloning procedure
GIT_DEPTH: "1"
GIT_SUBMODULE_STRATEGY: recursive
GIT_SUBMODULE_STRATEGY: none
# CI-wide Debian variables
GIMP_PREFIX: "${CI_PROJECT_DIR}/_install"
# Enable colorful output when supported (e.g. ninja, cppcheck)
@ -235,34 +237,44 @@ deps-debian-x64:
needs: ["image-debian-x64"]
stage: dependencies
image: $CI_REGISTRY_IMAGE:build-debian-latest
variables:
GIT_STRATEGY: none
script:
# Clone babl and GEGL
# Clone and build babl
- echo -e "\e[0Ksection_start:`date +%s`:babl_build[collapsed=true]\r\e[0KBuilding babl"
- if [ "$CI_COMMIT_TAG" != "" ]; then
repo=https://gitlab.gnome.org/GNOME/babl.git;
babl_tag=$(git ls-remote --tags --exit-code --refs "$repo" |
grep -oi "BABL_[0-9]*_[0-9]*_[0-9]*" |
sort --version-sort | tail -1);
babl_branch="--branch=$babl_tag";
fi
- git clone $babl_branch --depth=${GIT_DEPTH} https://gitlab.gnome.org/GNOME/babl.git
- cd babl
- meson setup _build -Dprefix="${GIMP_PREFIX}"
- cd _build
- ninja
- ninja install
- ccache --show-stats
- cd ../..
- echo -e "\e[0Ksection_end:`date +%s`:babl_build\r\e[0K"
# Clone and build gegl
- echo -e "\e[0Ksection_start:`date +%s`:gegl_build[collapsed=true]\r\e[0KBuilding gegl"
- if [ "$CI_COMMIT_TAG" != "" ]; then
repo=https://gitlab.gnome.org/GNOME/gegl.git;
gegl_tag=$(git ls-remote --tags --exit-code --refs "$repo" |
grep -oi "GEGL_[0-9]*_[0-9]*_[0-9]*" |
sort --version-sort | tail -1);
gegl_branch="--branch=$gegl_tag";
fi
- git clone $babl_branch --depth=${GIT_DEPTH} https://gitlab.gnome.org/GNOME/babl.git
- git clone $gegl_branch --depth=${GIT_DEPTH} https://gitlab.gnome.org/GNOME/gegl.git
# Build babl and GEGL
- mkdir babl/_build && cd babl/_build
- meson setup .. -Dprefix="${GIMP_PREFIX}"
- ninja
- ninja install
- ccache --show-stats
- mkdir ../../gegl/_build && cd ../../gegl/_build
- meson setup .. -Dprefix="${GIMP_PREFIX}" -Dworkshop=true
- cd gegl
- meson setup _build -Dprefix="${GIMP_PREFIX}" -Dworkshop=true
- cd _build
- ninja
- ninja install
- ccache --show-stats
- echo -e "\e[0Ksection_end:`date +%s`:gegl_build\r\e[0K"
artifacts:
paths:
- _install/
@ -279,8 +291,11 @@ gimp-debian-x64:
needs: ["deps-debian-x64"]
stage: gimp
image: $CI_REGISTRY_IMAGE:build-debian-latest
variables:
GIT_SUBMODULE_STRATEGY: recursive
script:
# Check building
- echo -e "\e[0Ksection_start:`date +%s`:gimp_build[collapsed=true]\r\e[0KBuilding GIMP"
- mkdir -p _build && cd _build
- meson setup .. -Dprefix="${GIMP_PREFIX}"
-Dgi-docgen=enabled
@ -289,19 +304,26 @@ gimp-debian-x64:
-Denable-default-bin=enabled
$MESON_OPTIONS
- ninja
- echo -e "\e[0Ksection_end:`date +%s`:gimp_build\r\e[0K"
# Check execution
- echo -e "\e[0Ksection_start:`date +%s`:gimp_test[collapsed=true]\r\e[0KTesting GIMP execution"
- ninja test
- echo -e "\e[0Ksection_end:`date +%s`:gimp_test\r\e[0K"
# Check source
- echo -e "\e[0Ksection_start:`date +%s`:gimp_tar[collapsed=true]\r\e[0KChecking GIMP source"
- if [ $(git diff |wc -l) -ne 0 ]; then
echo "ERROR. A generated file was updated without the source:";
git diff;
exit 1;
fi
- if [ "$VARIANT" != "-gcc" ] && [ "$VARIANT" != "-raster" ] && [ "$CI_PIPELINE_SOURCE" != "merge_request_event" ]; then
ninja dist;
ninja dist &> ninja_dist.txt || cat ninja_dist.txt;
fi
- echo -e "\e[0Ksection_end:`date +%s`:gimp_tar\r\e[0K"
# Check install
- ninja install
- echo -e "\e[0Ksection_start:`date +%s`:gimp_install[collapsed=true]\r\e[0KChecking GIMP installation"
- ninja install &> ninja_install.txt || cat ninja_install.txt;
- echo -e "\e[0Ksection_end:`date +%s`:gimp_install\r\e[0K"
artifacts:
paths:
- _install/
@ -319,6 +341,8 @@ dist-appimage-weekly:
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:
@ -337,6 +361,7 @@ dist-appimage-weekly:
tags:
- flatpak
image: 'quay.io/gnome_infrastructure/gnome-runtime-images:gnome-master'
before_script: []
deps-flatpak-x64:
extends: .flatpak-x64
@ -375,6 +400,8 @@ gimp-flatpak-x64:
# key: $CI_JOB_NAME
# paths:
# _ccache/
variables:
GIT_SUBMODULE_STRATEGY: recursive
script:
- bash build/linux/flatpak/2_build-gimp-flatpak.sh
artifacts:
@ -423,6 +450,8 @@ gimp-win-x64-cross:
- !reference [.win-cross, rules]
needs: ["deps-win-x64-cross", "gimp-debian-x64"]
stage: gimp
variables:
GIT_SUBMODULE_STRATEGY: recursive
script:
- bash build/windows/2_build-gimp-crossroad.sh
artifacts:
@ -474,10 +503,12 @@ gimp-win-x64-cross:
# Build-time vars
# FIXME:'gimpenv' have buggy code about Windows paths. See: https://gitlab.gnome.org/GNOME/gimp/-/issues/12284
- $GIMP_PREFIX = "$PWD\_install".Replace('\', '/')
- Write-Output "$([char]27)[0Ksection_start:$(Get-Date -UFormat %s -Millisecond 0):win_environ[collapsed=true]$([char]13)$([char]27)[0KPreparing build environment"
- $env:Path = $env:Path + ";$GIMP_PREFIX/bin"
- $env:PKG_CONFIG_PATH = "$MSYS2_PREFIX/$MSYSTEM_PREFIX/lib/pkgconfig;$MSYS2_PREFIX/$MSYSTEM_PREFIX/share/pkgconfig;$GIMP_PREFIX/lib/pkgconfig"
- $env:XDG_DATA_DIRS = "$MSYS2_PREFIX/$MSYSTEM_PREFIX/share;$GIMP_PREFIX/share"
- $env:GI_TYPELIB_PATH = "$MSYS2_PREFIX/$MSYSTEM_PREFIX/lib/girepository-1.0;$GIMP_PREFIX/lib/girepository-1.0"
- Write-Output "$([char]27)[0Ksection_end:$(Get-Date -UFormat %s -Millisecond 0):win_environ$([char]13)$([char]27)[0K"
## WINDOWS Aarch64 CI (native MSYS2) ##
.win-a64:
@ -511,6 +542,8 @@ gimp-win-a64:
- !reference [.win-a64, rules]
needs: ["deps-win-a64"]
stage: gimp
variables:
GIT_SUBMODULE_STRATEGY: recursive
script:
- build/windows/2_build-gimp-msys2.ps1
artifacts:
@ -555,6 +588,8 @@ gimp-win-x64:
- !reference [.win-x64, rules]
needs: ["deps-win-x64"]
stage: gimp
variables:
GIT_SUBMODULE_STRATEGY: recursive
script:
- build/windows/2_build-gimp-msys2.ps1
artifacts:
@ -599,10 +634,12 @@ gimp-win-x86:
- !reference [.win-x86, rules]
needs: ["deps-win-x86"]
stage: gimp
variables:
GIT_SUBMODULE_STRATEGY: recursive
script:
- build/windows/2_build-gimp-msys2.ps1
# We split 32-bit DWARF symbols here because LLVM-objcopy do NOT support them
- bash build/windows/installer/3_dist-gimp-inno_sym.sh
- bash build/windows/installer/3_dist-gimp-inno_sym.sh gimp-x86
artifacts:
paths:
- gimp-x86/
@ -624,6 +661,7 @@ file-plug-in-tests:
stage: analysis
image: $CI_REGISTRY_IMAGE:build-debian-latest
variables:
GIT_STRATEGY: none
GIMP_TESTS_DATA_FOLDER: "$CI_PROJECT_DIR/_data/gimp-test-images/"
GIMP_TESTS_LOG_FILE: "$CI_PROJECT_DIR/_log/import-tests.log"
REGRESSION_STRING: "Total number of regressions: 0"
@ -706,6 +744,8 @@ sources-debian:
needs: ["gimp-debian-x64"]
stage: distribution
cache: []
variables:
GIT_STRATEGY: none
script:
- mv _build/meson-dist/gimp-*.tar.xz .
- FILENAME=`ls gimp-*.tar.xz` &&
@ -727,6 +767,8 @@ dev-docs:
needs: ["deps-debian-x64", "gimp-debian-x64"]
stage: distribution
cache: []
variables:
GIT_STRATEGY: none
script:
- apt-get update
- apt-get install -y xz-utils

View File

@ -18,6 +18,7 @@ fi
# 1. INSTALL GO-APPIMAGETOOL AND COMPLEMENTARY TOOLS
echo -e "\e[0Ksection_start:`date +%s`:apmg_tlkt\r\e[0KInstalling go-appimagetool and other tools"
if [ -f "*appimagetool*.AppImage" ]; then
rm *appimagetool*.AppImage
fi
@ -28,7 +29,6 @@ export ARCH=$(uname -m)
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
echo '(INFO): downloading go-appimagetool'
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
echo "(INFO): Downloaded go-appimagetool: $(echo appimagetool-*.AppImage | sed -e 's/appimagetool-//' -e "s/-${ARCH}.AppImage//")"
go_appimagetool='go-appimagetool.AppImage'
@ -45,9 +45,11 @@ wget "https://github.com/AppImage/appimagetool/releases/download/continuous/appi
standard_appimagetool='legacy-appimagetool.AppImage'
mv appimagetool-*.AppImage $standard_appimagetool
chmod +x "$standard_appimagetool"
echo -e "\e[0Ksection_end:`date +%s`:apmg_tlkt\r\e[0K"
# 2. GET GLOBAL VARIABLES
echo -e "\e[0Ksection_start:`date +%s`:apmg_info\r\e[0KGetting AppImage global info"
if [ "$1" ]; then
export BUILD_DIR="$1"
else
@ -63,6 +65,7 @@ else
export CHANNEL='latest'
fi
export APP_ID="org.gimp.GIMP.$CHANNEL"
echo "(INFO): App ID: $APP_ID | Version: $GIMP_VERSION"
## Prefixes to get files to copy
UNIX_PREFIX='/usr'
@ -73,9 +76,11 @@ 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"
# 3. GIMP FILES
echo -e "\e[0Ksection_start:`date +%s`:apmg_files[collapsed=true]\r\e[0KPreparing GIMP files in AppDir/usr"
## 3.1. Special re-building (only if needed)
@ -143,10 +148,13 @@ bund_usr ()
target_array=($(find $expanded_path -maxdepth 1 -name ${2##*/}))
for target_path in "${target_array[@]}"; do
dest_path="$(dirname $(echo $target_path | sed "s|$1/|${USR_DIR}/|g"))"
output_dest_path="$dest_path"
if [ "$3" = '--dest' ]; then
dest_path="${USR_DIR}/$4/tmp"
output_dest_path="${USR_DIR}/$4"
dest_path="$output_dest_path/tmp"
fi
mkdir -p $dest_path
echo "(INFO): bundling $target_path to $output_dest_path"
cp -ru $target_path $dest_path >/dev/null 2>&1 || continue
#Additional parameters for special situations
@ -162,6 +170,8 @@ bund_usr ()
#Undo the tweak done above
cd ..
rm -r limbo
else
echo "(INFO): skipping $1/$2 (will be bundled by go-appimagetool)"
fi
}
@ -191,7 +201,6 @@ wipe_usr ()
}
## Prepare AppDir
echo '(INFO): copying files to AppDir/usr'
mkdir -p $APP_DIR
bund_usr "$UNIX_PREFIX" "lib64/ld-*.so.*" --go
conf_app LD_LINUX "lib64/ld-*.so.*"
@ -292,7 +301,8 @@ wipe_usr ${LIB_DIR}/*.pyc
bund_usr "$GIMP_PREFIX" 'bin/gimp*'
bund_usr "$GIMP_PREFIX" "bin/gegl"
bund_usr "$GIMP_PREFIX" "share/applications/*.desktop" --rename $APP_ID.desktop
"./$go_appimagetool" -s deploy $USR_DIR/share/applications/$APP_ID.desktop &> appimagetool.log
#go-appimagetool have too polluted output so we save as log. See: https://github.com/probonopd/go-appimage/issues/314
"./$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)
### Ensure that LD is in right dir. See: https://github.com/probonopd/go-appimage/issues/49
@ -315,9 +325,11 @@ echo "usr/${LIB_DIR}/${LIB_SUBDIR}gconv
usr/share/doc
usr/share/themes
etc" > .appimageignore
echo -e "\e[0Ksection_end:`date +%s`:apmg_files\r\e[0K"
# 4. PREPARE .APPIMAGE-SPECIFIC "SOURCE"
echo -e "\e[0Ksection_start:`date +%s`:apmg_source[collapsed=true]\r\e[0KMaking AppImage assets"
## 4.1. Finish AppRun configuration
echo '(INFO): copying configured AppRun'
@ -341,16 +353,18 @@ cp "$USR_DIR/share/applications/${APP_ID}.desktop" $APP_DIR
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/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"
# 5. CONSTRUCT .APPIMAGE
APPIMAGETOOL_APP_NAME="GIMP-${CHANNEL}-${ARCH}.AppImage"
echo "(INFO): making $APPIMAGETOOL_APP_NAME"
"./$standard_appimagetool" -n $APP_DIR $APPIMAGETOOL_APP_NAME &>> appimagetool.log -u "zsync|https://gitlab.gnome.org/GNOME/gimp/-/jobs/artifacts/master/raw/build/linux/appimage/_Output/${APPIMAGETOOL_APP_NAME}.zsync?job=dist-appimage-weekly"
echo -e "\e[0Ksection_start:`date +%s`:apmg_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"
rm -r $APP_DIR
#standard appimagetool does not output runtime version at squashing. See: https://github.com/AppImage/appimagetool/issues/80
chmod +x "./$APPIMAGETOOL_APP_NAME"
"./$APPIMAGETOOL_APP_NAME" --appimage-version &>> appimagetool.log
"./$APPIMAGETOOL_APP_NAME" --appimage-version
echo -e "\e[0Ksection_end:`date +%s`:apmg_making\r\e[0K"
if [ "$GITLAB_CI" ]; then
mkdir -p build/linux/appimage/_Output/

View File

@ -39,7 +39,6 @@ fi
# Build some deps (including babl and GEGL)
echo '(INFO): building dependencies not present in GNOME runtime (including babl and GEGL)'
if [ -z "$GITLAB_CI" ] && [ "$1" != '--ci' ]; then
flatpak-builder --force-clean --ccache --state-dir=../.flatpak-builder --keep-build-dirs --stop-at=gimp \
"$GIMP_PREFIX" build/linux/flatpak/org.gimp.GIMP-nightly.json 2>&1 | tee flatpak-builder.log
@ -47,11 +46,25 @@ if [ -z "$GITLAB_CI" ] && [ "$1" != '--ci' ]; then
elif [ "$GITLAB_CI" ] || [ "$1" = '--ci' ]; then
## (The deps building is too long and no complete output would be collected,
## even from GitLab runner messages. So, let's silent and save logs as a file.)
flatpak-builder --force-clean --user --disable-rofiles-fuse --keep-build-dirs --build-only --stop-at=gimp \
echo -e "\e[0Ksection_start:`date +%s`:deps_build[collapsed=true]\r\e[0KBuilding dependencies not present in GNOME runtime"
flatpak-builder --force-clean --user --disable-rofiles-fuse --keep-build-dirs --build-only --stop-at=babl \
"$GIMP_PREFIX" build/linux/flatpak/org.gimp.GIMP-nightly.json &> flatpak-builder.log
echo -e "\e[0Ksection_end:`date +%s`:deps_build\r\e[0K"
echo -e "\e[0Ksection_start:`date +%s`:babl_build[collapsed=true]\r\e[0KBuilding babl"
flatpak-builder --force-clean --user --disable-rofiles-fuse --keep-build-dirs --build-only --stop-at=gegl \
"$GIMP_PREFIX" build/linux/flatpak/org.gimp.GIMP-nightly.json
if [ "$GITLAB_CI" ]; then
tar cf babl-meson-log.tar .flatpak-builder/build/babl-1/_flatpak_build/meson-logs/meson-log.txt
fi
echo -e "\e[0Ksection_end:`date +%s`:babl_build\r\e[0K"
echo -e "\e[0Ksection_start:`date +%s`:gegl_build[collapsed=true]\r\e[0KBuilding gegl"
flatpak-builder --force-clean --user --disable-rofiles-fuse --keep-build-dirs --build-only --stop-at=gimp \
"$GIMP_PREFIX" build/linux/flatpak/org.gimp.GIMP-nightly.json
if [ "$GITLAB_CI" ]; then
tar cf gegl-meson-log.tar .flatpak-builder/build/gegl-1/_flatpak_build/meson-logs/meson-log.txt
echo -e "\e[0Ksection_end:`date +%s`:gegl_build\r\e[0K"
## Save built deps for 'gimp-flatpak-x64' job
tar cf .flatpak-builder.tar .flatpak-builder/

View File

@ -17,7 +17,6 @@ fi
if [ "$GITLAB_CI" ]; then
# Extract deps from previous job
echo '(INFO): extracting previously built dependencies'
tar xf .flatpak-builder.tar
fi
@ -45,17 +44,21 @@ if [ -z "$GITLAB_CI" ] && [ "$1" != '--ci' ]; then
flatpak-builder --run "$GIMP_PREFIX" ../build/linux/flatpak/org.gimp.GIMP-nightly.json ninja install
elif [ "$GITLAB_CI" ] || [ "$1" = '--ci' ]; then
flatpak-builder --force-clean --user --disable-rofiles-fuse --keep-build-dirs --build-only \
"$GIMP_PREFIX" build/linux/flatpak/org.gimp.GIMP-nightly.json
echo -e "\e[0Ksection_start:`date +%s`:gimp_build[collapsed=true]\r\e[0KBuilding GIMP"
flatpak-builder --force-clean --user --disable-rofiles-fuse --keep-build-dirs --build-only --disable-download \
"$GIMP_PREFIX" build/linux/flatpak/org.gimp.GIMP-nightly.json &> gimp-flatpak-builder.log || cat gimp-flatpak-builder.log
if [ "$GITLAB_CI" ]; then
tar cf gimp-meson-log.tar .flatpak-builder/build/gimp-1/_flatpak_build/meson-logs/meson-log.txt
fi
echo -e "\e[0Ksection_end:`date +%s`:gimp_build\r\e[0K"
## Cleanup GIMP_PREFIX (not working) and export it to OSTree repo
## https://github.com/flatpak/flatpak-builder/issues/14
echo -e "\e[0Ksection_start:`date +%s`:gimp_bundle[collapsed=true]\r\e[0KCreating OSTree repo"
flatpak-builder --user --disable-rofiles-fuse --finish-only --repo=repo \
"$GIMP_PREFIX" build/linux/flatpak/org.gimp.GIMP-nightly.json
if [ "$GITLAB_CI" ]; then
tar cf repo.tar repo/
fi
echo -e "\e[0Ksection_end:`date +%s`:gimp_bundle\r\e[0K"
fi

View File

@ -5,24 +5,26 @@ set -e
if [ "$GITLAB_CI" ]; then
# Extract previously exported OSTree repo/
echo '(INFO): extracting previously exported repo'
tar xf repo.tar --warning=no-timestamp
fi
# Generate a Flatpak "bundle" to be tested with GNOME runtime installed
# (it is NOT a real/full bundle, deps from GNOME runtime are not bundled)
echo '(INFO): packaging repo as .flatpak'
echo -e "\e[0Ksection_start:`date +%s`:flat_making[collapsed=true]\r\e[0KPackaging repo as org.gimp.GIMP.flatpak"
flatpak build-bundle repo org.gimp.GIMP.flatpak --runtime-repo=https://nightly.gnome.org/gnome-nightly.flatpakrepo org.gimp.GIMP ${BRANCH}
echo -e "\e[0Ksection_end:`date +%s`:flat_making\r\e[0K"
# Publish GIMP repo in GNOME nightly
# We take the commands from 'flatpak_ci_initiative.yml'
if [ "$GITLAB_CI" ] && [ "$CI_COMMIT_BRANCH" = "$CI_DEFAULT_BRANCH" ]; then
echo -e "\e[0Ksection_start:`date +%s`:flat_publish[collapsed=true]\r\e[0KPublishing repo to GNOME nightly"
curl https://gitlab.gnome.org/GNOME/citemplates/raw/master/flatpak/flatpak_ci_initiative.yml --output flatpak_ci_initiative.yml
IFS=$'\n' cmd_array=($(cat flatpak_ci_initiative.yml | sed -n '/flatpak build-update-repo/,/exit $result\"/p' | sed 's/ - //'))
IFS=$' \t\n'
for cmd in "${cmd_array[@]}"; do
eval "$cmd" || continue
done
echo -e "\e[0Ksection_end:`date +%s`:flat_publish\r\e[0K"
fi

View File

@ -751,6 +751,127 @@
"/lib/pkgconfig"
]
},
{
"//": "Originally taken from org.octave.Octave manifest",
"name": "SuiteSparse",
"sources": [
{
"type": "archive",
"url": "https://github.com/DrTimothyAldenDavis/SuiteSparse/archive/v7.8.3.tar.gz",
"sha256": "ce39b28d4038a09c14f21e02c664401be73c0cb96a9198418d6a98a7db73a259",
"x-checker-data": {
"type": "anitya",
"project-id": 4908,
"stable-only": true,
"url-template": "https://github.com/DrTimothyAldenDavis/SuiteSparse/archive/v$version.tar.gz"
}
}
],
"buildsystem": "cmake-ninja",
"builddir": true,
"config-opts": [
"-DBLA_VENDOR=OpenBLAS",
"-DGRAPHBLAS_COMPACT=ON",
"-DSUITESPARSE_USE_OPENMP=OFF",
"-DSUITESPARSE_USE_PYTHON=OFF",
"-DSUITESPARSE_DEMOS=OFF",
"-DBUILD_TESTING=OFF",
"-DCMAKE_INSTALL_LIBDIR=/app/lib",
"-DCMAKE_INSTALL_INCLUDEDIR=/app/include"
],
"cleanup": [
"/bin",
"/include",
"/lib/pkgconfig"
],
"modules": [
{
"name": "openblas",
"sources": [
{
"type": "archive",
"url": "https://github.com/xianyi/OpenBLAS/archive/v0.3.28.tar.gz",
"sha256": "f1003466ad074e9b0c8d421a204121100b0751c96fc6fcf3d1456bd12f8a00a1",
"x-checker-data": {
"type": "anitya",
"project-id": 2540,
"stable-only": true,
"url-template": "https://github.com/xianyi/OpenBLAS/archive/v$version.tar.gz"
}
}
],
"no-autogen": true,
"make-args": [
"DYNAMIC_ARCH=1",
"USE_OPENMP=0",
"NO_CBLAS=1",
"NO_LAPACKE=1"
],
"make-install-args": [
"PREFIX=/app"
],
"cleanup": [
"/include",
"/lib/pkgconfig"
]
}
]
},
{
"name": "maxflow",
"sources": [
{
"type": "git",
"url": "https://github.com/gerddie/maxflow.git",
"commit": "6ac148f164b9567ac81fbb4ebb36112f850c902b"
}
],
"buildsystem": "cmake-ninja",
"cleanup": [
"/include",
"/lib/pkgconfig"
]
},
{
"name": "graphviz",
"sources": [
{
"type": "archive",
"url": "https://gitlab.com/graphviz/graphviz/-/archive/12.1.1/graphviz-12.1.2.tar.gz",
"sha256": "4190c51c434c13f718101fbba9e83702d668e20d4eb123c5f4fe059db10d6444",
"x-checker-data": {
"type": "anitya",
"project-id": 1249,
"stable-only": true,
"url-template": "https://gitlab.com/graphviz/graphviz/-/archive/$version/graphviz-$version.tar.gz"
}
}
],
"buildsystem": "autotools",
"config-opts": [
"--with-gdk=no",
"--with-gtk=no",
"--with-poppler=no",
"--with-rsvg=no",
"--with-webp=no",
"--with-x=no",
"--with-xlib=no"
],
"cleanup": [
"/bin/??",
"/bin/????*",
"/bin/fdp",
"/bin/nop",
"/include",
"/lib/libgvpr*",
"/lib/graphviz/libgvplugin_core*",
"/lib/graphviz/libgvplugin_kitty*",
"/lib/graphviz/libgvplugin_neato_layout*",
"/lib/graphviz/libgvplugin_vt*",
"/lib/pkgconfig",
"/share"
]
},
{
"name": "babl",
"sources": [
@ -786,129 +907,6 @@
],
"cleanup": [
"/share/gegl*"
],
"modules": [
{
"//": "Originally taken from org.octave.Octave manifest",
"name": "SuiteSparse",
"sources": [
{
"type": "archive",
"url": "https://github.com/DrTimothyAldenDavis/SuiteSparse/archive/v7.8.3.tar.gz",
"sha256": "ce39b28d4038a09c14f21e02c664401be73c0cb96a9198418d6a98a7db73a259",
"x-checker-data": {
"type": "anitya",
"project-id": 4908,
"stable-only": true,
"url-template": "https://github.com/DrTimothyAldenDavis/SuiteSparse/archive/v$version.tar.gz"
}
}
],
"buildsystem": "cmake-ninja",
"builddir": true,
"config-opts": [
"-DBLA_VENDOR=OpenBLAS",
"-DGRAPHBLAS_COMPACT=ON",
"-DSUITESPARSE_USE_OPENMP=OFF",
"-DSUITESPARSE_USE_PYTHON=OFF",
"-DSUITESPARSE_DEMOS=OFF",
"-DBUILD_TESTING=OFF",
"-DCMAKE_INSTALL_LIBDIR=/app/lib",
"-DCMAKE_INSTALL_INCLUDEDIR=/app/include"
],
"cleanup": [
"/bin",
"/include",
"/lib/pkgconfig"
],
"modules": [
{
"name": "openblas",
"sources": [
{
"type": "archive",
"url": "https://github.com/xianyi/OpenBLAS/archive/v0.3.28.tar.gz",
"sha256": "f1003466ad074e9b0c8d421a204121100b0751c96fc6fcf3d1456bd12f8a00a1",
"x-checker-data": {
"type": "anitya",
"project-id": 2540,
"stable-only": true,
"url-template": "https://github.com/xianyi/OpenBLAS/archive/v$version.tar.gz"
}
}
],
"no-autogen": true,
"make-args": [
"DYNAMIC_ARCH=1",
"USE_OPENMP=0",
"NO_CBLAS=1",
"NO_LAPACKE=1"
],
"make-install-args": [
"PREFIX=/app"
],
"cleanup": [
"/include",
"/lib/pkgconfig"
]
}
]
},
{
"name": "maxflow",
"sources": [
{
"type": "git",
"url": "https://github.com/gerddie/maxflow.git",
"commit": "6ac148f164b9567ac81fbb4ebb36112f850c902b"
}
],
"buildsystem": "cmake-ninja",
"cleanup": [
"/include",
"/lib/pkgconfig"
]
},
{
"name": "graphviz",
"sources": [
{
"type": "archive",
"url": "https://gitlab.com/graphviz/graphviz/-/archive/12.1.1/graphviz-12.1.2.tar.gz",
"sha256": "4190c51c434c13f718101fbba9e83702d668e20d4eb123c5f4fe059db10d6444",
"x-checker-data": {
"type": "anitya",
"project-id": 1249,
"stable-only": true,
"url-template": "https://gitlab.com/graphviz/graphviz/-/archive/$version/graphviz-$version.tar.gz"
}
}
],
"buildsystem": "autotools",
"config-opts": [
"--with-gdk=no",
"--with-gtk=no",
"--with-poppler=no",
"--with-rsvg=no",
"--with-webp=no",
"--with-x=no",
"--with-xlib=no"
],
"cleanup": [
"/bin/??",
"/bin/????*",
"/bin/fdp",
"/bin/nop",
"/include",
"/lib/libgvpr*",
"/lib/graphviz/libgvplugin_core*",
"/lib/graphviz/libgvplugin_kitty*",
"/lib/graphviz/libgvplugin_neato_layout*",
"/lib/graphviz/libgvplugin_vt*",
"/lib/pkgconfig",
"/share"
]
}
]
},
{

View File

@ -39,8 +39,13 @@ elseif ((Get-WmiObject -Class Win32_ComputerSystem).SystemType -like 'x64*')
}
$env:Path = "$MSYS2_PREFIX/$MSYSTEM_PREFIX/bin;$MSYS2_PREFIX/usr/bin;" + $env:Path
pacman --noconfirm -Suy
Write-Output "$([char]27)[0Ksection_start:$(Get-Date -UFormat %s -Millisecond 0):deps_install[collapsed=true]$([char]13)$([char]27)[0KInstalling dependencies provided by MSYS2"
if ("$PSCommandPath" -like "*1_build-deps-msys2.ps1*" -or "$CI_JOB_NAME" -like "*deps*")
{
pacman --noconfirm -Suy
}
pacman --noconfirm -S --needed base-devel $MINGW_PACKAGE_PREFIX-toolchain (Get-Content build/windows/all-deps-uni.txt).Replace('${MINGW_PACKAGE_PREFIX}',$MINGW_PACKAGE_PREFIX).Replace(' \','')
Write-Output "$([char]27)[0Ksection_end:$(Get-Date -UFormat %s -Millisecond 0):deps_install$([char]13)$([char]27)[0K"
# Prepare env
@ -55,13 +60,15 @@ if (-not $GITLAB_CI)
$GIMP_PREFIX = "$PWD\_install"
}
Invoke-Expression ((Get-Content $GIMP_DIR\.gitlab-ci.yml | Select-String 'env:Path \+' -Context 0,3) -replace '> ','' -replace '- ','')
Invoke-Expression ((Get-Content $GIMP_DIR\.gitlab-ci.yml | Select-String 'win_environ\[' -Context 0,5) -replace '> ','' -replace '- ','')
}
# Build babl and GEGL
function self_build ([string]$dep, [string]$option1, [string]$option2)
{
Write-Output "$([char]27)[0Ksection_start:$(Get-Date -UFormat %s -Millisecond 0):${dep}_build[collapsed=true]$([char]13)$([char]27)[0KBuilding $dep"
## Make sure that the deps repos are fine
if (-not (Test-Path $dep))
{
@ -97,6 +104,7 @@ function self_build ([string]$dep, [string]$option1, [string]$option2)
}
ccache --show-stats
Set-Location ../..
Write-Output "$([char]27)[0Ksection_end:$(Get-Date -UFormat %s -Millisecond 0):${dep}_build$([char]13)$([char]27)[0K"
}
#FIXME: babl dev docs are broken. See: https://gitlab.gnome.org/GNOME/babl/-/issues/97

View File

@ -21,11 +21,11 @@ if (-not $GITLAB_CI)
# Install the required (pre-built) packages for babl, GEGL and GIMP (again)
Invoke-Expression ((Get-Content build\windows\1_build-deps-msys2.ps1 | Select-String 'MSYS2_PREFIX =' -Context 0,17) -replace '> ','')
Invoke-Expression ((Get-Content build\windows\1_build-deps-msys2.ps1 | Select-String 'MSYS2_PREFIX =' -Context 0,15) -replace '> ','')
if ($GITLAB_CI)
{
Invoke-Expression ((Get-Content build\windows\1_build-deps-msys2.ps1 | Select-String 'Suy' -Context 0,1) -replace '> ','')
Invoke-Expression ((Get-Content build\windows\1_build-deps-msys2.ps1 | Select-String 'deps_install\[' -Context 0,6) -replace '> ','')
}
@ -38,11 +38,12 @@ if (-not $GITLAB_CI)
$GIMP_PREFIX = "$PWD\..\_install".Replace('\', '/')
}
Invoke-Expression ((Get-Content .gitlab-ci.yml | Select-String 'env:Path \+' -Context 0,3) -replace '> ','' -replace '- ','')
Invoke-Expression ((Get-Content .gitlab-ci.yml | Select-String 'win_environ\[' -Context 0,5) -replace '> ','' -replace '- ','')
}
# Build GIMP
Write-Output "$([char]27)[0Ksection_start:$(Get-Date -UFormat %s -Millisecond 0):gimp_build[collapsed=true]$([char]13)$([char]27)[0KBuilding GIMP"
if (-not (Test-Path _build\build.ninja -Type Leaf))
{
#FIXME: g-ir-doc is broken. See: https://gitlab.gnome.org/GNOME/gimp/-/issues/11200
@ -53,11 +54,19 @@ if (-not (Test-Path _build\build.ninja -Type Leaf))
}
Set-Location _build
ninja
ninja install
ccache --show-stats
Write-Output "$([char]27)[0Ksection_end:$(Get-Date -UFormat %s -Millisecond 0):gimp_build$([char]13)$([char]27)[0K"
# Bundle GIMP
Write-Output "$([char]27)[0Ksection_start:$(Get-Date -UFormat %s -Millisecond 0):gimp_bundle[collapsed=true]$([char]13)$([char]27)[0KCreating bundle"
ninja install | Out-File ninja_install.log
if ("$LASTEXITCODE" -gt '0' -or "$?" -eq 'False')
{
## We need to manually check failures in pre-7.4 PS
Get-Content ninja_install.log
exit 1
}
ccache --show-stats
Remove-Item ninja_install.log
Set-Location ..
Write-Output "$([char]27)[0Ksection_end:$(Get-Date -UFormat %s -Millisecond 0):gimp_bundle$([char]13)$([char]27)[0K"

View File

@ -17,9 +17,9 @@ Invoke-Expression ((Get-Content build\windows\1_build-deps-msys2.ps1 | Select-St
# 1. GET INNO
Write-Output "$([char]27)[0Ksection_start:$(Get-Date -UFormat %s -Millisecond 0):installer_tlkt$([char]13)$([char]27)[0KChecking Inno installation"
## Download Inno
Write-Output '(INFO): checking Inno version'
## (We need to ensure that TLS 1.2 is enabled because of some runners)
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
Invoke-WebRequest https://jrsoftware.org/download.php/is.exe -OutFile ..\is.exe
@ -53,9 +53,11 @@ Write-Output "(INFO): Installed Inno: $inno_version_downloaded"
$INNO_PATH = Get-ItemProperty (Resolve-Path Registry::'HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Uninstall\Inno Setup*') | Select-Object -ExpandProperty InstallLocation
#$INNO_PATH = [regex]::Matches((Get-Content ..\innosetup.log | Select-String ISCC.exe), '(?<=filename: ).+?(?=\\ISCC.exe)').Value
Set-Alias iscc "$INNO_PATH\iscc.exe"
Write-Output "$([char]27)[0Ksection_end:$(Get-Date -UFormat %s -Millisecond 0):installer_tlkt$([char]13)$([char]27)[0K"
# 2. GET GLOBAL INFO
Write-Output "$([char]27)[0Ksection_start:$(Get-Date -UFormat %s -Millisecond 0):installer_info$([char]13)$([char]27)[0KGetting installer global info"
$CONFIG_PATH = "$BUILD_DIR\config.h"
if (-not (Test-Path "$CONFIG_PATH"))
{
@ -90,9 +92,11 @@ if ((-not (Test-Path "$GIMP32")) -or (-not (Test-Path "$GIMP64")) -or (-not (Tes
exit 1
}
Write-Output "(INFO): Arch: universal (x86, x64 and arm64)"
Write-Output "$([char]27)[0Ksection_end:$(Get-Date -UFormat %s -Millisecond 0):installer_info$([char]13)$([char]27)[0K"
# 3. PREPARE INSTALLER "SOURCE"
Write-Output "$([char]27)[0Ksection_start:$(Get-Date -UFormat %s -Millisecond 0):installer_source[collapsed=true]$([char]13)$([char]27)[0KMaking installer assets"
## Custom installer strings translations and other assets
## (They are loaded with '-DBUILD_DIR')
@ -104,17 +108,18 @@ if (-not (Test-Path "$BUILD_DIR\build\windows\installer"))
## Complete Inno source with not released translations
## Cf. https://jrsoftware.org/files/istrans/
Write-Output "(INFO): temporarily installing additional Inno lang files"
$xmlObject = New-Object XML
$xmlObject.Load("$PWD\build\windows\installer\lang\iso_639_custom.xml")
function download_langs ([array]$langsArray)
{
foreach ($langfile in $langsArray)
{
if ($langfile -ne '' -and -not (Test-Path "$INNO_PATH\$langfile" -Type Leaf))
$langfilePath = "$INNO_PATH\$langfile"
if ($langfile -ne '' -and -not (Test-Path "$langfilePath" -Type Leaf))
{
Write-Output "(INFO): temporarily installing $($langfilePath -replace '\\\\','\')"
$langfileUnix = $langfile.Replace('\\', '/')
Invoke-WebRequest https://raw.githubusercontent.com/jrsoftware/issrc/main/Files/$langfileUnix -OutFile "$INNO_PATH\$langfile"
Invoke-WebRequest https://raw.githubusercontent.com/jrsoftware/issrc/main/Files/$langfileUnix -OutFile "$langfilePath"
}
}
}
@ -129,7 +134,6 @@ $langsArray_unofficial = $xmlObject.iso_639_entries.iso_639_entry | Select-Objec
download_langs $langsArray_unofficial
## Patch 'AppVer*' against Inno pervasive behavior: https://groups.google.com/g/innosetup/c/w0sebw5YAeg
Write-Output "(INFO): temporarily patching all Inno lang files with $CUSTOM_GIMP_VERSION"
function fix_msg ([string]$langsdir, [string]$AppVer)
{
$langsArray_local = Get-ChildItem $langsdir -Filter *.isl -Name
@ -164,37 +168,45 @@ function fix_msg ([string]$langsdir, [string]$AppVer)
fix_msg "$INNO_PATH" $CUSTOM_GIMP_VERSION
fix_msg "$INNO_PATH\Languages" $CUSTOM_GIMP_VERSION
fix_msg "$INNO_PATH\Languages\Unofficial" $CUSTOM_GIMP_VERSION
Write-Output "$([char]27)[0Ksection_end:$(Get-Date -UFormat %s -Millisecond 0):installer_source$([char]13)$([char]27)[0K"
# 4. PREPARE GIMP FILES
## Get GIMP versions used in some versioned files and dirs
$gimp_version = Get-Content "$CONFIG_PATH" | Select-String 'GIMP_VERSION' |
Foreach-Object {$_ -replace '#define GIMP_VERSION "',''} | Foreach-Object {$_ -replace '"',''} |
Foreach-Object {$_ -replace '(.+?)-.+','$1'}
$gimp_app_version = Get-Content "$CONFIG_PATH" | Select-String 'GIMP_APP_VERSION "' |
Foreach-Object {$_ -replace '#define GIMP_APP_VERSION "',''} | Foreach-Object {$_ -replace '"',''}
$gimp_api_version = Get-Content "$CONFIG_PATH" | Select-String 'GIMP_PKGCONFIG_VERSION' |
Foreach-Object {$_ -replace '#define GIMP_PKGCONFIG_VERSION "',''} | Foreach-Object {$_ -replace '"',''}
## GIMP revision on about dialog (this does the same as '-Drevision' build option)
## FIXME: This should be done with Inno scripting
foreach ($bundle in $supported_archs)
{
Write-Output "$([char]27)[0Ksection_start:$(Get-Date -UFormat %s -Millisecond 0):${bundle}_files[collapsed=true]$([char]13)$([char]27)[0KPreparing GIMP files in $bundle bundle"
## Get GIMP versions used in some versioned files and dirs
$gimp_version = Get-Content "$CONFIG_PATH" | Select-String 'GIMP_VERSION' |
Foreach-Object {$_ -replace '#define GIMP_VERSION "',''} | Foreach-Object {$_ -replace '"',''} |
Foreach-Object {$_ -replace '(.+?)-.+','$1'}
$gimp_app_version = Get-Content "$CONFIG_PATH" | Select-String 'GIMP_APP_VERSION "' |
Foreach-Object {$_ -replace '#define GIMP_APP_VERSION "',''} | Foreach-Object {$_ -replace '"',''}
$gimp_api_version = Get-Content "$CONFIG_PATH" | Select-String 'GIMP_PKGCONFIG_VERSION' |
Foreach-Object {$_ -replace '#define GIMP_PKGCONFIG_VERSION "',''} | Foreach-Object {$_ -replace '"',''}
## GIMP revision on about dialog (this does the same as '-Drevision' build option)
## FIXME: This should be done with Inno scripting
(Get-Content "$bundle\share\gimp\*\gimp-release") | Foreach-Object {$_ -replace "revision=0","revision=$revision"} |
Set-Content "$bundle\share\gimp\*\gimp-release"
## Split .debug symbols
if ("$bundle" -eq 'gimp-x86')
{
#We do not split 32-bit DWARF symbols here (they were in gimp-win-x86 job)
Write-Output "(INFO): skipping (already done) gimp-x86 .debug extracting"
}
else
{
bash build/windows/installer/3_dist-gimp-inno_sym.sh $bundle
}
Write-Output "$([char]27)[0Ksection_end:$(Get-Date -UFormat %s -Millisecond 0):${bundle}_files$([char]13)$([char]27)[0K"
}
## Split .debug symbols
Write-Output "(INFO): extracting .debug symbols from bundles"
bash build/windows/installer/3_dist-gimp-inno_sym.sh | Out-Null
# 5. CONSTRUCT .EXE INSTALLER
# 5. COMPILE .EXE INSTALLER
$INSTALLER="gimp-${CUSTOM_GIMP_VERSION}-setup.exe"
Write-Output "(INFO): constructing $INSTALLER installer"
## Compile installer
Write-Output "$([char]27)[0Ksection_start:$(Get-Date -UFormat %s -Millisecond 0):installer_making[collapsed=true]$([char]13)$([char]27)[0KConstructing $INSTALLER installer"
Set-Location build\windows\installer
if ($CUSTOM_GIMP_VERSION -match 'RC[1-9]')
{
@ -202,8 +214,11 @@ if ($CUSTOM_GIMP_VERSION -match 'RC[1-9]')
}
iscc -DCUSTOM_GIMP_VERSION="$CUSTOM_GIMP_VERSION" -DGIMP_VERSION="$gimp_version" -DREVISION="$revision" -DGIMP_APP_VERSION="$gimp_app_version" -DGIMP_API_VERSION="$gimp_api_version" -DBUILD_DIR="$BUILD_DIR" -DGIMP_DIR="$GIMP_BASE" -DDIR32="$GIMP32" -DDIR64="$GIMP64" -DDIRA64="$GIMPA64" -DDEPS_DIR="$GIMP_BASE" -DDDIR32="$GIMP32" -DDDIR64="$GIMP64" -DDDIRA64="$GIMPA64" -DDEBUG_SYMBOLS -DPYTHON $devel_warning base_gimp3264.iss | Out-Null
Set-Location $GIMP_BASE
Write-Output "$([char]27)[0Ksection_end:$(Get-Date -UFormat %s -Millisecond 0):installer_making$([char]13)$([char]27)[0K"
## Clean changes in the bundles and Inno installation
# Clean changes in the bundles and Inno installation
## Revert revisioning
foreach ($bundle in $supported_archs)
{
(Get-Content "$bundle\share\gimp\*\gimp-release") | Foreach-Object {$_ -replace "revision=$revision","revision=0"} |
@ -212,7 +227,7 @@ foreach ($bundle in $supported_archs)
fix_msg "$INNO_PATH" revert
fix_msg "$INNO_PATH\Languages" revert
fix_msg "$INNO_PATH\Languages\Unofficial" revert
### We delete only unofficial langs because the downloaded official ones will be kept by Inno updates
## We delete only unofficial langs because the downloaded official ones will be kept by Inno updates
Remove-Item "$INNO_PATH\Languages\Unofficial" -Recurse -Force

View File

@ -1,35 +1,32 @@
#!/bin/bash
if [ "$MSYSTEM_PREFIX" != 'mingw32' ]; then
archsArray=('-a64'
'-x64')
else
archsArray=('-x86')
if [ ! "$1" ]; then
echo -e "\033[31m(ERROR)\033[0m: Script called without specifying a bundle. Please, call it this way: '$0 bundle_dir'."
exit 1
fi
# (we extract and link DWARF .debug symbols to
# make possible save space with Inno custom install)
for ARTIFACTS_SUFFIX in "${archsArray[@]}"; do
binArray=($(find gimp${ARTIFACTS_SUFFIX} \( -iname '*.dll' -or -iname '*.exe' -or -iname '*.pyd' \) -type f))
for bin in "${binArray[@]}"; do
debug=$(echo "${bin}.debug")
NAME="${bin##*/}"
DIR="${debug%/*}/.debug/"
echo "(INFO): extracting DWARF symbols from binaries in $1 bundle"
binArray=($(find $1 \( -iname '*.dll' -or -iname '*.exe' -or -iname '*.pyd' \) -type f))
for bin in "${binArray[@]}"; do
debug=$(echo "${bin}.debug")
NAME="${bin##*/}"
DIR="${debug%/*}/.debug/"
if [ ! -f "$DIR/$NAME.debug" ]; then
## Split/extract DWARF symbols from binary to .debug
echo "(INFO): extracting DWARF symbols from $NAME to $DIR"
objcopy --only-keep-debug $bin $debug
if [ ! -f "$DIR/$NAME.debug" ]; then
## Split/extract DWARF symbols from binary to .debug
#echo "(INFO): extracting DWARF symbols from $NAME to $DIR"
objcopy --only-keep-debug $bin $debug
## Link .debug to binary
objcopy --add-gnu-debuglink=$debug $bin --strip-unneeded
## Link .debug to binary
objcopy --add-gnu-debuglink=$debug $bin --strip-unneeded
## Move .debug files to .debug folder
if [ ! -d "$DIR" ]; then
mkdir "$DIR"
fi
mv "$debug" "$DIR"
## Move .debug files to .debug folder
if [ ! -d "$DIR" ]; then
mkdir "$DIR"
fi
done
mv "$debug" "$DIR"
fi
done

View File

@ -1,6 +1,8 @@
# Manually patches .isl to mimic AppVerName
# https://groups.google.com/g/innosetup/c/w0sebw5YAeg
echo "(INFO): temporarily patching $(echo $1 | sed 's|\/|\\|g') with $2"
before=$(cat "$1" | grep -a 'SetupWindowTitle')
after=$(cat "$1" | grep -a 'SetupWindowTitle' | sed "s|%1|%1 $2|")
sed -i "s|$before|$after|" "$1" >/dev/null 2>&1

View File

@ -11,7 +11,8 @@ $ErrorActionPreference = 'Stop'
$PSNativeCommandUseErrorActionPreference = $true
# Autodetects latest WinSDK installed
# 1. AUTODECTET LATEST WINDOWS SDK
Write-Output "$([char]27)[0Ksection_start:$(Get-Date -UFormat %s -Millisecond 0):msix_tlkt$([char]13)$([char]27)[0KChecking WinSDK installation"
if ((Get-WmiObject -Class Win32_ComputerSystem).SystemType -like 'ARM64*')
{
$cpu_arch = 'arm64'
@ -24,9 +25,11 @@ $win_sdk_version = Get-ItemProperty Registry::'HKEY_LOCAL_MACHINE\SOFTWARE\WOW64
$win_sdk_path = Get-ItemProperty Registry::'HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Microsoft SDKs\Windows\v10.0' | Select-Object -ExpandProperty InstallationFolder
$env:Path = "${win_sdk_path}bin\${win_sdk_version}.0\$cpu_arch;${win_sdk_path}App Certification Kit;" + $env:Path
Write-Output "(INFO): Installed WinSDK: $win_sdk_version"
Write-Output "$([char]27)[0Ksection_end:$(Get-Date -UFormat %s -Millisecond 0):msix_tlkt$([char]13)$([char]27)[0K"
# Global variables
# 2. GLOBAL VARIABLES
Write-Output "$([char]27)[0Ksection_start:$(Get-Date -UFormat %s -Millisecond 0):msix_info$([char]13)$([char]27)[0KGetting MSIX global info"
$config_path = "$build_dir\config.h"
if (-not (Test-Path "$config_path"))
{
@ -86,8 +89,7 @@ $CUSTOM_GIMP_VERSION = "$gimp_app_version.${micro_digit}${revision}.0"
Write-Output "(INFO): Identity: $IDENTITY_NAME | Version: $CUSTOM_GIMP_VERSION (major: $major, minor: $minor, micro: ${micro}${revision_text})"
# Autodetects what arch bundles will be packaged
## Autodetects what arch bundles will be packaged
if (-not (Test-Path "$a64_bundle") -and -not (Test-Path "$x64_bundle"))
{
Write-Host "(ERROR): No bundle found. You can tweak 'build/windows/2_build-gimp-msys2.ps1' or configure GIMP with '-Dms-store=true' to make one." -ForegroundColor red
@ -105,11 +107,18 @@ elseif ((Test-Path "$a64_bundle") -and (Test-Path "$x64_bundle"))
{
Write-Output "(INFO): Arch: arm64 and x64"
}
Write-Output "$([char]27)[0Ksection_end:$(Get-Date -UFormat %s -Millisecond 0):msix_info$([char]13)$([char]27)[0K"
$supported_archs = "$a64_bundle","$x64_bundle"
foreach ($bundle in $supported_archs)
{
if (Test-Path "$bundle")
{
if ((Test-Path $a64_bundle) -and (Test-Path $x64_bundle))
{
$temp_text='temporary '
}
if (("$bundle" -like '*a64*') -or ("$bundle" -like '*aarch64*') -or ("$bundle" -like '*arm64*'))
{
$msix_arch = 'arm64'
@ -118,6 +127,7 @@ foreach ($bundle in $supported_archs)
{
$msix_arch = 'x64'
}
Write-Output "$([char]27)[0Ksection_start:$(Get-Date -UFormat %s -Millisecond 0):${msix_arch}_making[collapsed=true]$([char]13)$([char]27)[0KMaking ${temp_text}$msix_arch MSIX"
## Prevent Git going crazy
if (-not (Test-Path .gitignore.bak -Type Leaf))
@ -143,19 +153,18 @@ foreach ($bundle in $supported_archs)
New-Item $msix_arch -ItemType Directory | Out-Null
# 1. CONFIGURE MANIFEST
# 3. PREPARE MSIX "SOURCE"
## 3.1. CONFIGURE MANIFEST
Write-Output "(INFO): configuring AppxManifest.xml for $msix_arch"
Copy-Item build\windows\store\AppxManifest.xml $msix_arch
## Set msix_arch
### Set msix_arch
(Get-Content $msix_arch\AppxManifest.xml) | Foreach-Object {$_ -replace "neutral","$msix_arch"} |
Set-Content $msix_arch\AppxManifest.xml
## Set Identity Name
### Set Identity Name
(Get-Content $msix_arch\AppxManifest.xml) | Foreach-Object {$_ -replace "@IDENTITY_NAME@","$IDENTITY_NAME"} |
Set-Content $msix_arch\AppxManifest.xml
## Set Display Name (the name shown in MS Store)
### Set Display Name (the name shown in MS Store)
if ($dev)
{
$display_name='GIMP (Preview)'
@ -166,12 +175,10 @@ foreach ($bundle in $supported_archs)
}
(Get-Content $msix_arch\AppxManifest.xml) | Foreach-Object {$_ -replace "@DISPLAY_NAME@","$display_name"} |
Set-Content $msix_arch\AppxManifest.xml
## Set custom GIMP version (major.minor.micro+revision.0)
### Set custom GIMP version (major.minor.micro+revision.0)
(Get-Content $msix_arch\AppxManifest.xml) | Foreach-Object {$_ -replace "@CUSTOM_GIMP_VERSION@","$CUSTOM_GIMP_VERSION"} |
Set-Content $msix_arch\AppxManifest.xml
## Set GIMP mutex version (major.minor or major)
### Set GIMP mutex version (major.minor or major)
if ($dev -and ($gimp_version -notmatch 'RC[0-9]'))
{
$gimp_mutex_version="$gimp_app_version"
@ -182,28 +189,24 @@ foreach ($bundle in $supported_archs)
}
(Get-Content $msix_arch\AppxManifest.xml) | Foreach-Object {$_ -replace "@GIMP_MUTEX_VERSION@","$gimp_mutex_version"} |
Set-Content $msix_arch\AppxManifest.xml
## Match supported filetypes
### Match supported filetypes
$file_types = Get-Content 'build\windows\installer\data_associations.list' | Foreach-Object {" <uap:FileType>." + $_} |
Foreach-Object {$_ + "</uap:FileType>"} | Where-Object {$_ -notmatch 'xcf'}
(Get-Content $msix_arch\AppxManifest.xml) | Foreach-Object {$_ -replace "@FILE_TYPES@","$file_types"} |
Set-Content $msix_arch\AppxManifest.xml
# 2. CREATE ASSETS
## 3.2. CREATE ICON ASSETS
$icons_path = "$build_dir\build\windows\store\Assets"
if (-not (Test-Path "$icons_path"))
{
Write-Host "(ERROR): MS Store icons not found. You can tweak 'build/windows/2_build-gimp-msys2.ps1' or configure GIMP with '-Dms-store=true' to build them." -ForegroundColor red
exit 1
}
Write-Output "(INFO): generating resources.pri from $icons_path"
## Copy pre-generated icons to each msix_arch
Write-Output "(INFO): generating resources*.pri from $icons_path"
### Copy pre-generated icons to each msix_arch
New-Item $msix_arch\Assets -ItemType Directory | Out-Null
Copy-Item "$icons_path\*.png" $msix_arch\Assets\ -Recurse
## Generate resources.pri
### Generate resources*.pri
Set-Location $msix_arch
makepri createconfig /cf priconfig.xml /dq lang-en-US /pv 10.0.0 | Out-File ..\winsdk.log
Set-Location ..\
@ -211,8 +214,8 @@ foreach ($bundle in $supported_archs)
Remove-Item $msix_arch\priconfig.xml
# 3. COPY GIMP FILES
Write-Output "(INFO): copying files from $bundle bundle"
# 4. COPY GIMP FILES
Write-Output "(INFO): preparing GIMP files in $msix_arch VFS"
$vfs = "$msix_arch\VFS\ProgramFilesX64\GIMP"
## Copy files into VFS folder (to support external 3P plug-ins)
@ -235,7 +238,7 @@ foreach ($bundle in $supported_archs)
Get-ChildItem "$vfs" -Recurse -Include ("*.debug", "*.tar") | Remove-Item -Recurse
# 4.A. MAKE .MSIX AND CORRESPONDING .APPXSYM
# 5.A. MAKE .MSIX AND CORRESPONDING .APPXSYM
## Make .appxsym for each msix_arch (ONLY FOR RELEASES)
$APPXSYM = "${IDENTITY_NAME}_${CUSTOM_GIMP_VERSION}_$msix_arch.appxsym"
@ -249,50 +252,43 @@ foreach ($bundle in $supported_archs)
## Make .msix from each msix_arch
$MSIX_ARTIFACT = $APPXSYM -replace '.appxsym','.msix'
if (-not ((Test-Path $a64_bundle) -and (Test-Path $x64_bundle)))
{
Write-Output "(INFO): packaging $MSIX_ARTIFACT (for testing purposes)"
}
else
{
Write-Output "(INFO): packaging temporary $MSIX_ARTIFACT"
}
Write-Output "(INFO): packaging $MSIX_ARTIFACT"
makeappx pack /d $msix_arch /p $MSIX_ARTIFACT /o | Out-File winsdk.log -Append
Remove-Item $msix_arch/ -Recurse
Write-Output "$([char]27)[0Ksection_end:$(Get-Date -UFormat %s -Millisecond 0):${msix_arch}_making$([char]13)$([char]27)[0K"
} #END of 'if (Test-Path...'
} #END of 'foreach ($msix_arch...'
# 4.B. MAKE .MSIXBUNDLE AND SUBSEQUENT .MSIXUPLOAD
# 5.B. MAKE .MSIXBUNDLE OR SUBSEQUENT .MSIXUPLOAD
if (((Test-Path $a64_bundle) -and (Test-Path $x64_bundle)) -and (Get-ChildItem *.msix -Recurse).Count -gt 1)
{
$MSIXBUNDLE = "${IDENTITY_NAME}_${CUSTOM_GIMP_VERSION}_neutral.msixbundle"
$MSIX_ARTIFACT = "$MSIXBUNDLE"
if ($CI_COMMIT_TAG -or ($GIMP_CI_MS_STORE -like 'MSIXUPLOAD*'))
{
$MSIXUPLOAD = "${IDENTITY_NAME}_${CUSTOM_GIMP_VERSION}_x64_arm64_bundle.msixupload"
$MSIX_ARTIFACT = "$MSIXUPLOAD"
}
Write-Output "$([char]27)[0Ksection_start:$(Get-Date -UFormat %s -Millisecond 0):msix_making[collapsed=true]$([char]13)$([char]27)[0KPackaging $MSIX_ARTIFACT"
## Make .msixbundle with all archs
## (This is needed not only for easier multi-arch testing but
## also to make sure against Partner Center getting confused)
$MSIX_ARTIFACT = "${IDENTITY_NAME}_${CUSTOM_GIMP_VERSION}_neutral.msixbundle"
if (-not $CI_COMMIT_TAG -and ($GIMP_CI_MS_STORE -notlike 'MSIXUPLOAD*'))
{
Write-Output "(INFO): packaging $MSIX_ARTIFACT (for testing purposes)"
}
else
{
Write-Output "(INFO): packaging temporary $MSIX_ARTIFACT"
}
New-Item _TempOutput -ItemType Directory | Out-Null
Move-Item *.msix _TempOutput/
makeappx bundle /bv "${CUSTOM_GIMP_VERSION}" /d _TempOutput /p $MSIX_ARTIFACT /o | Out-File winsdk.log -Append
makeappx bundle /bv "${CUSTOM_GIMP_VERSION}" /d _TempOutput /p $MSIXBUNDLE /o
Remove-Item _TempOutput/ -Recurse
## Make .msixupload (ONLY FOR RELEASES)
if ($CI_COMMIT_TAG -or ($GIMP_CI_MS_STORE -like 'MSIXUPLOAD*'))
{
$MSIX_ARTIFACT = "${IDENTITY_NAME}_${CUSTOM_GIMP_VERSION}_x64_arm64_bundle.msixupload"
Write-Output "(INFO): making $MSIX_ARTIFACT"
Get-ChildItem *.msixbundle | ForEach-Object { Compress-Archive -Path "$($_.Basename).msixbundle" -DestinationPath "$($_.Basename).zip" }
Get-ChildItem *.zip | Rename-Item -NewName $MSIX_ARTIFACT
Get-ChildItem *.zip | Rename-Item -NewName $MSIXUPLOAD
#Get-ChildItem *.appxsym | Remove-Item -Recurse -Force
Get-ChildItem *.msixbundle | Remove-Item -Recurse -Force
}
Write-Output "$([char]27)[0Ksection_end:$(Get-Date -UFormat %s -Millisecond 0):msix_making$([char]13)$([char]27)[0K"
#FIXME: .msixupload should be published automatically
#https://gitlab.gnome.org/GNOME/gimp/-/issues/11397
}
@ -301,7 +297,7 @@ Remove-Item .gitignore
Rename-Item .gitignore.bak .gitignore
# 5. CERTIFY .MSIX OR .MSIXBUNDLE WITH WACK (OPTIONAL)
# 6. CERTIFY .MSIX OR .MSIXBUNDLE WITH WACK (OPTIONAL)
# (Partner Center does the same thing before publishing)
if (-not $GITLAB_CI -and $wack -eq 'WACK')
{
@ -348,12 +344,13 @@ if (-not $GITLAB_CI -and $wack -eq 'WACK')
}
# 6. SIGN .MSIX OR .MSIXBUNDLE (FOR TESTING ONLY)
# 7. SIGN .MSIX OR .MSIXBUNDLE (FOR TESTING ONLY)
if (-not $CI_COMMIT_TAG -and ($GIMP_CI_MS_STORE -notlike 'MSIXUPLOAD*') -and ($MSIX_ARTIFACT -notlike "*msixupload"))
{
Write-Output "(INFO): signing $MSIX_ARTIFACT (for testing purposes)"
signtool sign /fd sha256 /a /f build\windows\store\pseudo-gimp.pfx /p eek $MSIX_ARTIFACT | Out-File winsdk.log -Append
Write-Output "$([char]27)[0Ksection_start:$(Get-Date -UFormat %s -Millisecond 0):msix_sign${msix_arch}[collapsed=true]$([char]13)$([char]27)[0KSelf-signing $MSIX_ARTIFACT (for testing purposes)"
signtool sign /debug /fd sha256 /a /f build\windows\store\pseudo-gimp.pfx /p eek $MSIX_ARTIFACT
Copy-Item build\windows\store\pseudo-gimp.pfx .\ -Recurse
Write-Output "$([char]27)[0Ksection_end:$(Get-Date -UFormat %s -Millisecond 0):msix_sign${msix_arch}$([char]13)$([char]27)[0K"
}