[nautilus/wip/oholy/gexiv2-deprecation] extensions/image-properties: Replace deprecated symbols




commit 92596e7e9a9436f7a45ad0327186fa89e032aa25
Author: Ondrej Holy <oholy redhat com>
Date:   Fri Jun 4 14:39:06 2021 +0200

    extensions/image-properties: Replace deprecated symbols
    
    The build log contains warnings about deprecated gexiv2 functions. Let's
    port to the new API, unpin exiv3 and gexiv2 dependencies in flatpak manifests
    and bump the build dependency accordingly to get rid of the warnings.

 build-aux/flatpak/org.gnome.Nautilus.json                    | 11 +++++------
 build-aux/flatpak/org.gnome.Nautilus.yml                     |  9 ++++-----
 build-aux/flatpak/org.gnome.NautilusMaster.yml               |  6 +++---
 extensions/image-properties/nautilus-image-properties-page.c |  6 +++---
 meson.build                                                  |  2 +-
 5 files changed, 16 insertions(+), 18 deletions(-)
---
diff --git a/build-aux/flatpak/org.gnome.Nautilus.json b/build-aux/flatpak/org.gnome.Nautilus.json
index 52e6333a7..d3a535609 100644
--- a/build-aux/flatpak/org.gnome.Nautilus.json
+++ b/build-aux/flatpak/org.gnome.Nautilus.json
@@ -34,9 +34,8 @@
       "buildsystem": "cmake-ninja",
       "sources": [
         {
-          "type": "archive",
-          "url": "https://github.com/Exiv2/exiv2/archive/v0.26.tar.gz";,
-          "sha256": "51cffa8d19d67e1da6c1d0f570a75b8f6c814113367318c2c0407691888c5f01"
+          "type": "git",
+          "url": "https://github.com/Exiv2/exiv2.git";
         }
       ]
     },
@@ -46,13 +45,13 @@
       "builddir": true,
       "config-opts": [
         "--libdir=/app/lib",
-        "-Ddisable-introspection=True"
+        "-Dintrospection=false",
+        "-Dpython3_girdir=no"
       ],
       "sources": [
         {
           "type": "git",
-          "url": "https://gitlab.gnome.org/GNOME/gexiv2.git";,
-          "tag": "gexiv2-0.10.10"
+          "url": "https://gitlab.gnome.org/GNOME/gexiv2.git";
         }
       ]
     },
diff --git a/build-aux/flatpak/org.gnome.Nautilus.yml b/build-aux/flatpak/org.gnome.Nautilus.yml
index 4a15c4c53..d6a58e0a4 100644
--- a/build-aux/flatpak/org.gnome.Nautilus.yml
+++ b/build-aux/flatpak/org.gnome.Nautilus.yml
@@ -30,19 +30,18 @@ modules:
   - "-DCMAKE_INSTALL_LIBDIR=/app/lib"
   buildsystem: cmake-ninja
   sources:
-  - type: archive
-    url: https://github.com/Exiv2/exiv2/archive/v0.26.tar.gz
-    sha256: 51cffa8d19d67e1da6c1d0f570a75b8f6c814113367318c2c0407691888c5f01
+  - type: git
+    url: https://github.com/Exiv2/exiv2.git
 - name: gexiv2
   buildsystem: meson
   builddir: true
   config-opts:
   - "--libdir=/app/lib"
-  - "-Ddisable-introspection=True"
+  - "-Dintrospection=false"
+  - "-Dpython3_girdir=no"
   sources:
   - type: git
     url: https://gitlab.gnome.org/GNOME/gexiv2.git
-    tag: gexiv2-0.10.10
 - name: tracker-miners
   buildsystem: meson
   cleanup:
diff --git a/build-aux/flatpak/org.gnome.NautilusMaster.yml b/build-aux/flatpak/org.gnome.NautilusMaster.yml
index bc1771627..619f52a8d 100644
--- a/build-aux/flatpak/org.gnome.NautilusMaster.yml
+++ b/build-aux/flatpak/org.gnome.NautilusMaster.yml
@@ -30,15 +30,15 @@ modules:
   - "-DCMAKE_INSTALL_LIBDIR=/app/lib"
   buildsystem: cmake-ninja
   sources:
-  - type: archive
-    url: https://github.com/Exiv2/exiv2/archive/v0.26.tar.gz
-    sha256: 51cffa8d19d67e1da6c1d0f570a75b8f6c814113367318c2c0407691888c5f01
+  - type: git
+    url: https://github.com/Exiv2/exiv2.git
 - name: gexiv2
   buildsystem: meson
   builddir: true
   config-opts:
   - "--libdir=/app/lib"
   - "-Dintrospection=false"
+  - "-Dpython3_girdir=no"
   sources:
   - type: git
     url: https://gitlab.gnome.org/GNOME/gexiv2.git
diff --git a/extensions/image-properties/nautilus-image-properties-page.c 
b/extensions/image-properties/nautilus-image-properties-page.c
index 23aca4986..9b7485f58 100644
--- a/extensions/image-properties/nautilus-image-properties-page.c
+++ b/extensions/image-properties/nautilus-image-properties-page.c
@@ -196,11 +196,11 @@ append_gexiv2_tag (NautilusImagesPropertiesPage  *page,
         {
             g_autofree char *tag_value = NULL;
 
-            tag_value = gexiv2_metadata_get_tag_interpreted_string (page->md, *i);
+            tag_value = gexiv2_metadata_try_get_tag_interpreted_string (page->md, *i, NULL);
 
             if (description == NULL)
             {
-                description = gexiv2_metadata_get_tag_description (*i);
+                description = gexiv2_metadata_try_get_tag_description (*i, NULL);
             }
 
             /* don't add empty tags - try next one */
@@ -262,7 +262,7 @@ append_gexiv2_info (NautilusImagesPropertiesPage *page)
     append_gexiv2_tag (page, rights, _("Copyright"));
     append_gexiv2_tag (page, rating, _("Rating"));
 
-    if (gexiv2_metadata_get_gps_info (page->md, &longitude, &latitude, &altitude))
+    if (gexiv2_metadata_try_get_gps_info (page->md, &longitude, &latitude, &altitude, NULL))
     {
         g_autofree char *gps_coords = NULL;
 
diff --git a/meson.build b/meson.build
index 12a7cd601..1d28f4e6c 100644
--- a/meson.build
+++ b/meson.build
@@ -109,7 +109,7 @@ libgd_dep = libgd.get_variable('libgd_dep')
 libm = cc.find_library('m')
 
 if get_option('extensions')
-  gexiv = dependency('gexiv2', version: '>= 0.10.0')
+  gexiv = dependency('gexiv2', version: '>= 0.12.2')
   gst_tag_dep = dependency('gstreamer-tag-1.0')
   gst_pbutils_dep = dependency('gstreamer-pbutils-1.0')
 endif


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]