build/windows: Remove a bit of actually dead code in msys2 scripts

This commit is mostly a little cleanup:
- Reduce redundancy in Local compatibility layer regarding build commands,
  which partily reverts !1171 regarding buggy "ninja && ninja install"
- Reduce redundancy of some variables (MSYS_PREFIX and GIMP_DISTRIB)
- Remove manual QOI install since MSYS2 granted a exception in the win32 drop

This commit also reverts 7cca69cd, a fix from the autotools era that isn't
actually needed according to my tests in CI.
This commit is contained in:
Bruno Lopes 2024-04-23 12:29:24 -03:00
parent b283d9fe08
commit 93722e81b5
3 changed files with 19 additions and 49 deletions

View File

@ -2,7 +2,7 @@
set -e
# $MSYSTEM_CARCH, $MSYSTEM_PREFIX and $MINGW_PACKAGE_PREFIX are defined by MSYS2.
# $MSYSTEM_CARCH and $MINGW_PACKAGE_PREFIX are defined by MSYS2.
# https://github.com/msys2/MSYS2-packages/blob/master/filesystem/msystem
if [[ "$MSYSTEM_CARCH" == "aarch64" ]]; then
export ARTIFACTS_SUFFIX="-a64"
@ -17,13 +17,12 @@ if [[ -z "$GITLAB_CI" ]]; then
if [[ "$0" != "build/windows/gitlab-ci/1_build-deps-msys2.sh" ]]; then
echo "To run this script locally, please do it from to the gimp git folder"
exit 1
else
GIMP_DIR=$(echo "${PWD##*/}/")
DEPS_DIR=$(dirname $PWD)
cd $DEPS_DIR
fi
export GIT_DEPTH=1
pacman --noconfirm -Suy
GIMP_DIR=$(echo "${PWD##*/}/")
DEPS_DIR=$(dirname $PWD)
cd $DEPS_DIR
fi
@ -96,18 +95,15 @@ configure_or_build ()
{
if [ ! -f "_${1}/_build/build.ninja" ]; then
mkdir -p _${1}/_build${ARTIFACTS_SUFFIX} && cd _${1}/_build${ARTIFACTS_SUFFIX}
(meson setup .. -Dprefix="${GIMP_PREFIX}" $2 && \
ninja && ninja install) || exit 1
cd ../..
meson setup .. -Dprefix="${GIMP_PREFIX}" $2
else
cd _${1}/_build${ARTIFACTS_SUFFIX}
(ninja && ninja install) || exit 1
cd ../..
fi
ninja
ninja install
ccache --show-stats
cd ../..
}
configure_or_build babl "-Dwith-docs=false"
configure_or_build gegl "-Ddocs=false -Dworkshop=true"
ccache --show-stats

View File

