mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-11-07 07:26:13 -05:00
gnu: netsurf: Use unbundled source.
* gnu/packages/patches/netsurf-system-utf8proc.patch: New patch. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/web.scm (netsurf)[source]: Use it. Change to unbundled source tarball. [native-inputs]: Add netsurf-buildsystem, nsgenbind. Remove flex, bison. [inputs]: Add utf8proc, libcss, libdom, libnsbmp, libnsgif, libnspsl, libnsutils, libsvgtiny. Remove expat, gperf. [arguments]: Adjust #:make-flags for netsurf-buildsystem. Delete configure phase. Adjust source directories.
This commit is contained in:
parent
1f6ec9d22d
commit
710806b57b
3 changed files with 93 additions and 26 deletions
|
@ -772,6 +772,7 @@ dist_patch_DATA = \
|
|||
%D%/packages/patches/net-tools-bitrot.patch \
|
||||
%D%/packages/patches/netcdf-date-time.patch \
|
||||
%D%/packages/patches/netcdf-tst_h_par.patch \
|
||||
%D%/packages/patches/netsurf-system-utf8proc.patch \
|
||||
%D%/packages/patches/ngircd-handle-zombies.patch \
|
||||
%D%/packages/patches/ngircd-no-dns-in-tests.patch \
|
||||
%D%/packages/patches/ninja-tests.patch \
|
||||
|
|
64
gnu/packages/patches/netsurf-system-utf8proc.patch
Normal file
64
gnu/packages/patches/netsurf-system-utf8proc.patch
Normal file
|
@ -0,0 +1,64 @@
|
|||
Use upstream utf8proc package, as suggested in
|
||||
http://source.netsurf-browser.org/libutf8proc.git/commit/?id=770e329cceaf0620c7b482589a9b17ed1d19c16d
|
||||
|
||||
Work around upstream's lack of a pkg-config file and update API.
|
||||
|
||||
--- netsurf-3.6/Makefile
|
||||
+++ netsurf-3.6/Makefile
|
||||
@@ -527,10 +527,9 @@
|
||||
$(eval $(call pkg_config_find_and_add,libcss,CSS))
|
||||
$(eval $(call pkg_config_find_and_add,libdom,DOM))
|
||||
$(eval $(call pkg_config_find_and_add,libnsutils,nsutils))
|
||||
-$(eval $(call pkg_config_find_and_add,libutf8proc,utf8proc))
|
||||
|
||||
# Common libraries without pkg-config support
|
||||
-LDFLAGS += -lz
|
||||
+LDFLAGS += -lz -lutf8proc
|
||||
|
||||
# Optional libraries with pkgconfig
|
||||
|
||||
--- netsurf-3.6/utils/idna.c
|
||||
+++ netsurf-3.6/utils/idna.c
|
||||
@@ -26,7 +26,7 @@
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
-#include <libutf8proc/utf8proc.h>
|
||||
+#include <utf8proc.h>
|
||||
|
||||
#include "utils/errors.h"
|
||||
#include "utils/idna.h"
|
||||
@@ -250,7 +250,7 @@
|
||||
return NSERROR_NOMEM;
|
||||
}
|
||||
|
||||
- nfc_size = utf8proc_normalise(nfc_label, nfc_size,
|
||||
+ nfc_size = utf8proc_normalize_utf32(nfc_label, nfc_size,
|
||||
UTF8PROC_STABLE | UTF8PROC_COMPOSE);
|
||||
if (nfc_size < 0) {
|
||||
return NSERROR_NOMEM;
|
||||
@@ -565,7 +565,7 @@
|
||||
}
|
||||
|
||||
/* Perform NFC normalisation */
|
||||
- ucs4_len = utf8proc_normalise(ucs4, u_ucs4_len,
|
||||
+ ucs4_len = utf8proc_normalize_utf32(ucs4, u_ucs4_len,
|
||||
UTF8PROC_STABLE | UTF8PROC_COMPOSE);
|
||||
if (ucs4_len < 0) {
|
||||
free(ucs4);
|
||||
--- netsurf-3.6/test/Makefile
|
||||
+++ netsurf-3.6/test/Makefile
|
||||
@@ -112,11 +112,11 @@
|
||||
-D_XOPEN_SOURCE=600 \
|
||||
-Itest -Iinclude -Icontent/handlers -Ifrontends -I. -I.. \
|
||||
-Dnsgtk \
|
||||
- $(shell pkg-config --cflags libcurl libparserutils libwapcaplet libdom libnsutils libutf8proc libidn) \
|
||||
+ $(shell pkg-config --cflags libcurl libparserutils libwapcaplet libdom libnsutils libidn) \
|
||||
$(LIB_CFLAGS) \
|
||||
$(COV_CFLAGS)
|
||||
|
||||
-TESTLDFLAGS := $(shell pkg-config --libs libcurl libparserutils libwapcaplet libdom libnsutils libutf8proc libidn) -lz \
|
||||
+TESTLDFLAGS := $(shell pkg-config --libs libcurl libparserutils libwapcaplet libdom libnsutils libidn) -lz -lutf8proc \
|
||||
$(LIB_LDFLAGS)\
|
||||
$(COV_LDFLAGS)
|
||||
|
|
@ -4071,32 +4071,41 @@ (define-public netsurf
|
|||
(source
|
||||
(origin
|
||||
(method url-fetch)
|
||||
(uri (string-append "http://download.netsurf-browser.org/"
|
||||
"netsurf/releases/source-full/netsurf-all-"
|
||||
version ".tar.gz"))
|
||||
(uri (string-append "http://download.netsurf-browser.org/netsurf/"
|
||||
"releases/source/netsurf-" version "-src.tar.gz"))
|
||||
(sha256
|
||||
(base32
|
||||
"1cgq9n4nvkpih93sfpdadv3666ycsx9bnp8kwalbs8h232mr7ppx"))))
|
||||
"174sjx0566agckwmlj4w2cip5qbxdiafyhlp185a1qprxx84pbjr"))
|
||||
(patches (search-patches "netsurf-system-utf8proc.patch"))))
|
||||
(build-system glib-or-gtk-build-system)
|
||||
(native-inputs
|
||||
`(("pkg-config" ,pkg-config)
|
||||
`(("netsurf-buildsystem" ,netsurf-buildsystem)
|
||||
("nsgenbind" ,nsgenbind)
|
||||
("perl" ,perl)
|
||||
("perl-html-parser" ,perl-html-parser)
|
||||
("flex" ,flex)
|
||||
("bison" ,bison)))
|
||||
("pkg-config" ,pkg-config)))
|
||||
(inputs
|
||||
`(("gtk+" ,gtk+-2)
|
||||
("gperf" ,gperf)
|
||||
("curl" ,curl)
|
||||
`(("curl" ,curl)
|
||||
("gtk+" ,gtk+-2)
|
||||
("openssl" ,openssl)
|
||||
("utf8proc" ,utf8proc)
|
||||
("libpng" ,libpng)
|
||||
("libjpeg" ,libjpeg)
|
||||
("expat" ,expat)))
|
||||
("libcss" ,libcss)
|
||||
("libdom" ,libdom)
|
||||
("libnsbmp" ,libnsbmp)
|
||||
("libnsgif" ,libnsgif)
|
||||
("libnspsl" ,libnspsl)
|
||||
("libnsutils" ,libnsutils)
|
||||
("libsvgtiny" ,libsvgtiny)))
|
||||
(arguments
|
||||
`(#:make-flags `("CC=gcc" "BUILD_CC=gcc"
|
||||
,(string-append "PREFIX=" %output))
|
||||
#:parallel-build? #f ;parallel builds not supported
|
||||
#:tests? #f ;no way to easily run from release tarball
|
||||
,(string-append "PREFIX=" %output)
|
||||
,(string-append "NSSHARED="
|
||||
(assoc-ref %build-inputs
|
||||
"netsurf-buildsystem")
|
||||
"/share/netsurf-buildsystem"))
|
||||
#:tests? #f
|
||||
#:modules ((ice-9 rdelim)
|
||||
(ice-9 match)
|
||||
(srfi srfi-1)
|
||||
|
@ -4104,18 +4113,11 @@ (define-public netsurf
|
|||
,@%glib-or-gtk-build-system-modules)
|
||||
#:phases
|
||||
(modify-phases %standard-phases
|
||||
(replace 'configure
|
||||
(lambda _
|
||||
(call-with-output-file "netsurf/Makefile.config"
|
||||
(lambda (port)
|
||||
(format port "~
|
||||
NETSURF_GTK_RESOURCES := $(PREFIX)/share/netsurf/~@
|
||||
")))
|
||||
#t))
|
||||
(delete 'configure)
|
||||
(add-after 'build 'adjust-welcome
|
||||
(lambda _
|
||||
;; First, fix some unended tags and simple substitutions
|
||||
(substitute* "netsurf/frontends/gtk/res/welcome.html"
|
||||
(substitute* "frontends/gtk/res/welcome.html"
|
||||
(("<(img|input)([^>]*)>" _ tag contents)
|
||||
(string-append "<" tag contents " />"))
|
||||
(("Licence") "License") ;prefer GNU spelling
|
||||
|
@ -4126,7 +4128,7 @@ (define-public netsurf
|
|||
(("Google Search") "DuckDuckGo Search")
|
||||
(("name=\"btnG\"") ""))
|
||||
;; Remove default links so it doesn't seem we're endorsing them
|
||||
(with-atomic-file-replacement "netsurf/frontends/gtk/res/welcome.html"
|
||||
(with-atomic-file-replacement "frontends/gtk/res/welcome.html"
|
||||
(lambda (in out)
|
||||
;; Leave the DOCTYPE header as is
|
||||
(display (read-line in 'concat) out)
|
||||
|
@ -4148,13 +4150,13 @@ (define-public netsurf
|
|||
(desktop (string-append out "/share/applications/"
|
||||
"netsurf.desktop")))
|
||||
(mkdir-p (dirname desktop))
|
||||
(copy-file "netsurf/frontends/gtk/res/netsurf-gtk.desktop"
|
||||
(copy-file "frontends/gtk/res/netsurf-gtk.desktop"
|
||||
desktop)
|
||||
(substitute* desktop
|
||||
(("netsurf-gtk") (string-append out "/bin/netsurf"))
|
||||
(("netsurf.png") (string-append out "/share/netsurf/"
|
||||
"netsurf.xpm")))
|
||||
(install-file "netsurf/Docs/netsurf-gtk.1"
|
||||
(install-file "Docs/netsurf-gtk.1"
|
||||
(string-append out "/share/man/man1/"))
|
||||
#t))))))
|
||||
(home-page "http://www.netsurf-browser.org")
|
||||
|
|
Loading…
Reference in a new issue