meson: On RCs, use the same GIMP_MUTEX_VERSION of the previous unstable

Like we do (better) on the MSIX, Flatpak and Snap with their channels.
Otherwise, a RC .exe installer overrides the existing stable installation!
This commit is contained in:
Bruno Lopes 2025-11-19 15:16:28 -03:00 committed by Bruno
parent 87c91bf6a1
commit 974c37a7ce
3 changed files with 17 additions and 13 deletions

View file

@ -243,7 +243,7 @@ if enable_default_bin
meson.add_install_script(python, '-c', 'from shutil import copy2; from pathlib import Path; from sys import argv; import os; copy2(argv[1], str(Path(os.environ.get("MESON_INSTALL_DESTDIR_PREFIX")) / "bin" / argv[2]))',
gimpmain_exe.full_path(), fs.name(gimpmain_exe.name()).replace(exec_ver, '.exe'))
meson.add_install_script(python, '-c', 'from shutil import copy2; from pathlib import Path; from sys import argv; import os; copy2(argv[1], str(Path(os.environ.get("MESON_INSTALL_DESTDIR_PREFIX")) / "bin" / argv[2].replace("@0@", argv[3])))',
gimpmain_exe.full_path(), fs.name(gimpmain_exe.name()).replace(exec_ver, '-@0@.exe'), api_version_major.to_string())
gimpmain_exe.full_path(), fs.name(gimpmain_exe.name()).replace(exec_ver, '-@0@.exe'), gimp_mutex_version) #see the rationale on main meson.build
endif
if enable_console_bin
if not platform_windows
@ -257,7 +257,7 @@ if enable_default_bin
meson.add_install_script(python, '-c', 'from shutil import copy2; from pathlib import Path; from sys import argv; import os; copy2(argv[1], str(Path(os.environ.get("MESON_INSTALL_DESTDIR_PREFIX")) / "bin" / argv[2]))',
gimpconsole_exe.full_path(), fs.name(gimpconsole_exe.name()).replace(exec_ver, '.exe'))
meson.add_install_script(python, '-c', 'from shutil import copy2; from pathlib import Path; from sys import argv; import os; copy2(argv[1], str(Path(os.environ.get("MESON_INSTALL_DESTDIR_PREFIX")) / "bin" / argv[2].replace("@0@", argv[3])))',
gimpconsole_exe.full_path(), fs.name(gimpconsole_exe.name()).replace(exec_ver, '-@0@.exe'), api_version_major.to_string())
gimpconsole_exe.full_path(), fs.name(gimpconsole_exe.name()).replace(exec_ver, '-@0@.exe'), gimp_mutex_version) #see the rationale on main meson.build
endif
endif
endif

View file

@ -85,13 +85,9 @@
#include BUILD_DIR + "\config_clean.h"
;Main GIMP versions:
;Get GIMP_MUTEX_VERSION (used for internal versioning control)
#if Defined(GIMP_UNSTABLE)
#define GIMP_MUTEX_VERSION GIMP_APP_VERSION
#else
#define GIMP_MUTEX_VERSION=Copy(GIMP_APP_VERSION,1,Pos(".",GIMP_APP_VERSION)-1)
#endif
;Get FULL_GIMP_VERSION (used by ITs)
;1) Get GIMP_MUTEX_VERSION (used for internal versioning control)
;Taken from config_clean.h
;2) Get FULL_GIMP_VERSION (used by ITs)
#define ORIGINAL_GIMP_VERSION GIMP_VERSION
#if Defined(GIMP_RC_VERSION)
#define GIMP_VERSION=Copy(GIMP_VERSION,1,Pos("-",GIMP_VERSION)-1)
@ -101,7 +97,7 @@
#else
#define FULL_GIMP_VERSION GIMP_VERSION + "." + REVISION
#endif
;Get CUSTOM_GIMP_VERSION (that the users see)
;3) Get CUSTOM_GIMP_VERSION (that the users see)
#if !Defined(REVISION) || REVISION=="0"
#define CUSTOM_GIMP_VERSION ORIGINAL_GIMP_VERSION
#else

View file

@ -101,11 +101,19 @@ conf.set('GIMP_RC_VERSION', release and gimp_app_version_rc > 0 ? gimp_app_versi
conf.set('GIMP_IS_RC_GIT', gimp_rc_git ? 1 : false)
# Mutex version
if not stable
conf.set_quoted('GIMP_MUTEX_VERSION', gimp_app_version)
if not stable and gimp_app_version_rc <= 0
gimp_mutex_version = gimp_app_version
elif gimp_app_version_rc > 0
# same as unstable gimp_app_version. See: https://gitlab.gnome.org/GNOME/gimp/-/issues/15341
if gimp_app_version_minor == 0
gimp_mutex_version = (gimp_app_version_major - 1).to_string() + '.' + '99'
else
gimp_mutex_version = gimp_app_version_major.to_string() + '.' + (gimp_app_version_minor - 1).to_string()
endif
else
conf.set_quoted('GIMP_MUTEX_VERSION', gimp_app_version_major.to_string())
gimp_mutex_version = gimp_app_version_major.to_string()
endif
conf.set_quoted('GIMP_MUTEX_VERSION', gimp_mutex_version)
versionconfig = configuration_data()
versionconfig.set('GIMP_FULL_NAME', full_name)