@ -6,24 +6,13 @@ set -e
# https://github.com/msys2/MSYS2-packages/blob/master/filesystem/msystem
if [[ "$MSYSTEM_CARCH" == "aarch64" ]]; then
export ARTIFACTS_SUFFIX="-a64"
export MSYS2_PREFIX="c:/msys64${MSYSTEM_PREFIX}"
elif [[ "$MSYSTEM_CARCH" == "x86_64" ]]; then
export ARTIFACTS_SUFFIX="-x64"
export MSYS2_PREFIX="c:/msys64${MSYSTEM_PREFIX}"
else # [[ "$MSYSTEM_CARCH" == "i686" ]];
export ARTIFACTS_SUFFIX="-x86"
export MSYS2_PREFIX="c:/msys64${MSYSTEM_PREFIX}"
fi
if [[ "$GITLAB_CI" ]]; then
# 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.
rm -fr ~/_install${ARTIFACTS_SUFFIX}
mv "_install${ARTIFACTS_SUFFIX}" ~
export MESON_OPTIONS=""
else
if [[ -z "$GITLAB_CI" ]]; then
# Make the script work locally
if [[ "$0" != "build/windows/gitlab-ci/2_build-gimp-msys2.sh" ]]; then
echo "To run this script locally, please do it from to the gimp git folder"
@ -42,13 +31,9 @@ DEPS_CODE=$(cat build/windows/gitlab-ci/1_build-deps-msys2.sh)
DEPS_CODE=$(sed -n '/# Install the/,/# End of install/p' <<< $DEPS_CODE)
echo "$DEPS_CODE" | bash
# Install QOI header manually
# mingw32 package of qoi was removed from MSYS2, we have download it by ourselves
wget -O "${MSYS2_PREFIX}/include/qoi.h" https://raw.githubusercontent.com/phoboslab/qoi/master/qoi.h
# Build GIMP
export GIMP_PREFIX="`realpath ~/_install`${ARTIFACTS_SUFFIX}"
export GIMP_PREFIX="`realpath ./_install`${ARTIFACTS_SUFFIX}"
## Universal variables from .gitlab-ci.yml
OLD_IFS=$IFS
IFS=$'\n' VAR_ARRAY=($(cat .gitlab-ci.yml | sed -n '/export PATH=/,/GI_TYPELIB_PATH}\"/p' | sed 's/ - //'))
@ -71,20 +56,18 @@ if [ ! -f "_build${ARTIFACTS_SUFFIX}/build.ninja" ]; then
-Dwindows-installer=true \
-Dms-store=true \
-Dbuild-id=org.gimp.GIMP_official $MESON_OPTIONS
ninja
ninja install
else
cd "_build${ARTIFACTS_SUFFIX}"
fi
ninja
ninja install
fi
ccache --show-stats
# XXX Functional fix to the problem of non-configured interpreters
make_cmd ()
{
MSYS2_PREFIX="c:/msys64${MSYSTEM_PREFIX}"
GIMP_APP_VERSION=$(grep GIMP_APP_VERSION config.h | head -1 | sed 's/^.*"\([^"]*\)"$/\1/')
echo "@echo off
echo This is a $1 native build of GIMP.
@ -127,11 +110,6 @@ make_cmd ()
if [[ "$GITLAB_CI" ]]; then
make_cmd CI %cd%
cd ..
# XXX Moving back the prefix to be used as artifacts.
mv "${GIMP_PREFIX}" .
else
make_cmd local $MSYS2_PREFIX
fi

View File

@ -2,20 +2,14 @@
set -e
# $MSYSTEM_CARCH, $MSYSTEM_PREFIX and $MINGW_PACKAGE_PREFIX are defined by MSYS2.
# $MSYSTEM_CARCH and $MSYSTEM_PREFIX are defined by MSYS2.
# https://github.com/msys2/MSYS2-packages/blob/master/filesystem/msystem
if [[ "$MSYSTEM_CARCH" == "aarch64" ]]; then
export ARTIFACTS_SUFFIX="-a64"
export MSYS_PREFIX="c:/msys64${MSYSTEM_PREFIX}"
export GIMP_DISTRIB=`realpath ./gimp-a64`
elif [[ "$CI_JOB_NAME" == "gimp-win-x64-cross" ]] || [[ "$MSYSTEM_CARCH" == "x86_64" ]]; then
export ARTIFACTS_SUFFIX="-x64"
export MSYS_PREFIX="c:/msys64${MSYSTEM_PREFIX}"
export GIMP_DISTRIB=`realpath ./gimp-x64`
else # [[ "$MSYSTEM_CARCH" == "i686" ]];
export ARTIFACTS_SUFFIX="-x86"
export MSYS_PREFIX="c:/msys64${MSYSTEM_PREFIX}"
export GIMP_DISTRIB=`realpath ./gimp-x86`
fi
@ -31,12 +25,14 @@ fi
# Bundle deps and GIMP files
export GIMP_PREFIX="`realpath ./_install`${ARTIFACTS_SUFFIX}"
if [[ "$CI_JOB_NAME" =~ "cross" ]]; then
export GIMP_PREFIX="`realpath ./_install`${ARTIFACTS_SUFFIX}-cross"
export MSYS_PREFIX="$GIMP_PREFIX"
else
export GIMP_PREFIX="`realpath ./_install`${ARTIFACTS_SUFFIX}"
export MSYS_PREFIX="c:/msys64${MSYSTEM_PREFIX}"
fi
export PATH="$GIMP_PREFIX/bin:$PATH"
export GIMP_DISTRIB="`realpath ./gimp`${ARTIFACTS_SUFFIX}"
## Copy a previously built wrapper at tree root, less messy than
## having to look inside bin/, in the middle of all the DLLs.