1
1
mirror of https://gitlab.gnome.org/GNOME/gimp.git synced 2025-10-06 01:12:40 +02:00

build, tools, gimp-data: removing gimp_exe_config_dir from the root meson.build.

Creating a temporary config directory for the in-build GIMP (run as a tool or
for unit-testing) is not done as a build target anymore, but in the
in-build-gimp.sh script as a unique temp directory, then cleaned out on exit.
This has a few advantages:

- It is properly cleaned out once the build ends (instead of leaving a full
  config dir as trash inside the build dir).
- It is not reused from one build to another (with risk of carrying bugs and
  issues over).
- Every use of the in-build GIMP will have its own config directory, and in
  particular when they are called in parallel.

As a side update, make sure that all `gimp_exe` runs depend on
`gimp_exe_depends`.
This commit is contained in:
Jehan
2024-04-21 22:37:45 +02:00
committed by Bruno Lopes
parent a54253db04
commit 2f9881c03f
6 changed files with 60 additions and 39 deletions

View File

@@ -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