build/windows: Rework scripts local compatibility layer

Since !1171 we can use the CI scripts locally, but the initial implementation,
after some commits, revealed to be troublesome. So, now reworked to be simple.
This commit is contained in:
Bruno Lopes 2024-02-17 15:03:38 -03:00
parent 43c0fdcbba
commit 368bee2d64
3 changed files with 15 additions and 29 deletions

View File

@ -12,27 +12,25 @@ else # [[ "$MSYSTEM_CARCH" == "i686" ]];
export ARTIFACTS_SUFFIX="-x86"
fi
if [[ "$BUILD_TYPE" != "CI_NATIVE" ]]; then
# Make the script callable from every directory
if [[ "$BUILD_TYPE" == "CI_NATIVE" ]]; then
GIMP_DIR=""
else
# Make the script work locally
if [[ "$0" != "build/windows/gitlab-ci/1_build-deps-msys2.sh" ]]; then
GIMP_EXTDIR="$0"
GIMP_EXTDIR=$(sed 's|build/windows/gitlab-ci/1_build-deps-msys2.sh||g' <<< $GIMP_EXTDIR)
GIMP_DIR="$GIMP_EXTDIR"
echo "To run this script locally, please do it from to the gimp git folder"
exit 1
else
GIMP_GITDIR="$(pwd)"
GIMP_GITDIR=$(sed 's|build/windows/gitlab-ci||g' <<< $GIMP_GITDIR)
GIMP_GITDIR=$(sed 's|build/windows||g' <<< $GIMP_GITDIR)
GIMP_GITDIR=$(sed 's|build||g' <<< $GIMP_GITDIR)
GIMP_DIR="$GIMP_GITDIR"
GIMP_DIR=$(echo "${PWD##*/}/")
DEPS_DIR=$(dirname $PWD)
cd $DEPS_DIR
fi
cd $GIMP_DIR
pacman --noconfirm -Suy
fi
# Install the required (pre-built) packages for babl and GEGL
DEPS_LIST=$(cat build/windows/gitlab-ci/all-deps-uni.txt)
DEPS_LIST=$(cat ${GIMP_DIR}build/windows/gitlab-ci/all-deps-uni.txt)
DEPS_LIST=$(sed "s/\${MINGW_PACKAGE_PREFIX}-/${MINGW_PACKAGE_PREFIX}-/g" <<< $DEPS_LIST)
DEPS_LIST=$(sed 's/\\//g' <<< $DEPS_LIST)
@ -108,10 +106,3 @@ configure_or_build babl "-Dwith-docs=false"
configure_or_build gegl "-Ddocs=false \
-Dcairo=enabled -Dumfpack=enabled \
-Dopenexr=enabled -Dworkshop=true"
if [[ "$BUILD_TYPE" != "CI_NATIVE" ]]; then
mv _babl ~
mv _gegl ~
mv "${GIMP_PREFIX}" ~
fi

View File

@ -22,17 +22,10 @@ if [[ "$BUILD_TYPE" == "CI_NATIVE" ]]; then
rm -fr ~/_install${ARTIFACTS_SUFFIX}
mv "_install${ARTIFACTS_SUFFIX}" ~
else
# Make the script callable from every directory
# Make the script work locally
if [[ "$0" != "build/windows/gitlab-ci/2_build-gimp-msys2.sh" ]]; then
GIMP_EXTDIR="$0"
GIMP_EXTDIR=$(sed 's|build/windows/gitlab-ci/2_build-gimp-msys2.sh||g' <<< $GIMP_EXTDIR)
cd $GIMP_EXTDIR
else
GIMP_GITDIR="$(pwd)"
GIMP_GITDIR=$(sed 's|build/windows/gitlab-ci||g' <<< $GIMP_GITDIR)
GIMP_GITDIR=$(sed 's|build/windows||g' <<< $GIMP_GITDIR)
GIMP_GITDIR=$(sed 's|build||g' <<< $GIMP_GITDIR)
cd $GIMP_GITDIR
echo "To run this script locally, please do it from to the gimp git folder"
exit 1
fi
pacman --noconfirm -Suy
@ -40,6 +33,7 @@ fi
# Install the required (pre-built) packages for GIMP
GIMP_DIR=""
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

View File

@ -25,6 +25,7 @@ fi
if [[ "$BUILD_TYPE" != "CI_CROSS" ]]; then
# Install the required (pre-built) packages again
GIMP_DIR=""
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