From 9d279a60ce7cdc46f977d9e1accad14264334db7 Mon Sep 17 00:00:00 2001 From: Jehan Date: Fri, 1 Mar 2024 15:15:18 +0100 Subject: [PATCH] meson: moving away from meson subprojects in favor of git submodules. Meson subprojects just have too many problems and limitations and I can foresee the maintenance headache and the future incoming false-positive bug reports if we start using meson subprojects. Comparing to the simplicity of git submodule which also has much better notifications to help people understand when the submodule is not in sync and how to remedy to it. See commit gimp-data@c364adb explaining the main reasons in detail. --- .gitlab-ci.yml | 6 ++++++ .gitmodules | 5 +++++ app/gui/icon-themes.c | 3 +-- build/windows/gimp.rc.in | 2 +- gimp-data | 1 + meson.build | 12 ++---------- subprojects/gimp-data.wrap | 4 ---- 7 files changed, 16 insertions(+), 17 deletions(-) create mode 100644 .gitmodules create mode 160000 gimp-data delete mode 100644 subprojects/gimp-data.wrap diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 94563336b5..200b29e192 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -322,6 +322,7 @@ deps-debian-x64: - export LD_LIBRARY_PATH="${GIMP_PREFIX}/lib/`gcc -print-multiarch`:$LD_LIBRARY_PATH" - export XDG_DATA_DIRS="${GIMP_PREFIX}/share:/usr/local/share:/usr/share" - export GI_TYPELIB_PATH="${GIMP_PREFIX}/lib/`gcc -print-multiarch`/girepository-1.0/:${GI_TYPELIB_PATH}" + - git submodule update --init needs: ["deps-debian-x64"] gimp-debian-x64: @@ -542,6 +543,7 @@ gimp-win-x64-cross: - apt-cache script: - export PATH="`pwd`/.local/bin:$PATH" + - git submodule update --init - crossroad w64 gimp --run="build/windows/gitlab-ci/2_build-gimp-crossroad.sh" needs: ["deps-win-x64-cross"] artifacts: @@ -641,6 +643,7 @@ gimp-win-x86-cross: - apt-cache script: - export PATH="`pwd`/.local/bin:$PATH" + - git submodule update --init - crossroad w32 gimp --run="build/windows/gitlab-ci/2_build-gimp-crossroad.sh" needs: ["deps-win-x86-cross", "deps-win-x64-cross"] artifacts: @@ -741,6 +744,7 @@ gimp-win-a64: - windows-aarch64 before_script: # C:\msys64\usr\bin\pacman --noconfirm -Syyuu + - git submodule update --init script: - $stuck = Test-Path -Path "C:\msys64\var\lib\pacman\db.lck" -PathType Leaf - if ($stuck -eq "True") { @@ -848,6 +852,7 @@ gimp-win-x64: - win32-ps before_script: - C:\msys64\usr\bin\pacman --noconfirm -Syyuu + - git submodule update --init script: - C:\msys64\usr\bin\bash -lc "bash -x ./build/windows/gitlab-ci/2_build-gimp-msys2.sh" artifacts: @@ -940,6 +945,7 @@ gimp-win-x86: - win32-ps before_script: - C:\msys64\usr\bin\pacman --noconfirm -Syyuu + - git submodule update --init script: - C:\msys64\usr\bin\bash -lc "bash -x ./build/windows/gitlab-ci/2_build-gimp-msys2.sh" artifacts: diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000000..4b3a996d91 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,5 @@ +[submodule "gimp-data"] + path = gimp-data + url = https://gitlab.gnome.org/GNOME/gimp-data.git + shallow = true + branch = wip/Jehan/git-submodules diff --git a/app/gui/icon-themes.c b/app/gui/icon-themes.c index b13d74257c..224f8fb3fb 100644 --- a/app/gui/icon-themes.c +++ b/app/gui/icon-themes.c @@ -255,8 +255,7 @@ icons_apply_theme (Gimp *gimp, gchar *path; path = g_build_filename (g_getenv ("GIMP_TESTING_ABS_TOP_SRCDIR"), - "subprojects", "gimp-data", "icons", - icon_theme_name, NULL); + "gimp-data", "icons", icon_theme_name, NULL); file = g_file_new_for_path (path); applied = gimp_icons_set_icon_theme (file); diff --git a/build/windows/gimp.rc.in b/build/windows/gimp.rc.in index 846ad0445a..716e2a5015 100644 --- a/build/windows/gimp.rc.in +++ b/build/windows/gimp.rc.in @@ -64,6 +64,6 @@ BEGIN END #include "winuser.h" -1 ICON QUOTE(TOP_SRCDIR) "/subprojects/gimp-data/images/gimp.ico" +1 ICON QUOTE(TOP_SRCDIR) "/gimp-data/images/gimp.ico" 2 ICON QUOTE(TOP_SRCDIR) "/build/windows/fileicon.ico" CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST QUOTE(TOP_SRCDIR) "/build/windows/gimp.manifest" diff --git a/gimp-data b/gimp-data new file mode 160000 index 0000000000..c364adb888 --- /dev/null +++ b/gimp-data @@ -0,0 +1 @@ +Subproject commit c364adb888ad2299f56451706c5cd875c98e3059 diff --git a/meson.build b/meson.build index ba6ab50948..93da57ca5f 100644 --- a/meson.build +++ b/meson.build @@ -1827,16 +1827,8 @@ else gimp_exe_name=gimpmain_exe_name endif -# Loading gimp-data subproject, the versions must be in sync. -gimp_data = subproject('gimp-data', version: '=' + gimp_version, - default_options: [ - 'gimp-datadir=' + gimpdatadir, - 'gimp-exe=' + gimp_exe_name, - ]) -icons_imgs_sources = gimp_data.get_variable('icons_imgs_sources') -icons_core_sources = gimp_data.get_variable('icons_core_sources') -cursors_sources = gimp_data.get_variable('cursors_sources') -pickers_sources = gimp_data.get_variable('pickers_sources') +# gimp-data submodule +subdir('gimp-data') # Libraries (order here is important!) subdir('libgimpcolor') diff --git a/subprojects/gimp-data.wrap b/subprojects/gimp-data.wrap deleted file mode 100644 index 2ed5f498d6..0000000000 --- a/subprojects/gimp-data.wrap +++ /dev/null @@ -1,4 +0,0 @@ -[wrap-git] -url = https://gitlab.gnome.org/GNOME/gimp-data -revision = main -depth = 1