diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b5bef8bf79..ea882c9b70 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -278,7 +278,9 @@ gimp-debian-x64: # and appstream-cli get confused with our exotic naming and fails - cd .. - git apply -v build/linux/appimage/patches/0001-desktop-po-Use-reverse-DNS-naming.patch - - git apply -v build/linux/appimage/patches/0001-images-logo-Use-reverse-DNS-naming.patch + - cd gimp-data + - git apply -v ../build/linux/appimage/patches/0001-images-logo-Use-reverse-DNS-naming.patch + - cd .. - meson configure _build${ARTIFACTS_SUFFIX} -Drelocatable-bundle=yes -Dvector-icons=true - cd _build${ARTIFACTS_SUFFIX} - ninja diff --git a/build/linux/appimage/patches/0001-images-logo-Use-reverse-DNS-naming.patch b/build/linux/appimage/patches/0001-images-logo-Use-reverse-DNS-naming.patch index c436337dce..d3288d5a70 100644 --- a/build/linux/appimage/patches/0001-images-logo-Use-reverse-DNS-naming.patch +++ b/build/linux/appimage/patches/0001-images-logo-Use-reverse-DNS-naming.patch @@ -1,16 +1,16 @@ -From f84e5cdc3e671491e45ec839af97f61e2272d78c Mon Sep 17 00:00:00 2001 +From dfd4f599b80883a649175dd76a2f2ea71388cc18 Mon Sep 17 00:00:00 2001 From: Bruno Lopes -Date: Sat, 30 Mar 2024 16:13:10 -0300 +Date: Sun, 21 Apr 2024 20:22:35 -0300 Subject: [PATCH] images/logo: Use reverse DNS naming --- - gimp-data/images/logo/meson.build | 8 ++++---- + images/logo/meson.build | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) -diff --git a/gimp-data/images/logo/meson.build b/gimp-data/images/logo/meson.build -index bf0a5ea..4ec96a1 100644 ---- a/gimp-data/images/logo/meson.build -+++ b/gimp-data/images/logo/meson.build +diff --git a/images/logo/meson.build b/images/logo/meson.build +index 394a9a3..8af98eb 100644 +--- a/images/logo/meson.build ++++ b/images/logo/meson.build @@ -57,21 +57,21 @@ desktop_sizes = [ foreach size : desktop_sizes sizedir = size + 'x' + size @@ -29,14 +29,14 @@ index bf0a5ea..4ec96a1 100644 - 'mkdir -p "$MESON_INSTALL_DESTDIR_PREFIX/@1@/" && cp -f "@0@" "$MESON_INSTALL_DESTDIR_PREFIX/@1@/gimp.png"'.format(app_icon.full_path(), installdir)) + 'mkdir -p "$MESON_INSTALL_DESTDIR_PREFIX/@1@/" && cp -f "@0@" "$MESON_INSTALL_DESTDIR_PREFIX/@1@/org.gimp.GIMP.png"'.format(app_icon.full_path(), installdir)) endforeach - + install_data('gimp-logo.svg', install_dir: get_option('datadir') / 'icons' / 'hicolor' / 'scalable' / 'apps', - rename: 'gimp.svg') + rename: 'org.gimp.GIMP.svg') - - ## gimp.ico (Windows) ## - --- + + ## gimp.ico and fileicon.ico (Windows) ## + +-- 2.44.0.windows.1 diff --git a/build/windows/store/Assets/meson.build b/build/windows/store/Assets/meson.build index 689e91637b..09005b7b1c 100644 --- a/build/windows/store/Assets/meson.build +++ b/build/windows/store/Assets/meson.build @@ -130,6 +130,7 @@ foreach scale : scales med_tile = custom_target(icon_name, input : [ gen_medtile_py ], depend_files: [ wilber_path ], + depends: [ gimp_exe_depends ], output: [ icon_name ], command: [ gimp_exe, '-nidfs', '--batch-interpreter', 'python-fu-eval', @@ -167,6 +168,7 @@ foreach scale : scales small_tile = custom_target(icon_name, input : [ gen_smalltile_py ], depend_files: [ wilber_path ], + depends: [ gimp_exe_depends ], output: [ icon_name ], command: [ gimp_exe, '-nidfs', '--batch-interpreter', 'python-fu-eval', @@ -202,6 +204,7 @@ foreach scale : scales large_tile = custom_target(icon_name, input : [ gen_largetile_py ], depend_files: [ wilber_path ], + depends: [ gimp_exe_depends ], output: [ icon_name ], command: [ gimp_exe, '-nidfs', '--batch-interpreter', 'python-fu-eval', @@ -240,6 +243,7 @@ foreach scale : scales wide_tile = custom_target(icon_name, input : [ gen_widetile_py ], depend_files: [ wilber_path ], + depends: [ gimp_exe_depends ], output: [ icon_name ], command: [ gimp_exe, '-nidfs', '--batch-interpreter', 'python-fu-eval', @@ -273,6 +277,7 @@ foreach scale : scales custom_target(icon_name, input : [ gen_fileicon_py ], depend_files: [ wilber_path, fileicon_path ], + depends: [ gimp_exe_depends ], output: [ icon_name ], command: [ gimp_exe, '-nidfs', '--batch-interpreter', 'python-fu-eval', @@ -294,6 +299,7 @@ foreach size : sizes custom_target(icon_name, input : [ gen_fileicon_py ], depend_files: [ wilber_path, fileicon_path ], + depends: [ gimp_exe_depends ], output: [ icon_name ], command: [ gimp_exe, '-nidfs', '--batch-interpreter', 'python-fu-eval', @@ -314,13 +320,13 @@ gen_new_xcf_py = configure_file( ) xcf_file = custom_target('New_GIMP_Project.xcf', - input : [ gen_new_xcf_py ], - depend_files: [ wilber_path ], - output: [ 'New_GIMP_Project.xcf', ], - command: [ gimp_exe, '-nidfs', - '--batch-interpreter', 'python-fu-eval', - '-b', '-', '--quit'], - feed: true, - build_by_default: true, - env: gimp_run_env -) + input : [ gen_new_xcf_py ], + depend_files: [ wilber_path ], + depends: [ gimp_exe_depends ], + output: [ 'New_GIMP_Project.xcf', ], + command: [ gimp_exe, '-nidfs', + '--batch-interpreter', 'python-fu-eval', + '-b', '-', '--quit'], + feed: true, + build_by_default: true, + env: gimp_run_env) diff --git a/gimp-data b/gimp-data index d77c9c4c2d..e9762d29e2 160000 --- a/gimp-data +++ b/gimp-data @@ -1 +1 @@ -Subproject commit d77c9c4c2d3d44c181b1aac1fffeafb0c44f6626 +Subproject commit e9762d29e2730786b313663dfba491b8da348e89 diff --git a/meson.build b/meson.build index 4a1a21a165..201371b5f1 100644 --- a/meson.build +++ b/meson.build @@ -1850,6 +1850,7 @@ subdir('app-tools') # tool. gimp_run_env=environment() +gimp_run_env.set('GIMP_GLOBAL_BUILD_ROOT', meson.global_build_root()) if meson.can_run_host_binaries() if enable_console_bin @@ -1899,8 +1900,6 @@ if meson.can_run_host_binaries() elif platform_osx gimp_exe_depends += [gimp_exe_typelib] - gimp_run_env.set('GIMP_GLOBAL_BUILD_ROOT', meson.global_build_root()) - gimp_run_env.set('GIMP_GI_DIR', gi.get_variable('libdir')) gimp_run_env.set('GIMP_TEMP_UPDATE_RPATH', gimp_real_exe.full_path()) @@ -1932,19 +1931,6 @@ endif gimp_exe = find_program('tools'/'in-build-gimp.sh') -# Use a temporary config directory in the top build root for 2 reasons: first -# because we don't want to pollute any existing user config folder; second -# because the default directory may not be writable (we have the case in macOS -# CI), but the build dir always is. -# XXX We might also want to delete this directory before every use, especially -# when using the binary for testing (ensuring we always start from a fresh -# config). But for now, let's keep it as-is. -gimp_exe_config_dir = custom_target('gimp_exe_config_dir', - output: [ '.tmp-config' ], - command: [ 'mkdir', '-p', '@OUTDIR@' + '/.tmp-config' ], - build_by_default: true) -gimp_run_env.set('GIMP3_DIRECTORY', gimp_exe_config_dir.full_path()) - ################################################################################ # Subdirs: part 2 diff --git a/tools/in-build-gimp.sh b/tools/in-build-gimp.sh index 695b2c62c8..3399aad390 100755 --- a/tools/in-build-gimp.sh +++ b/tools/in-build-gimp.sh @@ -2,6 +2,9 @@ set -e +export GIMP3_DIRECTORY=$(mktemp -d ${GIMP_GLOBAL_BUILD_ROOT}/.GIMP3-build-config-XXX) +echo INFO: temporary GIMP configuration directory: $GIMP3_DIRECTORY + if [ -n "$GIMP_TEMP_UPDATE_RPATH" ]; then # Earlier code used to set DYLD_LIBRARY_PATH environment variable instead, but # it didn't work on contributor's builds because of System Integrity @@ -38,3 +41,27 @@ if [ -n "$GIMP_TEMP_UPDATE_RPATH" ]; then done; unset IFS fi + +# Clean-up the temporary config directory after each usage, yet making sure we +# don't get tricked by weird redirections or anything of the sort. In particular +# we check that this is a directory with user permission, not a symlink, and +# that it's inside inside the project build's root. +if [ -n "$GIMP3_DIRECTORY" ] && [ -d "$GIMP3_DIRECTORY" ] && [ -O "$GIMP3_DIRECTORY" ]; then + if [ -L "$GIMP3_DIRECTORY" ]; then + echo "ERROR: \$GIMP3_DIRECTORY ($GIMP3_DIRECTORY) should not be a symlink." + exit 1 + fi + used_dir_prefix=$(realpath "$GIMP3_DIRECTORY") + used_dir_prefix=${used_dir_prefix%???} + tmpl_dir_prefix=$(realpath "$GIMP_GLOBAL_BUILD_ROOT/.GIMP3-build-config-") + if [ "$used_dir_prefix" != "$tmpl_dir_prefix" ]; then + echo "ERROR: \$GIMP3_DIRECTORY ($GIMP3_DIRECTORY) should be under the build directory with a specific prefix." + echo " \"$used_dir_prefix\" != \"$tmpl_dir_prefix\"" + exit 1 + fi + echo INFO: Running: rm -fr --preserve-root --one-file-system \"$GIMP3_DIRECTORY\" + rm -fr --preserve-root --one-file-system "$GIMP3_DIRECTORY" +else + echo "ERROR: \$GIMP3_DIRECTORY ($GIMP3_DIRECTORY) is not a directory or does not belong to the user" + exit 1 +fi