From bffe62d43eb9aadadb84aaf43e197e4b4d086581 Mon Sep 17 00:00:00 2001 From: Bruno Lopes Date: Tue, 23 Apr 2024 08:50:33 -0300 Subject: [PATCH] gitlab-ci, build: Drop custom "CI_*" variables Let's figure out what job is running using the predefined GitLab variables. --- .gitlab-ci.yml | 2 -- build/windows/gitlab-ci/1_build-deps-msys2.sh | 4 +--- build/windows/gitlab-ci/2_build-gimp-msys2.sh | 4 ++-- build/windows/gitlab-ci/3_bundle-gimp-uni_base.sh | 8 ++++---- 4 files changed, 7 insertions(+), 11 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 404dd11823..e4b2c2c8e0 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -390,7 +390,6 @@ gimp-flatpak-x64: - if: '$CI_PIPELINE_SOURCE == "push" && $CI_OPEN_MERGE_REQUESTS == null && $CI_COMMIT_TAG == null' image: $CI_REGISTRY_IMAGE:build-debian-latest variables: - BUILD_TYPE: "CI_CROSS" # Needed because by default, Debian has now changed # "sysconfig.get_default_scheme()" from "posix_prefix" to "posix_local" which # adds a local/ folder to the install prefix of setup.py. This environment @@ -452,7 +451,6 @@ gimp-win-x64-cross: # Merge requests with appropriate label. - if: '$CI_MERGE_REQUEST_LABELS =~ /.*5. Windows Installer.*/' variables: - BUILD_TYPE: "CI_NATIVE" CHERE_INVOKING: "yes" # We use the same universal variables but not directly from PS before_script: [] diff --git a/build/windows/gitlab-ci/1_build-deps-msys2.sh b/build/windows/gitlab-ci/1_build-deps-msys2.sh index 831496ac3c..fc100384b8 100644 --- a/build/windows/gitlab-ci/1_build-deps-msys2.sh +++ b/build/windows/gitlab-ci/1_build-deps-msys2.sh @@ -12,9 +12,7 @@ else # [[ "$MSYSTEM_CARCH" == "i686" ]]; export ARTIFACTS_SUFFIX="-x86" fi -if [[ "$BUILD_TYPE" == "CI_NATIVE" ]]; then - GIMP_DIR="" -else +if [[ -z "$GITLAB_CI" ]]; then # Make the script work locally 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" diff --git a/build/windows/gitlab-ci/2_build-gimp-msys2.sh b/build/windows/gitlab-ci/2_build-gimp-msys2.sh index 5e7d6852ef..c080de19b6 100644 --- a/build/windows/gitlab-ci/2_build-gimp-msys2.sh +++ b/build/windows/gitlab-ci/2_build-gimp-msys2.sh @@ -15,7 +15,7 @@ else # [[ "$MSYSTEM_CARCH" == "i686" ]]; export MSYS2_PREFIX="c:/msys64${MSYSTEM_PREFIX}" fi -if [[ "$BUILD_TYPE" == "CI_NATIVE" ]]; then +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. @@ -125,7 +125,7 @@ make_cmd () echo "Please run the gimp.cmd file to get proper plug-in support."> ${GIMP_PREFIX}/README.txt } -if [[ "$BUILD_TYPE" == "CI_NATIVE" ]]; then +if [[ "$GITLAB_CI" ]]; then make_cmd CI %cd% cd .. diff --git a/build/windows/gitlab-ci/3_bundle-gimp-uni_base.sh b/build/windows/gitlab-ci/3_bundle-gimp-uni_base.sh index 91ae2bce99..74fcd20899 100644 --- a/build/windows/gitlab-ci/3_bundle-gimp-uni_base.sh +++ b/build/windows/gitlab-ci/3_bundle-gimp-uni_base.sh @@ -19,7 +19,7 @@ else # [[ "$MSYSTEM_CARCH" == "i686" ]]; fi -if [[ "$BUILD_TYPE" == "CI_CROSS" ]]; then +if [[ "$CI_JOB_NAME" =~ "cross" ]]; then apt-get update apt-get install -y --no-install-recommends \ binutils \ @@ -32,7 +32,7 @@ fi # Bundle deps and GIMP files export GIMP_PREFIX="`realpath ./_install`${ARTIFACTS_SUFFIX}" -if [[ "$BUILD_TYPE" == "CI_CROSS" ]]; then +if [[ "$CI_JOB_NAME" =~ "cross" ]]; then export GIMP_PREFIX="`realpath ./_install`${ARTIFACTS_SUFFIX}-cross" export MSYS_PREFIX="$GIMP_PREFIX" fi @@ -142,12 +142,12 @@ done ### .pdb (CodeView) debug symbols ### TODO: REMOVE 'if [[ "$MSYSTEM...' WHEN GCC 14 IS ON MSYS2 ### crossroad don't have LLVM/Clang backend yet -if [[ "$MSYSTEM_CARCH" != "i686" ]] && [[ "$BUILD_TYPE" != "CI_CROSS" ]]; then +if [[ "$MSYSTEM_CARCH" != "i686" ]] && [[ ! "$CI_JOB_NAME" =~ "cross" ]]; then cp -fr ${GIMP_PREFIX}/bin/*.pdb ${GIMP_DISTRIB}/bin/ fi ## Optional executables, .DLLs and resources for GObject Introspection support -if [[ "$BUILD_TYPE" != "CI_CROSS" ]]; then +if [[ ! "$CI_JOB_NAME" =~ "cross" ]]; then cp -fr ${MSYS_PREFIX}/bin/libgirepository-*.dll ${GIMP_DISTRIB}/bin/ python3 build/windows/gitlab-ci/3_bundle-gimp-uni_dep.py ${GIMP_DISTRIB}/bin/libgirepository-*.dll ${GIMP_PREFIX}/ ${MSYS_PREFIX}/ ${GIMP_DISTRIB} --output-dll-list done-dll.list cp -fr ${MSYS_PREFIX}/lib/girepository-*/ ${GIMP_DISTRIB}/lib/