Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-crypt/seahorse/, app-crypt/seahorse/files/
Date: Wed, 01 Mar 2023 05:11:31
Message-Id: 1677647475.53225c643c193984d24283eb9050fe176cd2f101.sam@gentoo
1 commit: 53225c643c193984d24283eb9050fe176cd2f101
2 Author: Sam James <sam <AT> gentoo <DOT> org>
3 AuthorDate: Wed Mar 1 05:03:22 2023 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Wed Mar 1 05:11:15 2023 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=53225c64
7
8 app-crypt/seahorse: fix musl build
9
10 New revision given it affects Vala-generated code and I'd rather
11 be conservative.
12
13 Signed-off-by: Sam James <sam <AT> gentoo.org>
14
15 .../seahorse/files/seahorse-43.0-musl-stdout.patch | 85 ++++++++++++++++++++++
16 app-crypt/seahorse/seahorse-43.0-r1.ebuild | 83 +++++++++++++++++++++
17 2 files changed, 168 insertions(+)
18
19 diff --git a/app-crypt/seahorse/files/seahorse-43.0-musl-stdout.patch b/app-crypt/seahorse/files/seahorse-43.0-musl-stdout.patch
20 new file mode 100644
21 index 000000000000..2a6873134e27
22 --- /dev/null
23 +++ b/app-crypt/seahorse/files/seahorse-43.0-musl-stdout.patch
24 @@ -0,0 +1,85 @@
25 +https://gitlab.gnome.org/GNOME/seahorse/-/commit/6d673637d90066f4756568ce1b2f1f3c89a37c74
26 +
27 +From 6d673637d90066f4756568ce1b2f1f3c89a37c74 Mon Sep 17 00:00:00 2001
28 +From: =?UTF-8?q?Pablo=20Correa=20G=C3=B3mez?= <ablocorrea@×××××××.com>
29 +Date: Thu, 20 Oct 2022 18:35:33 +0200
30 +Subject: [PATCH] ssh: avoid stdout and stderr variable names
31 +
32 +In Alpine Linux, the compiler:
33 +
34 +C compiler for the host machine: gcc (gcc 12.2.1 "gcc (Alpine 12.2.1_git20220924-r3) 12.2.1 20220924")
35 +C linker for the host machine: gcc ld.bfd 2.39
36 +Vala compiler for the host machine: valac (valac 0.56.3)
37 +
38 +ended up including stdio.h into the C code generated from Vala.
39 +This produced the following (and similar) errors due to
40 +stderr and stdout being #define in stdio.h:
41 +
42 +ninja: job failed: gcc -Issh/libseahorse-ssh.a.p -Issh -I../ssh -Icommon -I../common -I. -I.. -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/gio-unix-2.0 -I/usr/include/gcr-3 -I/usr/include/gck-1 -I/usr/include/p11-kit-1 -I/usr/include/gtk-3.0 -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/fribidi -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libdrm -I/usr/include/atk-1.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include -I/usr/include/libhandy-1 -flto=auto -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -w -O0 -DGCR_API_SUBJECT_TO_CHANGE -DGCK_API_SUBJECT_TO_CHANGE -DSECRET_WITH_UNSTABLE -include config.h -Wno-unused-parameter -Wno-missing-field-initializers -Os -fomit-frame-pointer -Os -fomit-frame-pointer -fPIC -pthread -MD -MQ ssh/libseahorse-ssh.
43 a.p/meson-generated_operation.c.o -MF ssh/libseahorse-ssh.a.p/meson-generated_operation.c.o.d -o ssh/libseahorse-ssh.a.p/meson-generated_operation.c.o -c ssh/libseahorse-ssh.a.p/operation.c
44 +In file included from /usr/include/fortify/stdio.h:22,
45 + from /usr/include/pango-1.0/pango/pango-utils.h:25,
46 + from /usr/include/pango-1.0/pango/pango.h:51,
47 + from /usr/include/gtk-3.0/gdk/gdktypes.h:35,
48 + from /usr/include/gtk-3.0/gdk/gdkapplaunchcontext.h:30,
49 + from /usr/include/gtk-3.0/gdk/gdk.h:32,
50 + from /usr/include/gtk-3.0/gtk/gtk.h:30,
51 + from common/seahorse-common.h:11,
52 + from ssh/seahorse-ssh.h:6,
53 + from ssh/libseahorse-ssh.a.p/operation.c:25:
54 +ssh/libseahorse-ssh.a.p/operation.c: In function 'seahorse_ssh_operation_operation_async_co':
55 +ssh/libseahorse-ssh.a.p/operation.c:621:17: error: expected identifier before '(' token
56 + 621 | _data_->stdout = NULL;
57 + | ^~~~~~
58 +ssh/libseahorse-ssh.a.p/operation.c:622:17: error: expected identifier before '(' token
59 + 622 | _data_->stderr = NULL;
60 + | ^~~~~~
61 +
62 +Fix the problem by naming the variables std_out and std_err, as it
63 +was before commit e60e5fd4b1545053e99758b894e8ef981de08c3e
64 +
65 +Fixes e60e5fd4b1545053e99758b894e8ef981de08c3e
66 +
67 +Coauthored-by: psykose <alice@×××××.dev>
68 +--- a/ssh/operation.vala
69 ++++ b/ssh/operation.vala
70 +@@ -84,12 +84,12 @@ public abstract class Operation : GLib.Object {
71 +
72 + // And off we go to run the program
73 + var subprocess = launcher.spawnv(args);
74 +- string? stdout = null, stderr = null;
75 ++ string? std_out = null, std_err = null;
76 + try {
77 +- yield subprocess.communicate_utf8_async(input, cancellable, out stdout, out stderr);
78 +- return stdout;
79 ++ yield subprocess.communicate_utf8_async(input, cancellable, out std_out, out std_err);
80 ++ return std_out;
81 + } catch (GLib.Error e) {
82 +- Seahorse.Util.show_error(null, this.prompt_title, stderr);
83 ++ Seahorse.Util.show_error(null, this.prompt_title, std_err);
84 + throw e;
85 + }
86 + }
87 +@@ -221,10 +221,10 @@ public class PrivateImportOperation : Operation {
88 +
89 + // Start command to generate public key
90 + string cmd = "%s -y -f '%s'".printf(Config.SSH_KEYGEN_PATH, file);
91 +- string stdout = yield operation_async(cmd, null, cancellable);
92 ++ string std_out = yield operation_async(cmd, null, cancellable);
93 +
94 + // We'll build the key string from the output
95 +- var key_str = new StringBuilder(stdout);
96 ++ var key_str = new StringBuilder(std_out);
97 +
98 + // Only use the first line of the output
99 + int pos = int.max(key_str.str.index_of_char('\n'), key_str.str.index_of_char('\r'));
100 +@@ -232,7 +232,7 @@ public class PrivateImportOperation : Operation {
101 + key_str.erase(pos);
102 +
103 + // Parse the data so we can get the fingerprint
104 +- KeyData? keydata = KeyData.parse_line(stdout);
105 ++ KeyData? keydata = KeyData.parse_line(std_out);
106 +
107 + // Add the comment to the output
108 + if (data.comment != null) {
109 +--
110 +GitLab
111
112 diff --git a/app-crypt/seahorse/seahorse-43.0-r1.ebuild b/app-crypt/seahorse/seahorse-43.0-r1.ebuild
113 new file mode 100644
114 index 000000000000..5ddc7732673b
115 --- /dev/null
116 +++ b/app-crypt/seahorse/seahorse-43.0-r1.ebuild
117 @@ -0,0 +1,83 @@
118 +# Copyright 1999-2023 Gentoo Authors
119 +# Distributed under the terms of the GNU General Public License v2
120 +
121 +EAPI=8
122 +PYTHON_COMPAT=( python3_{9..11} )
123 +inherit gnome.org gnome2-utils meson python-any-r1 vala xdg
124 +
125 +DESCRIPTION="Manage your passwords and encryption keys"
126 +HOMEPAGE="https://wiki.gnome.org/Apps/Seahorse"
127 +
128 +LICENSE="GPL-2+ FDL-1.1+"
129 +SLOT="0"
130 +IUSE="ldap zeroconf"
131 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~ia64 ~ppc ~ppc64 ~riscv ~sparc ~x86"
132 +
133 +RDEPEND="
134 + >=dev-libs/glib-2.66:2
135 + >=app-crypt/gcr-3.38:0=
136 + >=app-crypt/gpgme-1.14.0:=
137 + >=x11-libs/gtk+-3.24.0:3
138 + >=app-crypt/gnupg-2.2
139 + >=gui-libs/libhandy-1.6.0:1
140 + >=app-crypt/libsecret-0.16
141 + dev-libs/libpwquality
142 + net-misc/openssh
143 + ldap? ( net-nds/openldap:= )
144 + net-libs/libsoup:3.0
145 + zeroconf? ( >=net-dns/avahi-0.6[dbus] )
146 +"
147 +DEPEND="${RDEPEND}
148 + $(vala_depend)
149 + dev-libs/libxml2:2
150 + app-crypt/gcr:0[vala]
151 + app-crypt/libsecret[vala]
152 + gui-libs/libhandy:1[vala]
153 +"
154 +BDEPEND="
155 + ${PYTHON_DEPS}
156 + app-text/docbook-xml-dtd:4.2
157 + app-text/docbook-xsl-stylesheets
158 + dev-libs/appstream-glib
159 + dev-libs/libxslt
160 + dev-util/gdbus-codegen
161 + dev-util/glib-utils
162 + dev-util/itstool
163 + >=sys-devel/gettext-0.19.8
164 + virtual/pkgconfig
165 +"
166 +
167 +PATCHES=(
168 + "${FILESDIR}"/${P}-gnupg-2.4.patch
169 +)
170 +
171 +src_prepare() {
172 + default
173 + vala_setup
174 + gnome2_environment_reset
175 +}
176 +
177 +src_configure() {
178 + local emesonargs=(
179 + -Dhelp=true
180 + -Dpgp-support=true
181 + -Dcheck-compatible-gpg=false # keep lowest version listed as compatible as min dep for gnupg RDEPEND
182 + -Dpkcs11-support=true
183 + -Dkeyservers-support=true
184 + -Dhkp-support=true
185 + $(meson_use ldap ldap-support)
186 + $(meson_use zeroconf key-sharing)
187 + -Dmanpage=true
188 + )
189 + meson_src_configure
190 +}
191 +
192 +pkg_postinst() {
193 + xdg_pkg_postinst
194 + gnome2_schemas_update
195 +}
196 +
197 +pkg_postrm() {
198 + xdg_pkg_postrm
199 + gnome2_schemas_update
200 +}