shotwell: update to 0.31.5, use libsoup3

This commit is contained in:
Michal Vasilek 2022-10-02 12:59:30 +02:00
parent 527b27951c
commit 3caa47313b
4 changed files with 4 additions and 466 deletions

View File

@ -1,27 +0,0 @@
From cc328b43ebb9a54a256ec73a86fb18381b2038e6 Mon Sep 17 00:00:00 2001
From: Eli Schwartz <eschwartz@archlinux.org>
Date: Tue, 11 Jan 2022 21:57:26 -0500
Subject: [PATCH] fix duplicate languages causing meson 0.61 to error out
It tried to create multiple targets with the same name and generating
the same file. On older versions of meson, this was a run_target and
just ran twice, but was still wrong.
---
help/LINGUAS | 1 -
1 file changed, 1 deletion(-)
diff --git a/help/LINGUAS b/help/LINGUAS
index 68f089c4..5352eecd 100644
--- a/help/LINGUAS
+++ b/help/LINGUAS
@@ -6,7 +6,6 @@ es
fr
hu
id
-id
lv
pt_BR
sv
--
GitLab

View File

@ -1,368 +0,0 @@
From 9a9876e27076f5939525023eb8c7f24d48c8ff25 Mon Sep 17 00:00:00 2001
From: Jens Georg <mail@jensge.org>
Date: Sun, 14 Mar 2021 11:21:10 +0100
Subject: [PATCH 1/6] vapis: Plug memory leak in GPhoto2
Caller was supposed to free the StorageInfo, which with the old binding
we never did
---
src/camera/GPhoto.vala | 5 +++--
src/camera/ImportPage.vala | 14 ++++++--------
vapi/libgphoto2.vapi | 2 +-
3 files changed, 10 insertions(+), 11 deletions(-)
diff --git a/src/camera/GPhoto.vala b/src/camera/GPhoto.vala
index aa2fcf2b..64ff7ca0 100644
--- a/src/camera/GPhoto.vala
+++ b/src/camera/GPhoto.vala
@@ -135,9 +135,10 @@ namespace GPhoto {
// filesystem. In these cases shotwell can access the file directly. See:
// https://bugzilla.gnome.org/show_bug.cgi?id=716915
public PhotoMetadata? get_fallback_metadata(Camera camera, Context context, string folder, string filename) {
- GPhoto.CameraStorageInformation *sifs = null;
+ // Fixme: Why do we need to query get_storageinfo here first?
+ GPhoto.CameraStorageInformation[] sifs = null;
int count = 0;
- camera.get_storageinfo(&sifs, out count, context);
+ camera.get_storageinfo(out sifs, context);
GPhoto.PortInfo port_info;
camera.get_port_info(out port_info);
diff --git a/src/camera/ImportPage.vala b/src/camera/ImportPage.vala
index ab24df61..c424de88 100644
--- a/src/camera/ImportPage.vala
+++ b/src/camera/ImportPage.vala
@@ -1179,9 +1179,9 @@ public class ImportPage : CheckerboardPage {
Gee.ArrayList<ImportSource> import_list = new Gee.ArrayList<ImportSource>();
- GPhoto.CameraStorageInformation *sifs = null;
+ GPhoto.CameraStorageInformation[] sifs = null;
int count = 0;
- refresh_result = dcamera.gcamera.get_storageinfo(&sifs, out count, spin_idle_context.context);
+ refresh_result = dcamera.gcamera.get_storageinfo(out sifs, spin_idle_context.context);
if (refresh_result == GPhoto.Result.OK) {
for (int fsid = 0; fsid < count; fsid++) {
// Check well-known video and image paths first to prevent accidental
@@ -1324,18 +1324,16 @@ public class ImportPage : CheckerboardPage {
// Need to do this because some phones (iPhone, in particular) changes the name of their filesystem
// between each mount
public static string? get_fs_basedir(GPhoto.Camera camera, int fsid) {
- GPhoto.CameraStorageInformation *sifs = null;
+ GPhoto.CameraStorageInformation[] sifs = null;
int count = 0;
- GPhoto.Result res = camera.get_storageinfo(&sifs, out count, null_context.context);
+ GPhoto.Result res = camera.get_storageinfo(out sifs, null_context.context);
if (res != GPhoto.Result.OK)
return null;
- if (fsid >= count)
+ if (fsid >= sifs.length)
return null;
- GPhoto.CameraStorageInformation *ifs = sifs + fsid;
-
- return (ifs->fields & GPhoto.CameraStorageInfoFields.BASE) != 0 ? ifs->basedir : "/";
+ return (sifs[fsid].fields & GPhoto.CameraStorageInfoFields.BASE) != 0 ? sifs[fsid].basedir : "/";
}
public static string? get_fulldir(GPhoto.Camera camera, string camera_name, int fsid, string folder) {
diff --git a/vapi/libgphoto2.vapi b/vapi/libgphoto2.vapi
index 22f70eed..7e569823 100644
--- a/vapi/libgphoto2.vapi
+++ b/vapi/libgphoto2.vapi
@@ -64,7 +64,7 @@ namespace GPhoto {
public Result set_port_info(PortInfo info);
public Result get_abilities(out CameraAbilities abilities);
public Result set_abilities(CameraAbilities abilities);
- public Result get_storageinfo(CameraStorageInformation **sifs, out int count, Context context);
+ public Result get_storageinfo([CCode (array_length_pos=1)]out CameraStorageInformation[] sifs, Context context);
// Folders
[CCode (cname="gp_camera_folder_list_folders")]
--
2.31.1
From e1f53784dd7475388470a30683df34b5ca7784eb Mon Sep 17 00:00:00 2001
From: Jens Georg <mail@jensge.org>
Date: Sat, 13 Mar 2021 23:22:50 +0100
Subject: [PATCH 2/6] More GPhoto2 vapi fixes
---
vapi/libgphoto2.vapi | 25 ++++++++++++-------------
1 file changed, 12 insertions(+), 13 deletions(-)
diff --git a/vapi/libgphoto2.vapi b/vapi/libgphoto2.vapi
index 7e569823..607a644f 100644
--- a/vapi/libgphoto2.vapi
+++ b/vapi/libgphoto2.vapi
@@ -53,7 +53,7 @@ namespace GPhoto {
ref_function="GPHOTO_REF_CAMERA",
unref_function="gp_camera_unref",
free_function="gp_camera_free",
- cheader_filename="gphoto2/gphoto2-camera.h,gphoto.h"
+ cheader_filename="gphoto2/gphoto2-camera.h,gphoto2.h"
)]
public class Camera {
[CCode (cname="gp_camera_new")]
@@ -74,7 +74,7 @@ namespace GPhoto {
[CCode (cname="gp_camera_folder_delete_all")]
public Result delete_all_files(string folder, Context context);
[CCode (cname="gp_camera_folder_put_file")]
- public Result put_file(string folder, CameraFile file, Context context);
+ public Result put_file(string folder, string filename, CameraFileType type, CameraFile file, Context context);
[CCode (cname="gp_camera_folder_make_dir")]
public Result make_dir(string folder, string name, Context context);
[CCode (cname="gp_camera_folder_remove_dir")]
@@ -99,7 +99,7 @@ namespace GPhoto {
ref_function="GPHOTO_REF_FILE",
unref_function="gp_file_unref",
free_function="gp_file_free",
- cheader_filename="gphoto2/gphoto2-file.h,gphoto.h"
+ cheader_filename="gphoto2/gphoto2-file.h,gphoto2.h"
)]
public class CameraFile {
[CCode (cname="gp_file_new")]
@@ -140,7 +140,6 @@ namespace GPhoto {
public enum CameraFileInfoFields {
NONE,
TYPE,
- NAME,
SIZE,
WIDTH,
HEIGHT,
@@ -159,7 +158,7 @@ namespace GPhoto {
public CameraFileInfoFields fields;
public CameraFileStatus status;
public ulong size;
- public string type;
+ public char type[64];
public uint width;
public uint height;
public string name;
@@ -176,7 +175,7 @@ namespace GPhoto {
public CameraFileInfoFields fields;
public CameraFileStatus status;
public ulong size;
- public string type;
+ public char type[64];
public uint width;
public uint height;
public string name;
@@ -257,7 +256,7 @@ namespace GPhoto {
ref_function="GPHOTO_REF_LIST",
unref_function="gp_list_unref",
free_function="gp_list_free",
- cheader_filename="gphoto2/gphoto2-list.h,gphoto.h"
+ cheader_filename="gphoto2/gphoto2-list.h,gphoto2.h"
)]
public class CameraList {
[CCode (cname="gp_list_new")]
@@ -266,7 +265,7 @@ namespace GPhoto {
public Result append(string name, string value);
public Result reset();
public Result sort();
- public Result find_by_name(out int? index, string name);
+ public Result find_by_name(out int index, string name);
public Result get_name(int index, out unowned string name);
public Result get_value(int index, out unowned string value);
public Result set_name(int index, string name);
@@ -314,9 +313,9 @@ namespace GPhoto {
)]
public struct CameraStorageInformation {
public CameraStorageInfoFields fields;
- public string basedir;
- public string label;
- public string description;
+ public char basedir[256];
+ public char label[256];
+ public char description[256];
public int type;
public int fstype;
public int access;
@@ -329,7 +328,7 @@ namespace GPhoto {
[CCode (
ref_function="GPHOTO_REF_CONTEXT",
unref_function="gp_context_unref",
- cheader_filename="gphoto2/gphoto2-context.h,gphoto.h"
+ cheader_filename="gphoto2/gphoto2-context.h,gphoto2.h"
)]
public class Context {
[CCode (cname="gp_context_new")]
@@ -485,7 +484,7 @@ namespace GPhoto {
[CCode (
cheader_filename="gphoto2/gphoto2-version.h",
- cprefix="GP_VERSION"
+ cprefix="GP_VERSION_"
)]
public enum VersionVerbosity {
SHORT,
--
2.31.1
From 754520638beafa997d81fdbff58a9d07a48f7cfd Mon Sep 17 00:00:00 2001
From: Jens Georg <mail@jensge.org>
Date: Sat, 13 Mar 2021 22:31:32 +0100
Subject: [PATCH 3/6] vapis: Fix gphoto2 vapi
There was some copy-paste going on there that didn't actually match the
C structs
---
vapi/libgphoto2.vapi | 4 ----
1 file changed, 4 deletions(-)
diff --git a/vapi/libgphoto2.vapi b/vapi/libgphoto2.vapi
index 607a644f..adcef5c5 100644
--- a/vapi/libgphoto2.vapi
+++ b/vapi/libgphoto2.vapi
@@ -161,7 +161,6 @@ namespace GPhoto {
public char type[64];
public uint width;
public uint height;
- public string name;
public CameraFilePermissions permissions;
public time_t mtime;
}
@@ -178,9 +177,6 @@ namespace GPhoto {
public char type[64];
public uint width;
public uint height;
- public string name;
- public CameraFilePermissions permissions;
- public time_t mtime;
}
[CCode (
--
2.31.1
From f7d044e7a72b80a550fd1907a2d56053caab1ae3 Mon Sep 17 00:00:00 2001
From: Jens Georg <mail@jensge.org>
Date: Sat, 13 Mar 2021 22:32:17 +0100
Subject: [PATCH 4/6] Fix strings in [SimpleType] structs
---
src/camera/ImportPage.vala | 5 +++--
vapi/libraw.vapi | 2 +-
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/src/camera/ImportPage.vala b/src/camera/ImportPage.vala
index c424de88..f5e98955 100644
--- a/src/camera/ImportPage.vala
+++ b/src/camera/ImportPage.vala
@@ -1408,12 +1408,13 @@ public class ImportPage : CheckerboardPage {
import_list.add(video_source);
} else {
// determine file format from type, and then from file extension
- PhotoFileFormat file_format = PhotoFileFormat.from_gphoto_type(info.file.type);
+ string file_type = (string)info.file.type;
+ PhotoFileFormat file_format = PhotoFileFormat.from_gphoto_type(file_type);
if (file_format == PhotoFileFormat.UNKNOWN) {
file_format = PhotoFileFormat.get_by_basename_extension(filename);
if (file_format == PhotoFileFormat.UNKNOWN) {
message("Skipping %s/%s: Not a supported file extension (%s)", fulldir,
- filename, info.file.type);
+ filename, file_type);
continue;
}
diff --git a/vapi/libraw.vapi b/vapi/libraw.vapi
index b1b5875b..146f447e 100644
--- a/vapi/libraw.vapi
+++ b/vapi/libraw.vapi
@@ -248,7 +248,7 @@ public struct Thumbnail {
public uint tlength;
public int tcolors;
[CCode (array_length_cname="tlength")]
- public uint8[] thumb;
+ public unowned uint8[] thumb;
}
[CCode (cname="enum LibRaw_thumbnail_formats", cprefix="LIBRAW_THUMBNAIL_")]
--
2.31.1
From a035ff6ee39dc47c6051f7b29c7da83d3ecde52e Mon Sep 17 00:00:00 2001
From: Jens Georg <mail@jensge.org>
Date: Sun, 14 Mar 2021 11:21:10 +0100
Subject: [PATCH 5/6] Fix compile error after GPhoto vapi change
---
src/camera/ImportPage.vala | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/camera/ImportPage.vala b/src/camera/ImportPage.vala
index f5e98955..7dbe9d42 100644
--- a/src/camera/ImportPage.vala
+++ b/src/camera/ImportPage.vala
@@ -1333,7 +1333,7 @@ public class ImportPage : CheckerboardPage {
if (fsid >= sifs.length)
return null;
- return (sifs[fsid].fields & GPhoto.CameraStorageInfoFields.BASE) != 0 ? sifs[fsid].basedir : "/";
+ return (GPhoto.CameraStorageInfoFields.BASE in sifs[fsid].fields) ? (string) sifs[fsid].basedir : "/";
}
public static string? get_fulldir(GPhoto.Camera camera, string camera_name, int fsid, string folder) {
--
2.31.1
From 44dae743da462742f1acdeb599f0a10afa43e629 Mon Sep 17 00:00:00 2001
From: Jens Georg <mail@jensge.org>
Date: Sun, 14 Mar 2021 12:22:55 +0100
Subject: [PATCH 6/6] Fix and clarify the helper header for GPhoto
---
vapi/libgphoto2.vapi | 8 ++++----
vapi/{gphoto.h => shotwell-gphoto-helper.h} | 0
2 files changed, 4 insertions(+), 4 deletions(-)
rename vapi/{gphoto.h => shotwell-gphoto-helper.h} (100%)
diff --git a/vapi/libgphoto2.vapi b/vapi/libgphoto2.vapi
index adcef5c5..aeab7255 100644
--- a/vapi/libgphoto2.vapi
+++ b/vapi/libgphoto2.vapi
@@ -53,7 +53,7 @@ namespace GPhoto {
ref_function="GPHOTO_REF_CAMERA",
unref_function="gp_camera_unref",
free_function="gp_camera_free",
- cheader_filename="gphoto2/gphoto2-camera.h,gphoto2.h"
+ cheader_filename="gphoto2/gphoto2-camera.h,shotwell-gphoto-helper.h"
)]
public class Camera {
[CCode (cname="gp_camera_new")]
@@ -99,7 +99,7 @@ namespace GPhoto {
ref_function="GPHOTO_REF_FILE",
unref_function="gp_file_unref",
free_function="gp_file_free",
- cheader_filename="gphoto2/gphoto2-file.h,gphoto2.h"
+ cheader_filename="gphoto2/gphoto2-file.h,shotwell-gphoto-helper.h"
)]
public class CameraFile {
[CCode (cname="gp_file_new")]
@@ -252,7 +252,7 @@ namespace GPhoto {
ref_function="GPHOTO_REF_LIST",
unref_function="gp_list_unref",
free_function="gp_list_free",
- cheader_filename="gphoto2/gphoto2-list.h,gphoto2.h"
+ cheader_filename="gphoto2/gphoto2-list.h,shotwell-gphoto-helper.h"
)]
public class CameraList {
[CCode (cname="gp_list_new")]
@@ -324,7 +324,7 @@ namespace GPhoto {
[CCode (
ref_function="GPHOTO_REF_CONTEXT",
unref_function="gp_context_unref",
- cheader_filename="gphoto2/gphoto2-context.h,gphoto2.h"
+ cheader_filename="gphoto2/gphoto2-context.h,shotwell-gphoto-helper.h"
)]
public class Context {
[CCode (cname="gp_context_new")]
diff --git a/vapi/gphoto.h b/vapi/shotwell-gphoto-helper.h
similarity index 100%
rename from vapi/gphoto.h
rename to vapi/shotwell-gphoto-helper.h
--
2.31.1

View File

@ -1,67 +0,0 @@
From 59ae0ce648982669f24a33db501f3f229508cb6e Mon Sep 17 00:00:00 2001
From: Rico Tzschichholz <ricotz@ubuntu.com>
Date: Tue, 30 Nov 2021 15:09:17 +0100
Subject: [PATCH] Fix accessibility issues with initializer of constants
---
src/International.vala | 2 --
src/Resources.vala | 7 -------
vapi/version.vapi | 17 ++++++++++++++---
3 files changed, 14 insertions(+), 12 deletions(-)
diff --git a/src/International.vala b/src/International.vala
index 555a91f8..73f07639 100644
--- a/src/International.vala
+++ b/src/International.vala
@@ -4,8 +4,6 @@
* See the COPYING file in this distribution.
*/
-extern const string _LANG_SUPPORT_DIR;
-
public const string TRANSLATABLE = "translatable";
namespace InternationalSupport {
diff --git a/src/Resources.vala b/src/Resources.vala
index 6d2b8851..86f0eb65 100644
--- a/src/Resources.vala
+++ b/src/Resources.vala
@@ -4,13 +4,6 @@
* See the COPYING file in this distribution.
*/
-// defined by ./configure or Makefile and included by gcc -D
-extern const string _PREFIX;
-extern const string _VERSION;
-extern const string GETTEXT_PACKAGE;
-extern const string _LIB;
-extern const string _LIBEXECDIR;
-
namespace Resources {
public const string APP_TITLE = "Shotwell";
public const string APP_LIBRARY_ROLE = _("Photo Manager");
diff --git a/vapi/version.vapi b/vapi/version.vapi
index 06974c84..e191f2f7 100644
--- a/vapi/version.vapi
+++ b/vapi/version.vapi
@@ -1,3 +1,14 @@
-[CCode (cheader_filename="version.h")]
-extern const string? _GIT_VERSION;
-
+[CCode (cheader_filename = "version.h")]
+public const string? _GIT_VERSION;
+[CCode (cheader_filename = "config.h")]
+public const string _PREFIX;
+[CCode (cheader_filename = "config.h")]
+public const string _VERSION;
+[CCode (cheader_filename = "config.h")]
+public const string GETTEXT_PACKAGE;
+[CCode (cheader_filename = "config.h")]
+public const string _LIB;
+[CCode (cheader_filename = "config.h")]
+public const string _LIBEXECDIR;
+[CCode (cheader_filename = "config.h")]
+public const string _LANG_SUPPORT_DIR;
--
GitLab

View File

@ -1,14 +1,14 @@
# Template file for 'shotwell'
pkgname=shotwell
version=0.31.3
revision=2
version=0.31.5
revision=1
build_style=meson
hostmakedepends="gcr-devel gettext glib-devel itstool
libgee08-devel libgexiv2-devel pkg-config vala-devel"
makedepends="gst-plugins-base1-devel libgdata-devel
libgee08-devel libgexiv2-devel libgphoto2-devel libgudev-devel
libraw-devel libsecret-devel libchamplain-devel libwebp-devel
rest-devel vala-devel webkit2gtk-devel"
rest-devel vala-devel libwebkit2gtk41-devel libsoup3-devel"
depends="desktop-file-utils hicolor-icon-theme"
short_desc="Open source photo manager for GNOME"
maintainer="Enno Boland <gottox@voidlinux.org>"
@ -16,7 +16,7 @@ license="LGPL-2.1-or-later, CC-BY-SA-3.0"
homepage="https://wiki.gnome.org/Apps/Shotwell"
changelog="https://gitlab.gnome.org/GNOME/shotwell/-/raw/master/NEWS"
distfiles="${GNOME_SITE}/shotwell/${version%.*}/shotwell-${version}.tar.xz"
checksum=8de36f20488f4fb7d090194c8af46cd3661bcc81a3d65f980cb17667ed826af2
checksum=3b048fc6ce99b232d1e0ea9b8db074083c86c88d3b6d63136a2cf8217aa45c19
lib32disabled=yes
post_extract() {