From 90ccdc38c4cadc3c2022db9b7bcb5dd194c1d29e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?= Date: Sat, 10 Jul 2021 22:34:53 +0700 Subject: [PATCH 1/2] libcryptui: port from libgnome-keyring to gcr-devel While we're at it, prepare for gnupg v2.2, and port another bug-fix. --- .../daemon-fix-conflict-return-type.patch | 34 ++++ .../patches/daemon-port-to-gcr-3.patch | 154 ++++++++++++++++++ ...flaw-in-the-prompt-recipients-dialog.patch | 37 +++++ .../patches/git_allow-gpg2-2.1.patch | 25 +++ srcpkgs/libcryptui/patches/musl-locale.patch | 12 ++ srcpkgs/libcryptui/template | 11 +- 6 files changed, 268 insertions(+), 5 deletions(-) create mode 100644 srcpkgs/libcryptui/patches/daemon-fix-conflict-return-type.patch create mode 100644 srcpkgs/libcryptui/patches/daemon-port-to-gcr-3.patch create mode 100644 srcpkgs/libcryptui/patches/fix-logic-flaw-in-the-prompt-recipients-dialog.patch create mode 100644 srcpkgs/libcryptui/patches/git_allow-gpg2-2.1.patch create mode 100644 srcpkgs/libcryptui/patches/musl-locale.patch diff --git a/srcpkgs/libcryptui/patches/daemon-fix-conflict-return-type.patch b/srcpkgs/libcryptui/patches/daemon-fix-conflict-return-type.patch new file mode 100644 index 000000000000..85ca92e87f2a --- /dev/null +++ b/srcpkgs/libcryptui/patches/daemon-fix-conflict-return-type.patch @@ -0,0 +1,34 @@ +From a576e407d913b35804f838d615da52899681d61d Mon Sep 17 00:00:00 2001 +From: Andreas Henriksson +Date: Mon, 15 Aug 2016 18:12:06 +0200 +Subject: [PATCH] daemon: fix conflicting return types + +... in functions seahorse_dbus_server_{init,cleanup} + +Reported-by: Michael Tautschnig +Bug-Debian: https://bugs.debian.org/749001 + +https://bugzilla.gnome.org/show_bug.cgi?id=769943 +--- + daemon/seahorse-daemon.h | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/daemon/seahorse-daemon.h b/daemon/seahorse-daemon.h +index 93c0c452..09716bb5 100644 +--- a/daemon/seahorse-daemon.h ++++ b/daemon/seahorse-daemon.h +@@ -24,9 +24,9 @@ + /* seahorse-dbus-server.c --------------------------------------------------- */ + + +-gboolean seahorse_dbus_server_init (); ++void seahorse_dbus_server_init (); + +-gboolean seahorse_dbus_server_cleanup (); ++void seahorse_dbus_server_cleanup (); + + DBusGConnection* seahorse_dbus_server_get_connection (); + +-- +GitLab + diff --git a/srcpkgs/libcryptui/patches/daemon-port-to-gcr-3.patch b/srcpkgs/libcryptui/patches/daemon-port-to-gcr-3.patch new file mode 100644 index 000000000000..a81f22c29a7d --- /dev/null +++ b/srcpkgs/libcryptui/patches/daemon-port-to-gcr-3.patch @@ -0,0 +1,154 @@ +From 728aceb6defd4e6e4f07fa49ca76f5e745230fee Mon Sep 17 00:00:00 2001 +From: Marc-Antoine Perennou +Date: Fri, 16 Sep 2016 11:46:55 +0200 +Subject: [PATCH] daemon: port to gcr-3 + +This removes the dependency on libgnome-keyring and adds a dependency +on libgcr instead. + +Signed-off-by: Marc-Antoine Perennou +Signed-off-by: Stef Walter + * Updated commit message + +https://bugzilla.gnome.org/show_bug.cgi?id=771522 +--- + configure.ac | 14 +++++++------- + daemon/seahorse-secure-buffer.c | 7 ++++--- + daemon/seahorse-secure-memory.c | 21 +++++++++++---------- + 3 files changed, 22 insertions(+), 20 deletions(-) + +diff --git a/configure.ac b/configure.ac +index b621b236..4486e7b2 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -252,18 +252,18 @@ if test "$enable_fatal_messages" = "yes" && test "$enable_debug" = "yes"; then + fi + + dnl **************************************************************************** +-dnl GNOME-KEYRING ++dnl GCR + dnl **************************************************************************** + +-PKG_CHECK_MODULES([GNOME_KEYRING], gnome-keyring-1 >= 2.25.5, +- [enable_gnome_keyring=yes],[enable_gnome_keyring=no]) ++PKG_CHECK_MODULES([GCR], gcr-3, ++ [enable_gcr=yes],[enable_gcr=no]) + +-if test "$enable_gnome_keyring" = "no"; then +- AC_MSG_ERROR([gnome-keyring library or headers not found.]) ++if test "$enable_gcr" = "no"; then ++ AC_MSG_ERROR([gcr library or headers not found.]) + fi + +-SEAHORSE_CFLAGS="$SEAHORSE_CFLAGS $GNOME_KEYRING_CFLAGS" +-SEAHORSE_LIBS="$SEAHORSE_LIBS $GNOME_KEYRING_LIBS" ++SEAHORSE_CFLAGS="$SEAHORSE_CFLAGS $GCR_CFLAGS" ++SEAHORSE_LIBS="$SEAHORSE_LIBS $GCR_LIBS" + + dnl **************************************************************************** + dnl LIBCRYPTUI +diff --git a/daemon/seahorse-secure-buffer.c b/daemon/seahorse-secure-buffer.c +index 0db87961..63f87cd3 100644 +--- a/daemon/seahorse-secure-buffer.c ++++ b/daemon/seahorse-secure-buffer.c +@@ -20,7 +20,8 @@ + #include "config.h" + + #include "seahorse-secure-buffer.h" +-#include ++#define GCR_API_SUBJECT_TO_CHANGE 1 ++#include + + #include + +@@ -92,7 +93,7 @@ seahorse_secure_buffer_real_insert_text (GtkEntryBuffer *buffer, guint position, + } + } + +- pv->text = gnome_keyring_memory_realloc (pv->text, pv->text_size); ++ pv->text = gcr_secure_memory_realloc (pv->text, pv->text_size); + } + + /* Actual text insertion */ +@@ -158,7 +159,7 @@ seahorse_secure_buffer_finalize (GObject *obj) + SeahorseSecureBufferPrivate *pv = self->priv; + + if (pv->text) { +- gnome_keyring_memory_free (pv->text); ++ gcr_secure_memory_free (pv->text); + pv->text = NULL; + pv->text_bytes = pv->text_size = 0; + pv->text_chars = 0; +diff --git a/daemon/seahorse-secure-memory.c b/daemon/seahorse-secure-memory.c +index 3d94a674..f201d1df 100644 +--- a/daemon/seahorse-secure-memory.c ++++ b/daemon/seahorse-secure-memory.c +@@ -23,7 +23,8 @@ + + #include + +-#include ++#define GCR_API_SUBJECT_TO_CHANGE 1 ++#include + + #include "seahorse-secure-memory.h" + +@@ -47,7 +48,7 @@ switch_malloc (gsize size) + if (size == 0) + return NULL; + if (seahorse_use_secure_mem) +- p = gnome_keyring_memory_try_alloc (size); ++ p = gcr_secure_memory_try_alloc (size); + else + p = malloc (size); + return p; +@@ -71,7 +72,7 @@ switch_calloc (gsize num, gsize size) + if (size == 0 || num == 0) + return NULL; + if (seahorse_use_secure_mem) +- p = gnome_keyring_memory_try_alloc (size * num); ++ p = gcr_secure_memory_try_alloc (size * num); + else + p = calloc (num, size); + return p; +@@ -99,11 +100,11 @@ switch_realloc (gpointer mem, gsize size) + + if (!mem) { + if (seahorse_use_secure_mem) +- p = gnome_keyring_memory_alloc (size); ++ p = gcr_secure_memory_alloc (size); + else + p = malloc (size); +- } else if (gnome_keyring_memory_is_secure (mem)) +- p = gnome_keyring_memory_try_realloc (mem, size); ++ } else if (gcr_secure_memory_is_secure (mem)) ++ p = gcr_secure_memory_try_realloc (mem, size); + else + p = realloc (mem, size); + return p; +@@ -120,8 +121,8 @@ static void + switch_free (gpointer mem) + { + if (mem) { +- if (gnome_keyring_memory_is_secure (mem)) +- gnome_keyring_memory_free (mem); ++ if (gcr_secure_memory_is_secure (mem)) ++ gcr_secure_memory_free (mem); + else + free (mem); + } +@@ -138,9 +139,9 @@ seahorse_try_gk_secure_memory () + { + gpointer p; + +- p = gnome_keyring_memory_try_alloc (10); ++ p = gcr_secure_memory_try_alloc (10); + if (p != NULL) { +- gnome_keyring_memory_free (p); ++ gcr_secure_memory_free (p); + return TRUE; + } + +-- +GitLab + diff --git a/srcpkgs/libcryptui/patches/fix-logic-flaw-in-the-prompt-recipients-dialog.patch b/srcpkgs/libcryptui/patches/fix-logic-flaw-in-the-prompt-recipients-dialog.patch new file mode 100644 index 000000000000..0f9bda0fd4aa --- /dev/null +++ b/srcpkgs/libcryptui/patches/fix-logic-flaw-in-the-prompt-recipients-dialog.patch @@ -0,0 +1,37 @@ +From 7c805b5d4eca798a03ac56b40e53cb335e30c187 Mon Sep 17 00:00:00 2001 +From: Vlad Orlov +Date: Mon, 15 Aug 2016 18:23:31 +0200 +Subject: [PATCH] libcryptui: fix logic flaw in the prompt recipients dialog + +The prompt recipients dialog has been broken in commit +https://github.com/GNOME/libcryptui/commit/cd74aa6bf810a5ce0935d2ec89d6db64dbbde24d#diff-f0ea8a1eef5386b0149314d2a1743e85L202 + +The patch fixes the logic there and makes seahorse-tool's +encrypt command work again. Therefore, seahorse plugins for both +Nautilus and Nemo should start working as well. + +Bug-Debian: https://bugs.debian.org/770436 + +https://bugzilla.gnome.org/show_bug.cgi?id=769944 + +Reviewed-by: Stef Walter +--- + libcryptui/cryptui.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/libcryptui/cryptui.c b/libcryptui/cryptui.c +index 92f0d5d4..2bbfa409 100644 +--- a/libcryptui/cryptui.c ++++ b/libcryptui/cryptui.c +@@ -211,7 +211,7 @@ cryptui_prompt_recipients_with_symmetric (CryptUIKeyset *keyset, + *symmetric = cryptui_key_chooser_get_symmetric (chooser); + } + +- if (symmetric != NULL && !*symmetric) { ++ if (symmetric == NULL || *symmetric == FALSE) { + recipients = cryptui_key_chooser_get_recipients (chooser); + keys = g_new0(gchar*, g_list_length (recipients) + 1); + for (l = recipients, i = 0; l; l = g_list_next (l), i++) +-- +GitLab + diff --git a/srcpkgs/libcryptui/patches/git_allow-gpg2-2.1.patch b/srcpkgs/libcryptui/patches/git_allow-gpg2-2.1.patch new file mode 100644 index 000000000000..ab840a258740 --- /dev/null +++ b/srcpkgs/libcryptui/patches/git_allow-gpg2-2.1.patch @@ -0,0 +1,25 @@ +From 183d7619c29482a5d4ae8019692899f87f198171 Mon Sep 17 00:00:00 2001 +From: Antoine Jacoutot +Date: Sat, 17 Oct 2015 08:52:35 +0200 +Subject: Allow building with gnupg 2.1. + +--- + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/configure.ac b/configure.ac +index 406b9f3..b621b23 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -95,7 +95,7 @@ AC_ARG_ENABLE(gpg-check, + DO_CHECK=$enableval, DO_CHECK=yes) + + if test "$DO_CHECK" = "yes"; then +- accepted_versions="1.2 1.4 2.0" ++ accepted_versions="1.2 1.4 2.0 2.1 2.2" + AC_PATH_PROGS(GNUPG, [gpg gpg2], no) + AC_DEFINE_UNQUOTED(GNUPG, "$GNUPG", [Path to gpg executable.]) + ok="no" +-- +cgit v0.12 + diff --git a/srcpkgs/libcryptui/patches/musl-locale.patch b/srcpkgs/libcryptui/patches/musl-locale.patch new file mode 100644 index 000000000000..ce1f5f8bfef2 --- /dev/null +++ b/srcpkgs/libcryptui/patches/musl-locale.patch @@ -0,0 +1,12 @@ +Index: libcryptui-3.12.2/configure.ac +=================================================================== +--- libcryptui-3.12.2.orig/configure.ac ++++ libcryptui-3.12.2/configure.ac +@@ -322,6 +322,7 @@ AC_SUBST(GETTEXT_PACKAGE) + AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [Name of the gettext domain.]) + + AM_GLIB_GNU_GETTEXT ++DATADIRNAME=share + + dnl **************************************************************************** + ## here we get the flags we'll actually use diff --git a/srcpkgs/libcryptui/template b/srcpkgs/libcryptui/template index a0bfef4a32c8..b1bbeee440ca 100644 --- a/srcpkgs/libcryptui/template +++ b/srcpkgs/libcryptui/template @@ -1,16 +1,17 @@ # Template file for 'libcryptui' pkgname=libcryptui version=3.12.2 -revision=3 +revision=4 build_style=gnu-configure build_helper="gir" configure_args="--disable-static --disable-update-mime-database --disable-schemas-compile $(vopt_enable gir introspection)" hostmakedepends="pkg-config intltool dbus-glib-devel glib gnupg + automake libtool gettext-devel-tools glib-devel $(vopt_if gir gobject-introspection)" makedepends="libSM-devel dbus-glib-devel gtk+3-devel gpgme-devel - libnotify-devel libgnome-keyring-devel" -depends="hicolor-icon-theme libgnome-keyring>=3.10 gnupg" + libnotify-devel gcr-devel" +depends="hicolor-icon-theme gnupg" short_desc="GNOME Interface components for OpenPGP" maintainer="Orphaned " license="GPL-2.0-or-later, LGPL-2.0-or-later" @@ -22,8 +23,8 @@ checksum=71ead1a7b496f07f6c5102ae79945dd2515b7b9342c6edefe58b47318be20866 build_options="gir" build_options_default="gir" -post_patch() { - vsed -i -e 's/DATADIRNAME=lib/DATADIRNAME=share/' configure +pre_configure() { + autoreconf -fi } libcryptui-devel_package() { From e16bedc401daac8505039c2ff4227f97dd5f5454 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?= Date: Sat, 10 Jul 2021 23:43:50 +0700 Subject: [PATCH 2/2] seahorse-nautilus: fix desktop files While we're at it, prepare for upgrading gnupg to v2 --- .../patches/fix-desktop-files.patch | 56 +++++++++++++++++++ .../seahorse-nautilus/patches/locale.patch | 25 ++++----- .../seahorse-nautilus/patches/new-gnupg.patch | 13 +++++ .../patches/remove-unused-gnome-keyring.patch | 18 ++++++ srcpkgs/seahorse-nautilus/template | 9 ++- 5 files changed, 105 insertions(+), 16 deletions(-) create mode 100644 srcpkgs/seahorse-nautilus/patches/fix-desktop-files.patch create mode 100644 srcpkgs/seahorse-nautilus/patches/new-gnupg.patch create mode 100644 srcpkgs/seahorse-nautilus/patches/remove-unused-gnome-keyring.patch diff --git a/srcpkgs/seahorse-nautilus/patches/fix-desktop-files.patch b/srcpkgs/seahorse-nautilus/patches/fix-desktop-files.patch new file mode 100644 index 000000000000..89c2313aa986 --- /dev/null +++ b/srcpkgs/seahorse-nautilus/patches/fix-desktop-files.patch @@ -0,0 +1,56 @@ +From: Carlos Maddela +Date: Sun, 8 Jan 2017 23:27:27 +1100 +Subject: Fix desktop files to use valid field code with Exec key. + +Description: Fix desktop files to use valid field code with Exec key. +Author: Carlos Maddela +Origin: vendor +Forwarded: https://bugzilla.gnome.org/show_bug.cgi?id=790254 +Last-Update: 2017-11-12 +--- +This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ +--- + tool/seahorse-pgp-encrypted.desktop.in.in | 2 +- + tool/seahorse-pgp-keys.desktop.in.in | 2 +- + tool/seahorse-pgp-signature.desktop.in.in | 2 +- + 3 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/tool/seahorse-pgp-encrypted.desktop.in.in b/tool/seahorse-pgp-encrypted.desktop.in.in +index 2d631e8..0897aa0 100644 +--- a/tool/seahorse-pgp-encrypted.desktop.in.in ++++ b/tool/seahorse-pgp-encrypted.desktop.in.in +@@ -1,7 +1,7 @@ + [Desktop Entry] + _Name=Decrypt File + MimeType=application/pgp-encrypted; +-Exec=seahorse-tool --decrypt ++Exec=seahorse-tool --decrypt %U + Type=Application + Terminal=false + NoDisplay=true +diff --git a/tool/seahorse-pgp-keys.desktop.in.in b/tool/seahorse-pgp-keys.desktop.in.in +index 36cb153..5b4bd73 100644 +--- a/tool/seahorse-pgp-keys.desktop.in.in ++++ b/tool/seahorse-pgp-keys.desktop.in.in +@@ -1,7 +1,7 @@ + [Desktop Entry] + _Name=Import Key + MimeType=application/pgp-keys; +-Exec=seahorse-tool --import ++Exec=seahorse-tool --import %U + Type=Application + Terminal=false + NoDisplay=true +diff --git a/tool/seahorse-pgp-signature.desktop.in.in b/tool/seahorse-pgp-signature.desktop.in.in +index 00b9562..77820f7 100644 +--- a/tool/seahorse-pgp-signature.desktop.in.in ++++ b/tool/seahorse-pgp-signature.desktop.in.in +@@ -1,7 +1,7 @@ + [Desktop Entry] + _Name=Verify Signature + MimeType=application/pgp-signature; +-Exec=seahorse-tool --verify ++Exec=seahorse-tool --verify %U + Type=Application + Terminal=false + NoDisplay=true diff --git a/srcpkgs/seahorse-nautilus/patches/locale.patch b/srcpkgs/seahorse-nautilus/patches/locale.patch index bae173b0614b..06867e0432e0 100644 --- a/srcpkgs/seahorse-nautilus/patches/locale.patch +++ b/srcpkgs/seahorse-nautilus/patches/locale.patch @@ -1,15 +1,12 @@ -Index: configure +Index: seahorse-nautilus-3.10.1/configure.ac =================================================================== ---- a/configure -+++ b/configure -@@ -14606,8 +14606,8 @@ fi - DATADIRNAME=share - ;; - *) -- CATOBJEXT=.mo -- DATADIRNAME=lib -+ CATOBJEXT=.gmo -+ DATADIRNAME=share - ;; - esac - fi +--- seahorse-nautilus-3.10.1.orig/configure.ac ++++ seahorse-nautilus-3.10.1/configure.ac +@@ -41,6 +41,7 @@ AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GE + + GLIB_GSETTINGS + AM_GLIB_GNU_GETTEXT ++DATADIRNAME=share + + PKG_CHECK_MODULES(GTK, gtk+-3.0 >= 3.0 gio-2.0) + diff --git a/srcpkgs/seahorse-nautilus/patches/new-gnupg.patch b/srcpkgs/seahorse-nautilus/patches/new-gnupg.patch new file mode 100644 index 000000000000..7cdbdbf84d1f --- /dev/null +++ b/srcpkgs/seahorse-nautilus/patches/new-gnupg.patch @@ -0,0 +1,13 @@ +Index: seahorse-nautilus-3.10.1/configure.ac +=================================================================== +--- seahorse-nautilus-3.10.1.orig/configure.ac ++++ seahorse-nautilus-3.10.1/configure.ac +@@ -58,7 +58,7 @@ AC_ARG_ENABLE(gpg-check, + DO_CHECK=$enableval, DO_CHECK=yes) + + if test "$DO_CHECK" = "yes"; then +- accepted_versions="1.2 1.4 2.0" ++ accepted_versions="1.2 1.4 2.0 2.1 2.2" + AC_PATH_PROGS(GNUPG, [gpg gpg2], no) + ok="no" + if test "$GNUPG" != "no"; then diff --git a/srcpkgs/seahorse-nautilus/patches/remove-unused-gnome-keyring.patch b/srcpkgs/seahorse-nautilus/patches/remove-unused-gnome-keyring.patch new file mode 100644 index 000000000000..befc0d669eca --- /dev/null +++ b/srcpkgs/seahorse-nautilus/patches/remove-unused-gnome-keyring.patch @@ -0,0 +1,18 @@ +Index: seahorse-nautilus-3.10.1/configure.ac +=================================================================== +--- seahorse-nautilus-3.10.1.orig/configure.ac ++++ seahorse-nautilus-3.10.1/configure.ac +@@ -148,13 +148,6 @@ fi + AC_SUBST(NAUTILUS_EXTENSION_DIR) + + # ----------------------------------------------------------------------------- +-# Keyring +- +-PKG_CHECK_MODULES([GNOME_KEYRING], [gnome-keyring-1]) +-SEAHORSE_CFLAGS="$SEAHORSE_CFLAGS $GNOME_KEYRING_CFLAGS" +-SEAHORSE_LIBS="$SEAHORSE_LIBS $GNOME_KEYRING_LIBS" +- +-# ----------------------------------------------------------------------------- + # DBus + + DBUS_GLIB_REQUIRED=0.35 diff --git a/srcpkgs/seahorse-nautilus/template b/srcpkgs/seahorse-nautilus/template index 04424cc4acdb..d80a1258aeae 100644 --- a/srcpkgs/seahorse-nautilus/template +++ b/srcpkgs/seahorse-nautilus/template @@ -1,10 +1,11 @@ # Template file for 'seahorse-nautilus' pkgname=seahorse-nautilus version=3.10.1 -revision=5 +revision=6 build_style=gnu-configure configure_args="--disable-schemas-compile" -hostmakedepends="pkg-config intltool gpgme-devel gnupg glib" +hostmakedepends="automake libtool pkg-config intltool gpgme-devel gnupg + glib-devel gettext-devel-tools" makedepends="gtk+3-devel nautilus-devel libnotify-devel gpgme-devel libcryptui-devel gcr-devel libgnome-keyring-devel" depends="gnupg desktop-file-utils" @@ -15,3 +16,7 @@ homepage="http://www.gnome.org/projects/seahorse/" distfiles="${GNOME_SITE}/seahorse-nautilus/${version%.*}/seahorse-nautilus-${version}.tar.xz" checksum=eacaf33bba920cf117641393a6eef483dbc075009349082e77d22f79afbd823a lib32disabled=yes + +pre_configure() { + autoreconf -fi +}