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:
Eric Bavier 2017-02-12 12:52:21 -06:00
parent 1f6ec9d22d
commit 710806b57b
No known key found for this signature in database
GPG key ID: 1EBBD204781F962C
3 changed files with 93 additions and 26 deletions

View file

@ -772,6 +772,7 @@ dist_patch_DATA = \
%D%/packages/patches/net-tools-bitrot.patch \ %D%/packages/patches/net-tools-bitrot.patch \
%D%/packages/patches/netcdf-date-time.patch \ %D%/packages/patches/netcdf-date-time.patch \
%D%/packages/patches/netcdf-tst_h_par.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-handle-zombies.patch \
%D%/packages/patches/ngircd-no-dns-in-tests.patch \ %D%/packages/patches/ngircd-no-dns-in-tests.patch \
%D%/packages/patches/ninja-tests.patch \ %D%/packages/patches/ninja-tests.patch \

View 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)

View file

@ -4071,32 +4071,41 @@ (define-public netsurf
(source (source
(origin (origin
(method url-fetch) (method url-fetch)
(uri (string-append "http://download.netsurf-browser.org/" (uri (string-append "http://download.netsurf-browser.org/netsurf/"
"netsurf/releases/source-full/netsurf-all-" "releases/source/netsurf-" version "-src.tar.gz"))
version ".tar.gz"))
(sha256 (sha256
(base32 (base32
"1cgq9n4nvkpih93sfpdadv3666ycsx9bnp8kwalbs8h232mr7ppx")))) "174sjx0566agckwmlj4w2cip5qbxdiafyhlp185a1qprxx84pbjr"))
(patches (search-patches "netsurf-system-utf8proc.patch"))))
(build-system glib-or-gtk-build-system) (build-system glib-or-gtk-build-system)
(native-inputs (native-inputs
`(("pkg-config" ,pkg-config) `(("netsurf-buildsystem" ,netsurf-buildsystem)
("nsgenbind" ,nsgenbind)
("perl" ,perl) ("perl" ,perl)
("perl-html-parser" ,perl-html-parser) ("perl-html-parser" ,perl-html-parser)
("flex" ,flex) ("pkg-config" ,pkg-config)))
("bison" ,bison)))
(inputs (inputs
`(("gtk+" ,gtk+-2) `(("curl" ,curl)
("gperf" ,gperf) ("gtk+" ,gtk+-2)
("curl" ,curl)
("openssl" ,openssl) ("openssl" ,openssl)
("utf8proc" ,utf8proc)
("libpng" ,libpng) ("libpng" ,libpng)
("libjpeg" ,libjpeg) ("libjpeg" ,libjpeg)
("expat" ,expat))) ("libcss" ,libcss)
("libdom" ,libdom)
("libnsbmp" ,libnsbmp)
("libnsgif" ,libnsgif)
("libnspsl" ,libnspsl)
("libnsutils" ,libnsutils)
("libsvgtiny" ,libsvgtiny)))
(arguments (arguments
`(#:make-flags `("CC=gcc" "BUILD_CC=gcc" `(#:make-flags `("CC=gcc" "BUILD_CC=gcc"
,(string-append "PREFIX=" %output)) ,(string-append "PREFIX=" %output)
#:parallel-build? #f ;parallel builds not supported ,(string-append "NSSHARED="
#:tests? #f ;no way to easily run from release tarball (assoc-ref %build-inputs
"netsurf-buildsystem")
"/share/netsurf-buildsystem"))
#:tests? #f
#:modules ((ice-9 rdelim) #:modules ((ice-9 rdelim)
(ice-9 match) (ice-9 match)
(srfi srfi-1) (srfi srfi-1)
@ -4104,18 +4113,11 @@ (define-public netsurf
,@%glib-or-gtk-build-system-modules) ,@%glib-or-gtk-build-system-modules)
#:phases #:phases
(modify-phases %standard-phases (modify-phases %standard-phases
(replace 'configure (delete 'configure)
(lambda _
(call-with-output-file "netsurf/Makefile.config"
(lambda (port)
(format port "~
NETSURF_GTK_RESOURCES := $(PREFIX)/share/netsurf/~@
")))
#t))
(add-after 'build 'adjust-welcome (add-after 'build 'adjust-welcome
(lambda _ (lambda _
;; First, fix some unended tags and simple substitutions ;; 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) (("<(img|input)([^>]*)>" _ tag contents)
(string-append "<" tag contents " />")) (string-append "<" tag contents " />"))
(("Licence") "License") ;prefer GNU spelling (("Licence") "License") ;prefer GNU spelling
@ -4126,7 +4128,7 @@ (define-public netsurf
(("Google Search") "DuckDuckGo Search") (("Google Search") "DuckDuckGo Search")
(("name=\"btnG\"") "")) (("name=\"btnG\"") ""))
;; Remove default links so it doesn't seem we're endorsing them ;; 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) (lambda (in out)
;; Leave the DOCTYPE header as is ;; Leave the DOCTYPE header as is
(display (read-line in 'concat) out) (display (read-line in 'concat) out)
@ -4148,13 +4150,13 @@ (define-public netsurf
(desktop (string-append out "/share/applications/" (desktop (string-append out "/share/applications/"
"netsurf.desktop"))) "netsurf.desktop")))
(mkdir-p (dirname desktop)) (mkdir-p (dirname desktop))
(copy-file "netsurf/frontends/gtk/res/netsurf-gtk.desktop" (copy-file "frontends/gtk/res/netsurf-gtk.desktop"
desktop) desktop)
(substitute* desktop (substitute* desktop
(("netsurf-gtk") (string-append out "/bin/netsurf")) (("netsurf-gtk") (string-append out "/bin/netsurf"))
(("netsurf.png") (string-append out "/share/netsurf/" (("netsurf.png") (string-append out "/share/netsurf/"
"netsurf.xpm"))) "netsurf.xpm")))
(install-file "netsurf/Docs/netsurf-gtk.1" (install-file "Docs/netsurf-gtk.1"
(string-append out "/share/man/man1/")) (string-append out "/share/man/man1/"))
#t)))))) #t))))))
(home-page "http://www.netsurf-browser.org") (home-page "http://www.netsurf-browser.org")