build/windows: Make deps install "modular"

Since almost the same code is used in the 3 stages, let's reuse it.
This commit is contained in:
Bruno Lopes 2024-02-17 09:30:48 -03:00
parent 09a26ddb72
commit 265fb09ce6
3 changed files with 7 additions and 37 deletions

View File

@ -52,6 +52,7 @@ if [ $retry -eq 0 ]; then
echo "MSYS2 pacman repeatedly failed. See: https://github.com/msys2/MSYS2-packages/issues/4340"
exit 1
fi
# End of install
# Clone babl and GEGL (follow master branch)

View File

@ -40,25 +40,9 @@ fi
# Install the required (pre-built) packages for GIMP
export DEPS_PATH="build/windows/gitlab-ci/all-deps-uni.txt"
sed -i "s/DEPS_ARCH_/${MINGW_PACKAGE_PREFIX}-/g" $DEPS_PATH
export GIMP_DEPS=`cat $DEPS_PATH`
retry=3
while [ $retry -gt 0 ]; do
timeout --signal=KILL 3m pacman --noconfirm -S --needed base-devel \
${MINGW_PACKAGE_PREFIX}-toolchain \
$GIMP_DEPS && break
echo "MSYS2 pacman timed out. Trying again."
taskkill //t //F //IM "pacman.exe"
rm -f c:/msys64/var/lib/pacman/db.lck
: $((--retry))
done
if [ $retry -eq 0 ]; then
echo "MSYS2 pacman repeatedly failed. See: https://github.com/msys2/MSYS2-packages/issues/4340"
exit 1
fi
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

View File

@ -25,24 +25,9 @@ fi
if [[ "$BUILD_TYPE" != "CI_CROSS" ]]; then
# Install the required (pre-built) packages again
export DEPS_PATH="build/windows/gitlab-ci/all-deps-uni.txt"
sed -i "s/DEPS_ARCH_/${MINGW_PACKAGE_PREFIX}-/g" $DEPS_PATH
export GIMP_DEPS=`cat $DEPS_PATH`
retry=3
while [ $retry -gt 0 ]; do
timeout --signal=KILL 3m pacman --noconfirm -S --needed base-devel \
${MINGW_PACKAGE_PREFIX}-toolchain \
$GIMP_DEPS && break
echo "MSYS2 pacman timed out. Trying again."
taskkill //t //F //IM "pacman.exe"
rm -f c:/msys64/var/lib/pacman/db.lck
: $((--retry))
done
if [ $retry -eq 0 ]; then
echo "MSYS2 pacman repeatedly failed. See: https://github.com/msys2/MSYS2-packages/issues/4340"
exit 1
fi
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
fi