darktable/darktable-old-glib.patch

46 lines
1.8 KiB
Diff

Index: darktable-2.0.2/src/common/exif.cc
===================================================================
--- darktable-2.0.2.orig/src/common/exif.cc
+++ darktable-2.0.2/src/common/exif.cc
@@ -78,6 +78,13 @@ const char *dt_xmp_keys[]
static const guint dt_xmp_keys_n = G_N_ELEMENTS(dt_xmp_keys); // the number of XmpBag XmpSeq keys that dt uses
+#if ! GLIB_CHECK_VERSION(2,40,0)
+static gboolean _str_is_ascii(const char *str)
+{
+ while(*str) if((guchar)*str++ >= 0x80) return FALSE;
+ return TRUE;
+}
+#endif
/* a few helper functions inspired by
https://projects.kde.org/projects/kde/kdegraphics/libs/libkexiv2/repository/revisions/master/entry/libkexiv2/kexiv2gps.cpp
@@ -1291,7 +1298,11 @@ int dt_exif_read_blob(uint8_t *buf, cons
if(res != NULL)
{
char *desc = (char *)res->data;
+#if GLIB_CHECK_VERSION(2,40,0)
if(g_str_is_ascii(desc))
+#else
+ if(_str_is_ascii(desc))
+#endif
exifData["Exif.Image.ImageDescription"] = desc;
else
exifData["Exif.Photo.UserComment"] = desc;
Index: darktable-2.0.2/cmake/modules/FindGTK3.cmake
===================================================================
--- darktable-2.0.2.orig/cmake/modules/FindGTK3.cmake
+++ darktable-2.0.2/cmake/modules/FindGTK3.cmake
@@ -84,8 +84,8 @@ find_library(GDKPIXBUF_LIBRARY NAMES gdk
# Glib
# NOTE: must be one of the macros listed in https://developer.gnome.org/glib/stable/glib-Version-Information.html
-find_package(Glib REQUIRED 2.40)
-set(GTK3_DEFINITIONS ${GTK3_DEFINITIONS} "-DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_40")
+find_package(Glib REQUIRED 2.32)
+set(GTK3_DEFINITIONS ${GTK3_DEFINITIONS} "-DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_32")
set(GTK3_DEFINITIONS ${GTK3_DEFINITIONS} "-DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_MIN_REQUIRED")
if(NOT Glib_FOUND)