Gentoo Archives: gentoo-commits

From: Quentin Retornaz <gentoo@××××××××.com>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/proj/libressl:master commit in: www-client/netsurf/files/, www-client/netsurf/
Date: Mon, 09 May 2022 18:37:23
Message-Id: 1652121302.40d19fcb0752ceae57a1fb8e5f802e05ee915b8a.quentin@gentoo
1 commit: 40d19fcb0752ceae57a1fb8e5f802e05ee915b8a
2 Author: Mike Skec <skec <AT> protonmail <DOT> ch>
3 AuthorDate: Sun May 8 01:11:01 2022 +0000
4 Commit: Quentin Retornaz <gentoo <AT> retornaz <DOT> com>
5 CommitDate: Mon May 9 18:35:02 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/proj/libressl.git/commit/?id=40d19fcb
7
8 www-client/netsurf: added package
9
10 Uses patches from OpenBSD ports for LibreSSL 3.5+ support.
11 Signed-off-by: Mike Skec <skec <AT> protonmail.ch>
12 Closes: https://github.com/gentoo/libressl/pull/406
13 Signed-off-by: Quentin Retornaz <gentoo <AT> retornaz.com>
14
15 www-client/netsurf/Manifest | 1 +
16 .../files/netsurf-3.10-disable-failing-tests.patch | 42 ++++++
17 .../files/netsurf-3.10-gcc10-fno-common.patch | 23 ++++
18 ...rf-3.10-julia-libutf8proc-header-location.patch | 34 +++++
19 .../netsurf/files/netsurf-3.10-libressl-3.5.patch | 42 ++++++
20 ...f-3.9-conditionally-include-image-headers.patch | 35 +++++
21 www-client/netsurf/metadata.xml | 40 ++++++
22 www-client/netsurf/netsurf-3.10-r6.ebuild | 153 +++++++++++++++++++++
23 8 files changed, 370 insertions(+)
24
25 diff --git a/www-client/netsurf/Manifest b/www-client/netsurf/Manifest
26 new file mode 100644
27 index 0000000..974348b
28 --- /dev/null
29 +++ b/www-client/netsurf/Manifest
30 @@ -0,0 +1 @@
31 +DIST netsurf-3.10-src.tar.gz 4084480 BLAKE2B 267ce1811cbf11d053f721e22b8a6d484e796102a4c9baaa10580d92cc1eecfe3f126fb97456262675c962ec88a5235e48dc85f2a5168631f6c9dd5b5082b43b SHA512 1b1153916438e08146271dc04200aefbdba3b2c4ca9432a43abfc3811b5418df7ed21bbd91767f12d04331a236227379d2c412fcf13f25349685a549723bf13d
32
33 diff --git a/www-client/netsurf/files/netsurf-3.10-disable-failing-tests.patch b/www-client/netsurf/files/netsurf-3.10-disable-failing-tests.patch
34 new file mode 100644
35 index 0000000..6ffcec0
36 --- /dev/null
37 +++ b/www-client/netsurf/files/netsurf-3.10-disable-failing-tests.patch
38 @@ -0,0 +1,42 @@
39 +From 4c3d6b10802b6747ba36b6e7c988f6b584352358 Mon Sep 17 00:00:00 2001
40 +From: Michael Orlitzky <michael@××××××××.com>
41 +Date: Wed, 17 Jun 2020 17:42:34 -0400
42 +Subject: [PATCH 1/1] test: disable failing tests.
43 +
44 +Just cut them right out of the Makefile if they ain't gonna work.
45 +
46 +Bug: https://bugs.gentoo.org/687378
47 +Upstream-bug: https://bugs.netsurf-browser.org/mantis/view.php?id=2779
48 +---
49 + test/Makefile | 8 --------
50 + 1 file changed, 8 deletions(-)
51 +
52 +diff --git a/test/Makefile b/test/Makefile
53 +index 82ffee6..952d238 100644
54 +--- a/test/Makefile
55 ++++ b/test/Makefile
56 +@@ -5,8 +5,6 @@ TESTS := \
57 + nsurl \
58 + urldbtest \
59 + nsoption \
60 +- bloom \
61 +- hashtable \
62 + hashmap \
63 + urlescape \
64 + utils \
65 +@@ -47,12 +45,6 @@ messages_SRCS := utils/messages.c utils/hashtable.c test/log.c test/messages.c
66 + # nsoption test sources
67 + nsoption_SRCS := utils/nsoption.c test/log.c test/nsoption.c
68 +
69 +-# Bloom filter test sources
70 +-bloom_SRCS := utils/bloom.c test/bloom.c
71 +-
72 +-# hash table test sources
73 +-hashtable_SRCS := utils/hashtable.c test/log.c test/hashtable.c
74 +-
75 + # hashmap test sources
76 + hashmap_SRCS := $(NSURL_SOURCES) utils/hashmap.c utils/corestrings.c test/log.c test/hashmap.c
77 + hashmap_LD := -lmalloc_fig
78 +--
79 +2.26.2
80 +
81
82 diff --git a/www-client/netsurf/files/netsurf-3.10-gcc10-fno-common.patch b/www-client/netsurf/files/netsurf-3.10-gcc10-fno-common.patch
83 new file mode 100644
84 index 0000000..677004c
85 --- /dev/null
86 +++ b/www-client/netsurf/files/netsurf-3.10-gcc10-fno-common.patch
87 @@ -0,0 +1,23 @@
88 +Backport of upstream fix: https://git.netsurf-browser.org/netsurf.git/commit/?id=434f6c3fe7d1d2c6a3e6ae6338608a4a4421ab1b
89 +
90 +https://bugs.netsurf-browser.org/mantis/view.php?id=2778
91 +https://bugs.gentoo.org/835379
92 +--- a/frontends/framebuffer/convert_font.c
93 ++++ b/frontends/framebuffer/convert_font.c
94 +@@ -290,14 +290,14 @@ bool generate_font_header(const char *path, struct font_data *data)
95 +
96 +
97 + for (s = 0; s < 4; s++) {
98 +- fprintf(fp, "const uint8_t *%s_section_table;\n",
99 ++ fprintf(fp, "extern const uint8_t *%s_section_table;\n",
100 + var_lables[s]);
101 +- fprintf(fp, "const uint16_t *%s_sections;\n",
102 ++ fprintf(fp, "extern const uint16_t *%s_sections;\n",
103 + var_lables[s]);
104 +
105 + }
106 +
107 +- fprintf(fp, "const uint8_t *font_glyph_data;\n");
108 ++ fprintf(fp, "extern const uint8_t *font_glyph_data;\n");
109 +
110 + fprintf(fp, "\n\n");
111
112 diff --git a/www-client/netsurf/files/netsurf-3.10-julia-libutf8proc-header-location.patch b/www-client/netsurf/files/netsurf-3.10-julia-libutf8proc-header-location.patch
113 new file mode 100644
114 index 0000000..3a6ccc2
115 --- /dev/null
116 +++ b/www-client/netsurf/files/netsurf-3.10-julia-libutf8proc-header-location.patch
117 @@ -0,0 +1,34 @@
118 +From d585a1573819306bb3660db3f13a85b2fd254c63 Mon Sep 17 00:00:00 2001
119 +From: Michael Orlitzky <michael@××××××××.com>
120 +Date: Wed, 17 Jun 2020 17:23:10 -0400
121 +Subject: [PATCH 1/1] utils/idna.c: adjust utf8proc.h header location.
122 +
123 +There are two upstreams for libutf8proc, and they each put utf8proc.h
124 +in a different location -- ostensibly as a performance art piece
125 +intended to remind the programmer that we as human beings are all
126 +slowly dying, and that our limited time here on earth should not be
127 +wasted. This commit switches the header location from the netsurf-
128 +upstream one that used to work, to the julia-upstream location that
129 +works now (that the Gentoo package follows the julia upstream).
130 +
131 +Bug: https://bugs.gentoo.org/721318
132 +---
133 + utils/idna.c | 2 +-
134 + 1 file changed, 1 insertion(+), 1 deletion(-)
135 +
136 +diff --git a/utils/idna.c b/utils/idna.c
137 +index 628ef1f..f6e498a 100644
138 +--- a/utils/idna.c
139 ++++ b/utils/idna.c
140 +@@ -167,7 +167,7 @@ idna__ace_to_ucs4(const char *ace_label,
141 +
142 + #ifdef WITH_UTF8PROC
143 +
144 +-#include <libutf8proc/utf8proc.h>
145 ++#include <utf8proc.h>
146 +
147 + int32_t idna_contexto[] = {
148 + /* CONTEXTO codepoints which have a rule defined */
149 +--
150 +2.26.2
151 +
152
153 diff --git a/www-client/netsurf/files/netsurf-3.10-libressl-3.5.patch b/www-client/netsurf/files/netsurf-3.10-libressl-3.5.patch
154 new file mode 100644
155 index 0000000..d9add88
156 --- /dev/null
157 +++ b/www-client/netsurf/files/netsurf-3.10-libressl-3.5.patch
158 @@ -0,0 +1,42 @@
159 +X509_get_signature_nid(), ASN1_STRING_get0_data(), RSA_bits() and DH_bits()
160 +have been available since LibreSSL 2.7.
161 +DSA_bits(), RSA_get0_n(), RSA_get0_e() will be available in LibreSSL 3.5.
162 +
163 +Index: content/fetchers/about.c
164 +--- a/content/fetchers/about.c
165 ++++ b/content/fetchers/about.c
166 +@@ -538,7 +538,8 @@ static nserror free_ns_cert_info(struct ns_cert_info *
167 + /* OpenSSL 1.0.x, 1.0.2, 1.1.0 and 1.1.1 API all changed
168 + * LibreSSL declares its OpenSSL version as 2.1 but only supports 1.0.x API
169 + */
170 +-#if (defined(LIBRESSL_VERSION_NUMBER) || (OPENSSL_VERSION_NUMBER < 0x1010000fL))
171 ++#if (defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x3050000fL) || \
172 ++ (OPENSSL_VERSION_NUMBER < 0x1010000fL)
173 + /* 1.0.x */
174 +
175 + #if (defined(LIBRESSL_VERSION_NUMBER) || (OPENSSL_VERSION_NUMBER < 0x1000200fL))
176 +@@ -609,7 +610,7 @@ static const BIGNUM *ns_RSA_get0_e(const RSA *r)
177 + #define ns_DH_bits DH_bits
178 +
179 + #else
180 +-/* 1.1.1 and later */
181 ++/* 1.1.1 and later, LibreSSL 3.5.0 and later */
182 + #define ns_X509_get_signature_nid X509_get_signature_nid
183 + #define ns_ASN1_STRING_get0_data ASN1_STRING_get0_data
184 + #define ns_RSA_get0_n RSA_get0_n
185 +
186 +X509_up_ref has been available since LibreSSL 2.5.
187 +X509_free has always been available.
188 +
189 +Index: content/fetchers/curl.c
190 +--- a/content/fetchers/curl.c
191 ++++ b/content/fetchers/curl.c
192 +@@ -92,7 +92,7 @@
193 + /* OpenSSL 1.0.x to 1.1.0 certificate reference counting changed
194 + * LibreSSL declares its OpenSSL version as 2.1 but only supports the old way
195 + */
196 +-#if (defined(LIBRESSL_VERSION_NUMBER) || (OPENSSL_VERSION_NUMBER < 0x1010000fL))
197 ++#if (OPENSSL_VERSION_NUMBER < 0x1010000fL)
198 + static int ns_X509_up_ref(X509 *cert)
199 + {
200 + cert->references++;
201
202 diff --git a/www-client/netsurf/files/netsurf-3.9-conditionally-include-image-headers.patch b/www-client/netsurf/files/netsurf-3.9-conditionally-include-image-headers.patch
203 new file mode 100644
204 index 0000000..603c209
205 --- /dev/null
206 +++ b/www-client/netsurf/files/netsurf-3.9-conditionally-include-image-headers.patch
207 @@ -0,0 +1,35 @@
208 +diff -rup a/content/handlers/image/image.c b/content/handlers/image/image.c
209 +--- a/content/handlers/image/image.c 2019-07-17 10:28:13.000000000 +0000
210 ++++ b/content/handlers/image/image.c 2019-09-27 15:09:03.860000000 +0000
211 +@@ -27,15 +27,31 @@
212 + #include "netsurf/content.h"
213 + #include "desktop/gui_internal.h"
214 +
215 ++#ifdef WITH_BMP
216 + #include "image/bmp.h"
217 ++#endif
218 ++#ifdef WITH_GIF
219 + #include "image/gif.h"
220 ++#endif
221 + #include "image/ico.h"
222 ++#ifdef WITH_JPEG
223 + #include "image/jpeg.h"
224 ++#endif
225 ++#ifdef WITH_NSSPRITE
226 + #include "image/nssprite.h"
227 ++#endif
228 ++#ifdef WITH_PNG
229 + #include "image/png.h"
230 ++#endif
231 ++#ifdef WITH_RSVG
232 + #include "image/rsvg.h"
233 ++#endif
234 ++#ifdef WITH_NS_SVG
235 + #include "image/svg.h"
236 ++#endif
237 ++#ifdef WITH_WEBP
238 + #include "image/webp.h"
239 ++#endif
240 + #include "image/image.h"
241 +
242 + /**
243
244 diff --git a/www-client/netsurf/metadata.xml b/www-client/netsurf/metadata.xml
245 new file mode 100644
246 index 0000000..cea4e8e
247 --- /dev/null
248 +++ b/www-client/netsurf/metadata.xml
249 @@ -0,0 +1,40 @@
250 +<?xml version="1.0" encoding="UTF-8"?>
251 +<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
252 +<pkgmetadata>
253 + <maintainer type="person" proxied="yes">
254 + <email>philipp.ammann@××××××.de</email>
255 + <name>Philipp Ammann</name>
256 + </maintainer>
257 + <maintainer type="project" proxied="proxy">
258 + <email>proxy-maint@g.o</email>
259 + <name>Proxy Maintainers</name>
260 + </maintainer>
261 + <upstream>
262 + <changelog>
263 + https://download.netsurf-browser.org/netsurf/releases/ChangeLog.txt
264 + </changelog>
265 + </upstream>
266 + <use>
267 + <flag name="bmp">BMP bitmap image support (media-libs/libnsbmp)</flag>
268 + <flag name="gtk">Build GTK3 GUI</flag>
269 + <flag name="gtk2">Build GTK2 GUI</flag>
270 + <flag name="psl">Use public suffix list via media-libs/libnspsl</flag>
271 + <flag name="rosprite">
272 + RISC OS Sprite bitmap image support (media-libs/librosprite)
273 + </flag>
274 + <flag name="svgtiny">
275 + SVG image support via media-libs/svgatiny instead of gnome-base/librsvg
276 + </flag>
277 + </use>
278 + <longdescription lang="en">
279 + NetSurf is a free, open source web browser. It is written in C,
280 + has its own layout and rendering engine entirely written from
281 + scratch. It is small and capable of handling many of the web
282 + standards in use today.
283 +
284 + Whether you want to check your webmail, read the news or post to
285 + discussion forums, NetSurf is your lightweight gateway to the
286 + world wide web. Actively developed, NetSurf is continually
287 + evolving and improving.
288 + </longdescription>
289 +</pkgmetadata>
290
291 diff --git a/www-client/netsurf/netsurf-3.10-r6.ebuild b/www-client/netsurf/netsurf-3.10-r6.ebuild
292 new file mode 100644
293 index 0000000..69bb6d7
294 --- /dev/null
295 +++ b/www-client/netsurf/netsurf-3.10-r6.ebuild
296 @@ -0,0 +1,153 @@
297 +# Copyright 1999-2022 Gentoo Authors
298 +# Distributed under the terms of the GNU General Public License v2
299 +
300 +EAPI=7
301 +
302 +inherit netsurf desktop toolchain-funcs
303 +
304 +DESCRIPTION="A free, open source web browser"
305 +HOMEPAGE="https://www.netsurf-browser.org/"
306 +SRC_URI="http://download.netsurf-browser.org/netsurf/releases/source/${P}-src.tar.gz"
307 +
308 +LICENSE="GPL-2 MIT"
309 +SLOT="0"
310 +KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~riscv ~x86"
311 +IUSE="bmp fbcon truetype +gif +gtk gtk2 +javascript +jpeg mng
312 + +png +psl rosprite +svg +svgtiny +webp"
313 +
314 +REQUIRED_USE="|| ( fbcon gtk gtk2 )"
315 +
316 +RDEPEND="
317 + >=dev-libs/libcss-0.9
318 + >=net-libs/libdom-0.4.1-r1
319 + >=net-libs/libhubbub-0.3
320 + >=dev-libs/libnsutils-0.1.0
321 + >=dev-libs/libutf8proc-2.4
322 + dev-libs/libxml2:2
323 + net-misc/curl
324 + bmp? ( >=media-libs/libnsbmp-0.1 )
325 + fbcon? ( >=dev-libs/libnsfb-0.2.2
326 + truetype? ( media-fonts/dejavu
327 + >=media-libs/freetype-2.5.0.1 )
328 + )
329 + gif? ( >=media-libs/libnsgif-0.1 )
330 + gtk? ( dev-libs/glib:2
331 + x11-libs/gtk+:3 )
332 + gtk2? ( dev-libs/glib:2
333 + x11-libs/gtk+:2 )
334 + javascript? (
335 + >=dev-libs/nsgenbind-0.7
336 + dev-lang/duktape:=
337 + )
338 + jpeg? ( >=virtual/jpeg-0-r2:0 )
339 + mng? ( >=media-libs/libmng-1.0.10-r2 )
340 + png? ( >=media-libs/libpng-1.2.51:0 )
341 + psl? ( media-libs/libnspsl )
342 + rosprite? ( >=media-libs/librosprite-0.1.2-r1 )
343 + svg? ( svgtiny? ( >=media-libs/libsvgtiny-0.1.3-r1 )
344 + !svgtiny? ( gnome-base/librsvg:2 ) )
345 + webp? ( >=media-libs/libwebp-0.3.0 )"
346 +DEPEND="${RDEPEND}"
347 +BDEPEND="
348 + javascript? ( app-editors/vim-core )
349 + dev-libs/check
350 + dev-perl/HTML-Parser
351 + >=dev-util/netsurf-buildsystem-1.7-r1
352 + virtual/pkgconfig
353 +"
354 +
355 +PATCHES=(
356 + "${FILESDIR}/${PN}-3.9-conditionally-include-image-headers.patch"
357 + "${FILESDIR}/${PN}-3.10-julia-libutf8proc-header-location.patch"
358 + "${FILESDIR}/${PN}-3.10-disable-failing-tests.patch"
359 + "${FILESDIR}/${PN}-3.10-gcc10-fno-common.patch"
360 + "${FILESDIR}/${PN}-3.10-libressl-3.5.patch"
361 +)
362 +
363 +DOCS=( README docs/using-framebuffer.md
364 + docs/ideas/{cache,css-engine,render-library}.txt )
365 +
366 +src_prepare() {
367 + default
368 + rm -r frontends/{amiga,atari,beos,monkey,riscos,windows} || die
369 +}
370 +
371 +_emake() {
372 + netsurf_define_makeconf
373 + local netsurf_makeconf=(
374 + "${NETSURF_MAKECONF[@]}"
375 + COMPONENT_TYPE=binary
376 + NETSURF_USE_BMP=$(usex bmp YES NO)
377 + NETSURF_USE_GIF=$(usex gif YES NO)
378 + NETSURF_USE_JPEG=$(usex jpeg YES NO)
379 + NETSURF_USE_PNG=$(usex png YES NO)
380 + NETSURF_USE_NSPSL=$(usex psl YES NO)
381 + NETSURF_USE_MNG=$(usex mng YES NO)
382 + NETSURF_USE_WEBP=$(usex webp YES NO)
383 + NETSURF_USE_JS=NO
384 + NETSURF_USE_DUKTAPE=$(usex javascript YES NO)
385 + NETSURF_USE_NSSVG=$(usex svg $(usex svgtiny YES NO) NO)
386 + NETSURF_USE_RSVG=$(usex svg $(usex svgtiny NO YES) NO)
387 + NETSURF_USE_ROSPRITE=$(usex rosprite YES NO)
388 + PKG_CONFIG=$(tc-getPKG_CONFIG)
389 + NETSURF_FB_FONTLIB=$(usex truetype freetype internal)
390 + NETSURF_FB_FONTPATH="${EPREFIX}/usr/share/fonts/dejavu"
391 + NETSURF_USE_VIDEO=NO
392 + )
393 +
394 + emake "${netsurf_makeconf[@]}" $@
395 +}
396 +
397 +src_compile() {
398 + # The build system only runs pkg-config to find librsvg's include
399 + # dir for the gtk targets. So if you try to build the framebuffer
400 + # target with NETSURF_USE_RSVG=YES, the build crashes on failing to
401 + # find rsvg.h. To work around that, we set NETSURF_USE_RSVG=NO. It
402 + # might be possible to fall back to svgtiny with USE="svg -svgtiny"
403 + # if svgtiny works in a framebuffer, but then our (R)DEPEND would
404 + # need some mangling to ensure that svgtiny is installed.
405 + use fbcon && _emake NETSURF_USE_RSVG=NO TARGET=framebuffer
406 +
407 + use gtk2 && _emake TARGET=gtk2
408 + use gtk && _emake TARGET=gtk3
409 +}
410 +
411 +src_test() {
412 + _emake test
413 +}
414 +
415 +src_install() {
416 + sed -e '1iexit;' \
417 + -i "${WORKDIR}"/*/utils/git-testament.pl || die
418 +
419 + if use fbcon ; then
420 + # See earlier comments about rsvg.h.
421 + _emake NETSURF_USE_RSVG=NO TARGET=framebuffer DESTDIR="${D}" install
422 + elog "framebuffer binary has been installed as netsurf-fb"
423 + make_desktop_entry "${EPREFIX}/usr/bin/netsurf-fb %u" \
424 + NetSurf-framebuffer \
425 + netsurf \
426 + "Network;WebBrowser"
427 + fi
428 + if use gtk2 ; then
429 + _emake TARGET=gtk2 DESTDIR="${D}" install
430 + elog "netsurf gtk2 version has been installed as netsurf-gtk2"
431 + make_desktop_entry "${EPREFIX}/usr/bin/netsurf-gtk2 %u" \
432 + NetSurf-gtk2 \
433 + netsurf \
434 + "Network;WebBrowser"
435 + fi
436 + if use gtk ; then
437 + _emake TARGET=gtk3 DESTDIR="${D}" install
438 + elog "netsurf gtk3 version has been installed as netsurf-gtk3"
439 + make_desktop_entry "${EPREFIX}/usr/bin/netsurf-gtk3 %u" \
440 + NetSurf-gtk3 \
441 + netsurf \
442 + "Network;WebBrowser"
443 + fi
444 +
445 + insinto /usr/share/pixmaps
446 + doins frontends/gtk/res/netsurf.xpm
447 + doman docs/netsurf-fb.1
448 + doman docs/netsurf-gtk.1
449 +}