configure, libgimpwidgets: customizable default color profile directory

We have this problem with flatpak that the common directory
("/usr/share/color/icc") is not visible from inside the sandbox. With
proper permissions, it is actually accessible, yet the host's /usr is
mounted at /run/host/usr/.
Since sandbox systems are getting more common, we need to make this path
customizable. I am therefore adding a --with-icc-directory configure
option to change the default color profile folder at build time.
See: https://github.com/flathub/org.gimp.GIMP/issues/15
This commit is contained in:
Jehan 2018-05-18 09:08:51 +02:00
parent 7bad32cf33
commit 6c9ba16e11
2 changed files with 27 additions and 2 deletions

View File

@ -2341,6 +2341,30 @@ NOTE: if you plan on packaging GIMP for distribution, it is recommended
"
fi
#########################
# Default ICC directory #
#########################
# This is necessary because some Unix systems may have a different
# standard path for color profiles. And in particular, sandbox builds
# might mount the host system at a different root. This is for
# instance the case of flatpak which mount the host root at /run/host/.
if test "x$platform_osx" = "xno" &&
test "x$platform_win32" = "xno"; then
AC_MSG_CHECKING([default directory for color profiles])
AC_ARG_WITH(icc-directory,
[ --with-icc-directory Path to default color profiles for this system],,
[with_icc_directory="/usr/share/color/icc"])
if test "x$with_icc_directory" = "x"; then
with_icc_directory="/usr/share/color/icc"
fi
AC_DEFINE_UNQUOTED(COLOR_PROFILE_DIRECTORY,
"$with_icc_directory",
[The path to default color profiles for this system])
fi
######################################
# Checks for gtk-doc and docbook-tools
######################################
@ -2827,6 +2851,7 @@ Optional Features:
Vector icons: $enable_vector_icons
Dr. Mingw (Win32): $enable_drmingw
Bundled MyPaint Brushes: $enable_bundled_mypaint_brushes (at $mypaint_brushes_dir)
Default ICC directory: $with_icc_directory
Optional Plug-Ins:
Ascii Art: $have_libaa

View File

@ -295,7 +295,7 @@ gimp_color_profile_chooser_dialog_add_shortcut (GimpColorProfileChooserDialog *d
}
if (! folder_set)
add_shortcut (dialog, "/usr/share/color/icc");
add_shortcut (dialog, COLOR_PROFILE_DIRECTORY);
}
#endif
}