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" export ARTIFACTS_SUFFIX="-x86"
fi fi
if [[ "$BUILD_TYPE" != "CI_NATIVE" ]]; then if [[ "$BUILD_TYPE" == "CI_NATIVE" ]]; then
# Make the script callable from every directory GIMP_DIR=""
else
# Make the script work locally
if [[ "$0" != "build/windows/gitlab-ci/1_build-deps-msys2.sh" ]]; then if [[ "$0" != "build/windows/gitlab-ci/1_build-deps-msys2.sh" ]]; then
GIMP_EXTDIR="$0" echo "To run this script locally, please do it from to the gimp git folder"
GIMP_EXTDIR=$(sed 's|build/windows/gitlab-ci/1_build-deps-msys2.sh||g' <<< $GIMP_EXTDIR) exit 1
GIMP_DIR="$GIMP_EXTDIR"
else else
GIMP_GITDIR="$(pwd)" GIMP_DIR=$(echo "${PWD##*/}/")
GIMP_GITDIR=$(sed 's|build/windows/gitlab-ci||g' <<< $GIMP_GITDIR) DEPS_DIR=$(dirname $PWD)
GIMP_GITDIR=$(sed 's|build/windows||g' <<< $GIMP_GITDIR) cd $DEPS_DIR
GIMP_GITDIR=$(sed 's|build||g' <<< $GIMP_GITDIR)
GIMP_DIR="$GIMP_GITDIR"
fi fi
cd $GIMP_DIR
pacman --noconfirm -Suy pacman --noconfirm -Suy
fi fi
# Install the required (pre-built) packages for babl and GEGL # 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/\${MINGW_PACKAGE_PREFIX}-/${MINGW_PACKAGE_PREFIX}-/g" <<< $DEPS_LIST)
DEPS_LIST=$(sed 's/\\//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 \ configure_or_build gegl "-Ddocs=false \
-Dcairo=enabled -Dumfpack=enabled \ -Dcairo=enabled -Dumfpack=enabled \
-Dopenexr=enabled -Dworkshop=true" -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} rm -fr ~/_install${ARTIFACTS_SUFFIX}
mv "_install${ARTIFACTS_SUFFIX}" ~ mv "_install${ARTIFACTS_SUFFIX}" ~
else 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 if [[ "$0" != "build/windows/gitlab-ci/2_build-gimp-msys2.sh" ]]; then
GIMP_EXTDIR="$0" echo "To run this script locally, please do it from to the gimp git folder"
GIMP_EXTDIR=$(sed 's|build/windows/gitlab-ci/2_build-gimp-msys2.sh||g' <<< $GIMP_EXTDIR) exit 1
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
fi fi
pacman --noconfirm -Suy pacman --noconfirm -Suy
@ -40,6 +33,7 @@ fi
# Install the required (pre-built) packages for GIMP # Install the required (pre-built) packages for GIMP
GIMP_DIR=""
DEPS_CODE=$(cat build/windows/gitlab-ci/1_build-deps-msys2.sh) DEPS_CODE=$(cat build/windows/gitlab-ci/1_build-deps-msys2.sh)
DEPS_CODE=$(sed -n '/# Install the/,/# End of install/p' <<< $DEPS_CODE) DEPS_CODE=$(sed -n '/# Install the/,/# End of install/p' <<< $DEPS_CODE)
echo "$DEPS_CODE" | bash echo "$DEPS_CODE" | bash

View File

@ -25,6 +25,7 @@ fi
if [[ "$BUILD_TYPE" != "CI_CROSS" ]]; then if [[ "$BUILD_TYPE" != "CI_CROSS" ]]; then
# Install the required (pre-built) packages again # Install the required (pre-built) packages again
GIMP_DIR=""
DEPS_CODE=$(cat build/windows/gitlab-ci/1_build-deps-msys2.sh) DEPS_CODE=$(cat build/windows/gitlab-ci/1_build-deps-msys2.sh)
DEPS_CODE=$(sed -n '/# Install the/,/# End of install/p' <<< $DEPS_CODE) DEPS_CODE=$(sed -n '/# Install the/,/# End of install/p' <<< $DEPS_CODE)
echo "$DEPS_CODE" | bash echo "$DEPS_CODE" | bash