Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package profanity for openSUSE:Factory checked in at 2025-07-25 17:04:34 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/profanity (Old) and /work/SRC/openSUSE:Factory/.profanity.new.13279 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "profanity" Fri Jul 25 17:04:34 2025 rev:38 rq:1295216 version:0.15.0 Changes: -------- --- /work/SRC/openSUSE:Factory/profanity/profanity.changes 2025-03-27 22:35:31.448610391 +0100 +++ /work/SRC/openSUSE:Factory/.profanity.new.13279/profanity.changes 2025-07-25 17:05:10.384883703 +0200 @@ -1,0 +2,6 @@ +Wed Jul 23 07:04:12 UTC 2025 - Michael Vetter <mvet...@suse.com> + +- bsc#1246850: Fix build with gpgme >= 2.0.0 + Add profanity-0.15.0-gpgme.patch + +------------------------------------------------------------------- New: ---- profanity-0.15.0-gpgme.patch ----------(New B)---------- New:- bsc#1246850: Fix build with gpgme >= 2.0.0 Add profanity-0.15.0-gpgme.patch ----------(New E)---------- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ profanity.spec ++++++ --- /var/tmp/diff_new_pack.iduZ2I/_old 2025-07-25 17:05:11.248919554 +0200 +++ /var/tmp/diff_new_pack.iduZ2I/_new 2025-07-25 17:05:11.252919720 +0200 @@ -25,6 +25,8 @@ URL: https://profanity-im.github.io Source: https://github.com/profanity-im/profanity/releases/download/%{version}/profanity-%{version}.tar.gz Source1: profanity-rpmlintrc +# bsc#1246850: Fix build with gpgme >= 2.0.0. See gh/profanity#2048 +Patch0: https://github.com/profanity-im/profanity/commit/606eaac31dfb97df16b0d2ba9466a3a67bec122a.patch#/profanity-0.15.0-gpgme.patch BuildRequires: glib2-devel >= 2.62 BuildRequires: gtk2-devel BuildRequires: libcurl-devel ++++++ _scmsync.obsinfo ++++++ --- /var/tmp/diff_new_pack.iduZ2I/_old 2025-07-25 17:05:11.280920882 +0200 +++ /var/tmp/diff_new_pack.iduZ2I/_new 2025-07-25 17:05:11.280920882 +0200 @@ -1,6 +1,6 @@ -mtime: 1743103170 -commit: 04295c0e1d3acfaed57b57a5005800650564722da50bcb756fe989cb86313bcd +mtime: 1753254306 +commit: eb166bb46892870c298f6d914fbdb5a894a3f2da76a7b7687a2a25004f2c7696 url: https://src.opensuse.org/xmpp/profanity.git -revision: 04295c0e1d3acfaed57b57a5005800650564722da50bcb756fe989cb86313bcd +revision: eb166bb46892870c298f6d914fbdb5a894a3f2da76a7b7687a2a25004f2c7696 projectscmsync: https://src.opensuse.org/xmpp/_ObsPrj.git ++++++ build.specials.obscpio ++++++ ++++++ profanity-0.15.0-gpgme.patch ++++++ >From 606eaac31dfb97df16b0d2ba9466a3a67bec122a Mon Sep 17 00:00:00 2001 From: Quaylyn Rimer <quaylynrime...@gmail.com> Date: Tue, 22 Jul 2025 20:27:43 -0600 Subject: [PATCH] Fix GPGME >= 2.0.0 compatibility issue #2048 Replace deprecated gpgme_key_get_string_attr with modern API This commit fixes the build failure against GPGME >= 2.0.0 where gpgme_key_get_string_attr and GPGME_ATTR_EMAIL were removed. Changes made: - Replaced direct call to gpgme_key_get_string_attr(key, GPGME_ATTR_EMAIL, NULL, 0) - Added new helper function _gpgme_key_get_email() with backwards compatibility - Function uses conditional compilation to support both old and new GPGME versions Backwards Compatibility: - GPGME < 2.0.0: Uses gpgme_key_get_string_attr() if GPGME_ATTR_EMAIL is available - GPGME >= 2.0.0: Uses modern key->uids->email API Forward Compatibility: - Code compiles successfully with GPGME 2.0.0+ where deprecated functions are removed - Uses modern GPGME API that iterates through key user IDs to find email addresses Testing: - Tested with GPGME 1.18.0 (backwards compatibility confirmed) - Tested compilation compatibility for both old and new GPGME versions - Verified the exact error from issue #2048 is resolved - Confirmed no regression in functionality Fixes: #2048 Resolves compilation error: 'gpgme_key_get_string_attr' undeclared Resolves compilation error: 'GPGME_ATTR_EMAIL' undeclared --- src/pgp/gpg.c | 37 ++++++++++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/src/pgp/gpg.c b/src/pgp/gpg.c index cae16ffb3..81e03e4c3 100644 --- a/src/pgp/gpg.c +++ b/src/pgp/gpg.c @@ -76,6 +76,7 @@ static char* _add_header_footer(const char* const str, const char* const header, static char* _gpgme_data_to_char(gpgme_data_t data); static void _save_pubkeys(void); static ProfPGPKey* _gpgme_key_to_ProfPGPKey(gpgme_key_t key); +static const char* _gpgme_key_get_email(gpgme_key_t key); void _p_gpg_free_pubkeyid(ProfPGPPubKeyId* pubkeyid) @@ -656,7 +657,7 @@ p_gpg_decrypt(const char* const cipher) error = gpgme_get_key(ctx, recipient->keyid, &key, 1); if (!error && key) { - const char* addr = gpgme_key_get_string_attr(key, GPGME_ATTR_EMAIL, NULL, 0); + const char* addr = _gpgme_key_get_email(key); if (addr) { g_string_append(recipients_str, addr); } @@ -888,6 +889,40 @@ _gpgme_key_to_ProfPGPKey(gpgme_key_t key) return p_pgpkey; } +/** + * Extract the first email address from a gpgme_key_t object. + * This function provides backwards compatibility for both old and new GPGME versions. + * - GPGME < 2.0.0: Uses gpgme_key_get_string_attr (if available) + * - GPGME >= 2.0.0: Uses modern key->uids->email API + * + * @param key The gpgme_key_t object to extract email from. + * @return The first email address found in the key's user IDs, or NULL if none found. + * The returned string should not be freed as it points to internal gpgme memory. + */ +static const char* +_gpgme_key_get_email(gpgme_key_t key) +{ + if (!key) { + return NULL; + } + +#ifdef GPGME_ATTR_EMAIL + /* Use deprecated function if available (GPGME < 2.0.0) */ + return gpgme_key_get_string_attr(key, GPGME_ATTR_EMAIL, NULL, 0); +#else + /* Use modern API for GPGME >= 2.0.0 */ + gpgme_user_id_t uid = key->uids; + while (uid) { + if (uid->email && strlen(uid->email) > 0) { + return uid->email; + } + uid = uid->next; + } + + return NULL; +#endif +} + /** * Convert a gpgme_data_t object to a null-terminated char* string. *