From f64b989b1b41f9543f307b4079b69f5801c5867e Mon Sep 17 00:00:00 2001 From: Efraim Flashner Date: Thu, 11 Aug 2016 10:23:30 +0300 Subject: gnu: dico: Update to 2.3. * gnu/packages/dico.scm (dico): Update to 2.3. [inputs]: Add python-2, groff. Upgrade readline-6.2 to latest. [source]: Remove patches. * gnu/packages/patches/dico-idxcide-bug.patch, * gnu/packages/patches/dico-libtool-deterministic.patch: Remove files. * gnu/local.mk (dist_patch_DATA): Remove them. --- gnu/packages/patches/dico-idxgcide-bug.patch | 21 --------------------- .../patches/dico-libtool-deterministic.patch | 15 --------------- 2 files changed, 36 deletions(-) delete mode 100644 gnu/packages/patches/dico-idxgcide-bug.patch delete mode 100644 gnu/packages/patches/dico-libtool-deterministic.patch (limited to 'gnu/packages/patches') diff --git a/gnu/packages/patches/dico-idxgcide-bug.patch b/gnu/packages/patches/dico-idxgcide-bug.patch deleted file mode 100644 index 28cc8a6a08..0000000000 --- a/gnu/packages/patches/dico-idxgcide-bug.patch +++ /dev/null @@ -1,21 +0,0 @@ -Reported at . -Patch the .c file to avoid depending on Flex. - -commit 4599abbda3b5979367138ea098e435c919fe93fc -Author: Sergey Poznyakoff -Date: Thu Jul 28 14:09:58 2016 +0300 - - Bugfix - - * modules/gcide/idxgcide.l (main): Initialize ipg_header. - ---- dico-2.2/modules/gcide/idxgcide.c 2016-07-28 14:15:07.823587004 +0200 -+++ dico-2.2/modules/gcide/idxgcide.c 2016-07-28 14:15:09.435600549 +0200 -@@ -2497,6 +2497,7 @@ main(int argc, char **argv) - dico_log(L_ERR, 0, _("not enough memory")); - exit(EX_UNAVAILABLE); - } -+ idx_page->ipg_header.hdr.phdr_numentries = 0; - idx_page->ipg_header.hdr.phdr_text_offset = idx_header.ihdr_pagesize / 2; - - idx_header.ihdr_maxpageref = idx_header.ihdr_pagesize / 2 / diff --git a/gnu/packages/patches/dico-libtool-deterministic.patch b/gnu/packages/patches/dico-libtool-deterministic.patch deleted file mode 100644 index 957fc79786..0000000000 --- a/gnu/packages/patches/dico-libtool-deterministic.patch +++ /dev/null @@ -1,15 +0,0 @@ -Dico 2.2 uses an old Libtool (2.2.7a) that did not sort the output -of 'find', thereby leading to non-deterministic file name ordering -in the arguments passed to 'ar rcu' for libdico.a & co. - ---- dico-2.2/build-aux/ltmain.sh 1970-01-01 01:00:00.000000000 +0100 -+++ dico-2.2/build-aux/ltmain.sh 2015-11-25 09:39:30.826169050 +0100 -@@ -2926,7 +2926,7 @@ func_extract_archives () - func_extract_an_archive "$my_xdir" "$my_xabs" - ;; - esac -- my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` -+ my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP` - done - - func_extract_archives_result="$my_oldobjs" -- cgit 1.4.1 From b3de5ff22138a0cc286faac3010552129352afce Mon Sep 17 00:00:00 2001 From: Jan Nieuwenhuizen Date: Sun, 7 Feb 2016 12:57:40 +0100 Subject: gnu: Add laby. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/packages/patches/laby-make-install.patch: New file. * gnu/local.mk (dist_patch_DATA): gnu-system.am: Add it. * gnu/packages/games.scm (laby): New variable. Signed-off-by: 宋文武 --- gnu/local.mk | 1 + gnu/packages/games.scm | 41 ++++++++++++++++++++++++++++ gnu/packages/patches/laby-make-install.patch | 25 +++++++++++++++++ 3 files changed, 67 insertions(+) create mode 100644 gnu/packages/patches/laby-make-install.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index a9faffffb9..af47311cba 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -597,6 +597,7 @@ dist_patch_DATA = \ %D%/packages/patches/jbig2dec-ignore-testtest.patch \ %D%/packages/patches/khmer-use-libraries.patch \ %D%/packages/patches/kmod-module-directory.patch \ + %D%/packages/patches/laby-make-install.patch \ %D%/packages/patches/ldc-disable-tests.patch \ %D%/packages/patches/lftp-dont-save-unknown-host-fingerprint.patch \ %D%/packages/patches/liba52-enable-pic.patch \ diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm index e467dbe04c..4ca59c804a 100644 --- a/gnu/packages/games.scm +++ b/gnu/packages/games.scm @@ -22,6 +22,7 @@ ;;; Copyright © 2016 Kei Kebreau ;;; Copyright © 2016 Alex Griffin ;;; Copyright © 2016 Efraim Flashner ;;; ;;; This file is part of GNU Guix. ;;; @@ -74,6 +75,7 @@ #:use-module (gnu packages image) #:use-module (gnu packages ncurses) #:use-module (gnu packages netpbm) + #:use-module (gnu packages ocaml) #:use-module (gnu packages python) #:use-module (gnu packages readline) #:use-module (gnu packages xorg) @@ -2731,3 +2733,42 @@ in a style similar to the original Super Mario games covered under the GNU GPL.") (home-page "https://supertuxproject.org/") (license license:gpl3+))) + +(define-public laby + (package + (name "laby") + (version "0.6.4") + (source + (origin (method url-fetch) + (uri (string-append + "https://github.com/sgimenez/laby/tarball/" + name "-" version)) + (file-name (string-append name "-" version ".tar.gz")) + (sha256 + (base32 + "113ip48308ps3lsw427xswgx3wdanils43nyal9n4jr6bcx1bj2j")) + (patches (search-patches "laby-make-install.patch")))) + (build-system gnu-build-system) + (inputs + `(("lablgtk" ,lablgtk) + ("ocaml" ,ocaml) + ("ocaml-findlib" ,ocaml-findlib))) + (arguments + '(#:phases + (modify-phases %standard-phases + (delete 'configure) + (add-before 'build 'setenv + (lambda* (#:key inputs #:allow-other-keys) + (let ((lablgtk (assoc-ref inputs "lablgtk"))) + (setenv "LD_LIBRARY_PATH" + (string-append lablgtk "/lib/ocaml/stublibs")))))) + #:tests? #f ; no 'check' target + #:make-flags + (list (string-append "PREFIX=" (assoc-ref %outputs "out")) "all"))) + (home-page "https://sgimenez.github.io/laby/") + (synopsis "Programming game") + (description "Learn programming, playing with ants and spider webs ;-) +Your robot ant can be programmed in many languages: OCaml, Python, C, C++, +Java, Ruby, Lua, JavaScript, Pascal, Perl, Scheme, Vala, Prolog. Experienced +programmers may also add their own favorite language.") + (license license:gpl3+))) diff --git a/gnu/packages/patches/laby-make-install.patch b/gnu/packages/patches/laby-make-install.patch new file mode 100644 index 0000000000..3e956bedd5 --- /dev/null +++ b/gnu/packages/patches/laby-make-install.patch @@ -0,0 +1,25 @@ +From e9896b8951f9faf1f76a3b45be6e70d0aeb30a73 Mon Sep 17 00:00:00 2001 +From: Jan Nieuwenhuizen +Date: Sat, 15 Nov 2014 17:48:18 +0100 +Subject: [PATCH] Add make install. + +--- + Makefile | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/Makefile b/Makefile +index ca18c1e..65af31b 100644 +--- a/Makefile 2016-02-09 21:34:01.883660009 +0100 ++++ b/Makefile 2016-02-09 21:34:30.672150679 +0100 +@@ -19,3 +19,11 @@ + @git archive --prefix="$(PROJECT_ARCHIVE)/" HEAD \ + | gzip >_dist/"$(PROJECT_ARCHIVE)".tar.gz + @echo archive stored in "_dist/$(PROJECT_ARCHIVE).tar.gz" ++ ++PREFIX=/usr/local ++install: ++ strip laby ++ mkdir -p $(PREFIX)/bin ++ cp laby $(PREFIX)/bin/laby ++ mkdir -p $(PREFIX)/share/laby ++ tar -C data -cf - . | tar -C $(PREFIX)/share/laby -xf- -- cgit 1.4.1 From f2b4c18cd96a69e375d7d9b5ad1c09f8fc065571 Mon Sep 17 00:00:00 2001 From: Jelle Licht Date: Thu, 11 Aug 2016 17:02:41 +0200 Subject: gnu: jq: Fix CVE-2015-8863. * gnu/packages/patches/jq-CVE-2015-8863.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/web.scm (jq)[source]: Use it. Signed-off-by: Leo Famulari --- gnu/local.mk | 1 + gnu/packages/patches/jq-CVE-2015-8863.patch | 45 +++++++++++++++++++++++++++++ gnu/packages/web.scm | 6 +++- 3 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/jq-CVE-2015-8863.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index af47311cba..44ace61975 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -595,6 +595,7 @@ dist_patch_DATA = \ %D%/packages/patches/jasper-CVE-2016-2089.patch \ %D%/packages/patches/jasper-CVE-2016-2116.patch \ %D%/packages/patches/jbig2dec-ignore-testtest.patch \ + %D%/packages/patches/jq-CVE-2015-8863.patch \ %D%/packages/patches/khmer-use-libraries.patch \ %D%/packages/patches/kmod-module-directory.patch \ %D%/packages/patches/laby-make-install.patch \ diff --git a/gnu/packages/patches/jq-CVE-2015-8863.patch b/gnu/packages/patches/jq-CVE-2015-8863.patch new file mode 100644 index 0000000000..20b3bb3f06 --- /dev/null +++ b/gnu/packages/patches/jq-CVE-2015-8863.patch @@ -0,0 +1,45 @@ +Fix CVE-2015-8863 (Off-by-one error in the tokenadd function in +jv_parse.c in jq allows remote attackers to cause a denial of service +(crash) via a long JSON-encoded number, which triggers a heap-based +buffer overflow): + + + +Copied from upstream code repository: + + + +From 8eb1367ca44e772963e704a700ef72ae2e12babd Mon Sep 17 00:00:00 2001 +From: Nicolas Williams +Date: Sat, 24 Oct 2015 17:24:57 -0500 +Subject: [PATCH] Heap buffer overflow in tokenadd() (fix #105) + +This was an off-by one: the NUL terminator byte was not allocated on +resize. This was triggered by JSON-encoded numbers longer than 256 +bytes. +--- + jv_parse.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/jv_parse.c b/jv_parse.c +index 3102ed4..84245b8 100644 +--- a/jv_parse.c ++++ b/jv_parse.c +@@ -383,7 +383,7 @@ static pfunc stream_token(struct jv_parser* p, char ch) { + + static void tokenadd(struct jv_parser* p, char c) { + assert(p->tokenpos <= p->tokenlen); +- if (p->tokenpos == p->tokenlen) { ++ if (p->tokenpos >= (p->tokenlen - 1)) { + p->tokenlen = p->tokenlen*2 + 256; + p->tokenbuf = jv_mem_realloc(p->tokenbuf, p->tokenlen); + } +@@ -485,7 +485,7 @@ static pfunc check_literal(struct jv_parser* p) { + TRY(value(p, v)); + } else { + // FIXME: better parser +- p->tokenbuf[p->tokenpos] = 0; // FIXME: invalid ++ p->tokenbuf[p->tokenpos] = 0; + char* end = 0; + double d = jvp_strtod(&p->dtoa, p->tokenbuf, &end); + if (end == 0 || *end != 0) diff --git a/gnu/packages/web.scm b/gnu/packages/web.scm index fa791ffbe1..9106295061 100644 --- a/gnu/packages/web.scm +++ b/gnu/packages/web.scm @@ -3293,7 +3293,11 @@ It uses the uwsgi protocol for all the networking/interprocess communications.") "/" name "-" version ".tar.gz")) (sha256 (base32 - "0g29kyz4ykasdcrb0zmbrp2jqs9kv1wz9swx849i2d1ncknbzln4")))) + "0g29kyz4ykasdcrb0zmbrp2jqs9kv1wz9swx849i2d1ncknbzln4")) + ;; This patch has been pushed and the vulnerability will be + ;; fixed in the next release after 1.5. + ;; https://github.com/stedolan/jq/issues/995 + (patches (search-patches "jq-CVE-2015-8863.patch")))) (inputs `(("oniguruma" ,oniguruma))) (native-inputs -- cgit 1.4.1 From 53dcbbec07cb06147e86a8a186e47cf6155ce7dc Mon Sep 17 00:00:00 2001 From: Leo Famulari Date: Tue, 16 Aug 2016 22:33:39 -0400 Subject: gnu: cracklib: Fix CVE-2016-6318. * gnu/packages/patches/cracklib-CVE-2016-6318.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/password-utils.scm (cracklib)[source]: Use the patch. --- gnu/local.mk | 1 + gnu/packages/password-utils.scm | 2 + gnu/packages/patches/cracklib-CVE-2016-6318.patch | 95 +++++++++++++++++++++++ 3 files changed, 98 insertions(+) create mode 100644 gnu/packages/patches/cracklib-CVE-2016-6318.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index 7416850003..d89004611b 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -464,6 +464,7 @@ dist_patch_DATA = \ %D%/packages/patches/cpio-gets-undeclared.patch \ %D%/packages/patches/cpio-CVE-2016-2037.patch \ %D%/packages/patches/cpufrequtils-fix-aclocal.patch \ + %D%/packages/patches/cracklib-CVE-2016-6318.patch \ %D%/packages/patches/crda-optional-gcrypt.patch \ %D%/packages/patches/crossmap-allow-system-pysam.patch \ %D%/packages/patches/csound-header-ordering.patch \ diff --git a/gnu/packages/password-utils.scm b/gnu/packages/password-utils.scm index 7a8bdcb5f3..7288da6613 100644 --- a/gnu/packages/password-utils.scm +++ b/gnu/packages/password-utils.scm @@ -29,6 +29,7 @@ #:use-module (guix build-system gnu) #:use-module (guix download) #:use-module (guix packages) + #:use-module (gnu packages) #:use-module (gnu packages admin) #:use-module (gnu packages base) #:use-module (gnu packages compression) @@ -159,6 +160,7 @@ and vice versa.") (uri (string-append "https://github.com/cracklib/cracklib/" "releases/download/" name "-" version "/" name "-" version ".tar.gz")) + (patches (search-patches "cracklib-CVE-2016-6318.patch")) (sha256 (base32 "0hrkb0prf7n92w6rxgq0ilzkk6rkhpys2cfqkrbzswp27na7dkqp")))) diff --git a/gnu/packages/patches/cracklib-CVE-2016-6318.patch b/gnu/packages/patches/cracklib-CVE-2016-6318.patch new file mode 100644 index 0000000000..4806ecaae9 --- /dev/null +++ b/gnu/packages/patches/cracklib-CVE-2016-6318.patch @@ -0,0 +1,95 @@ +Fix CVE-2016-6318. + +https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-6318 + +Patch copied from Red Hat: + +https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2016-6318 +https://bugzilla.redhat.com/attachment.cgi?id=1188599&action=diff + +It is not safe to pass words longer than STRINGSIZE further to cracklib +so the longbuffer cannot be longer than STRINGSIZE. +diff -up cracklib-2.9.0/lib/fascist.c.longgecos cracklib-2.9.0/lib/fascist.c +--- cracklib-2.9.0/lib/fascist.c.longgecos 2014-02-06 16:03:59.000000000 +0100 ++++ cracklib-2.9.0/lib/fascist.c 2016-08-08 12:05:40.279235815 +0200 +@@ -515,7 +515,7 @@ FascistGecosUser(char *password, const c + char gbuffer[STRINGSIZE]; + char tbuffer[STRINGSIZE]; + char *uwords[STRINGSIZE]; +- char longbuffer[STRINGSIZE * 2]; ++ char longbuffer[STRINGSIZE]; + + if (gecos == NULL) + gecos = ""; +@@ -596,38 +596,47 @@ FascistGecosUser(char *password, const c + { + for (i = 0; i < j; i++) + { +- strcpy(longbuffer, uwords[i]); +- strcat(longbuffer, uwords[j]); +- +- if (GTry(longbuffer, password)) ++ if (strlen(uwords[i]) + strlen(uwords[j]) < STRINGSIZE) + { +- return _("it is derived from your password entry"); +- } +- +- strcpy(longbuffer, uwords[j]); +- strcat(longbuffer, uwords[i]); ++ strcpy(longbuffer, uwords[i]); ++ strcat(longbuffer, uwords[j]); + +- if (GTry(longbuffer, password)) +- { +- return _("it's derived from your password entry"); ++ if (GTry(longbuffer, password)) ++ { ++ return _("it is derived from your password entry"); ++ } ++ ++ strcpy(longbuffer, uwords[j]); ++ strcat(longbuffer, uwords[i]); ++ ++ if (GTry(longbuffer, password)) ++ { ++ return _("it's derived from your password entry"); ++ } + } + +- longbuffer[0] = uwords[i][0]; +- longbuffer[1] = '\0'; +- strcat(longbuffer, uwords[j]); +- +- if (GTry(longbuffer, password)) ++ if (strlen(uwords[j]) < STRINGSIZE - 1) + { +- return _("it is derivable from your password entry"); ++ longbuffer[0] = uwords[i][0]; ++ longbuffer[1] = '\0'; ++ strcat(longbuffer, uwords[j]); ++ ++ if (GTry(longbuffer, password)) ++ { ++ return _("it is derivable from your password entry"); ++ } + } + +- longbuffer[0] = uwords[j][0]; +- longbuffer[1] = '\0'; +- strcat(longbuffer, uwords[i]); +- +- if (GTry(longbuffer, password)) ++ if (strlen(uwords[i]) < STRINGSIZE - 1) + { +- return _("it's derivable from your password entry"); ++ longbuffer[0] = uwords[j][0]; ++ longbuffer[1] = '\0'; ++ strcat(longbuffer, uwords[i]); ++ ++ if (GTry(longbuffer, password)) ++ { ++ return _("it's derivable from your password entry"); ++ } + } + } + } -- cgit 1.4.1 From 22df70010aed4254e8bcf8cd8efe47cfcf87a3bd Mon Sep 17 00:00:00 2001 From: Eric Bavier Date: Thu, 7 Jul 2016 00:55:41 -0500 Subject: gnu: Add NetSurf. * gnu/packages/web.scm (netsurf): New variable. * gnu/packages/patches/netsurf-about.patch: New patch. * gnu/local.mk (dist_patch_DATA): Add it. --- gnu/local.mk | 1 + gnu/packages/patches/netsurf-about.patch | 26 +++++++ gnu/packages/web.scm | 116 +++++++++++++++++++++++++++++++ 3 files changed, 143 insertions(+) create mode 100644 gnu/packages/patches/netsurf-about.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index d89004611b..53621d8b94 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -674,6 +674,7 @@ dist_patch_DATA = \ %D%/packages/patches/nasm-no-ps-pdf.patch \ %D%/packages/patches/net-tools-bitrot.patch \ %D%/packages/patches/netcdf-config-date.patch \ + %D%/packages/patches/netsurf-about.patch \ %D%/packages/patches/ngircd-handle-zombies.patch \ %D%/packages/patches/ngircd-no-dns-in-tests.patch \ %D%/packages/patches/ninja-tests.patch \ diff --git a/gnu/packages/patches/netsurf-about.patch b/gnu/packages/patches/netsurf-about.patch new file mode 100644 index 0000000000..1fb8eae824 --- /dev/null +++ b/gnu/packages/patches/netsurf-about.patch @@ -0,0 +1,26 @@ +--- netsurf-all-3.5/netsurf/gtk/about.c ++++ netsurf-all-3.5/netsurf/gtk/about.c +@@ -79,11 +79,11 @@ + switch (response_id) { + + case ABOUT_RESPONSE_ID_LICENCE: +- about_open("about:credits"); ++ about_open("about:licence"); + break; + + case ABOUT_RESPONSE_ID_CREDITS: +- about_open("about:licence"); ++ about_open("about:credits"); + break; + } + +--- netsurf-all-3.5/netsurf/desktop/version.c ++++ netsurf-all-3.5/netsurf/desktop/version.c +@@ -20,6 +20,6 @@ + + #include "desktop/version.h" + +-const char * const netsurf_version = "3.5 (6th April 1016)"; ++const char * const netsurf_version = "3.5 (6th April 2016)"; + const int netsurf_version_major = 3; + const int netsurf_version_minor = 5; diff --git a/gnu/packages/web.scm b/gnu/packages/web.scm index d4b59ddece..29055c3c06 100644 --- a/gnu/packages/web.scm +++ b/gnu/packages/web.scm @@ -52,12 +52,17 @@ #:use-module (gnu packages compression) #:use-module (gnu packages cyrus-sasl) #:use-module (gnu packages databases) + #:use-module (gnu packages bison) + #:use-module (gnu packages flex) #:use-module (gnu packages mit-krb5) #:use-module (gnu packages gd) #:use-module (gnu packages gettext) #:use-module (gnu packages glib) #:use-module (gnu packages gnome) + #:use-module (gnu packages gperf) + #:use-module (gnu packages gtk) #:use-module (gnu packages icu4c) + #:use-module (gnu packages image) #:use-module (gnu packages lua) #:use-module (gnu packages base) #:use-module (gnu packages perl) @@ -3389,3 +3394,114 @@ playback of HTTP request/response traces.") can easily be invoked on a single file. Your partner can access the file with tools they trust (e.g. wget).") (license l:gpl2+))) + +(define-public netsurf + (package + (name "netsurf") + (version "3.5") + (source + (origin + (method url-fetch) + (uri (string-append "https://download.netsurf-browser.org/" + "netsurf/releases/source-full/netsurf-all-" + version ".tar.gz")) + (sha256 + (base32 + "1vdldzcv42wykajmw8vbql0f1yd44gbx30kywfrrh2x3064ly609")) + (modules '((guix build utils))) + (snippet + '(begin + (substitute* "Makefile" + ;; Do not clobber PKG_CONFIG_PATH from the environment + (("PKG_CONFIG_PATH = \\$") + "PKG_CONFIG_PATH := $(PKG_CONFIG_PATH):$") + ;; Honor make variables + (("shell cc") "shell $(CC)")))) + (patches (search-patches "netsurf-about.patch")))) + (build-system glib-or-gtk-build-system) + (native-inputs + `(("pkg-config" ,pkg-config) + ("perl" ,perl) + ("perl-html-parser" ,perl-html-parser) + ("flex" ,flex) + ("bison" ,bison))) + (inputs + `(("gtk+" ,gtk+-2) + ("gperf" ,gperf) + ("curl" ,curl) + ("openssl" ,openssl) + ("libpng" ,libpng) + ("libjpeg" ,libjpeg) + ("expat" ,expat))) + (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 + #:modules ((ice-9 rdelim) + (ice-9 match) + (srfi srfi-1) + (sxml simple) + ,@%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)) + (add-after 'build 'adjust-welcome + (lambda _ + ;; First, fix some unended tags and simple substitutions + (substitute* "netsurf/gtk/res/welcome.html" + (("<(img|input)([^>]*)>" _ tag contents) + (string-append "<" tag contents " />")) + (("Licence") "License") ;prefer GNU spelling + ((" open source") ", free software") + (("web site") "website") + ;; Prefer privacy-respecting default search engine + (("www.google.co.uk") "www.duckduckgo.com/html") + (("Google Search") "DuckDuckGo Search") + (("name=\"btnG\"") "")) + ;; Remove default links so it doesn't seem we're endorsing them + (with-atomic-file-replacement "netsurf/gtk/res/welcome.html" + (lambda (in out) + ;; Leave the DOCTYPE header as is + (display (read-line in 'concat) out) + (sxml->xml + (let rec ((sxml (xml->sxml in))) + ;; We'd like to use sxml-match here, but it can't + ;; match against generic tag symbols... + (match sxml + (`(div (@ (class "links")) . ,rest) + '()) + ((x ...) + (map rec x)) + (x x))) + out))) + #t)) + (add-after 'install 'install-more + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (desktop (string-append out "/share/applications/" + "netsurf.desktop"))) + (mkdir-p (dirname desktop)) + (copy-file "netsurf/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" + (string-append out "/share/man/man1/")) + #t)))))) + (home-page "https://www.netsurf-browser.org") + (synopsis "Web browser") + (description + "NetSurf is a lightweight web browser that has its own layout and +rendering engine entirely written from scratch. It is small and capable of +handling many of the web standards in use today.") + (license l:gpl2+))) -- cgit 1.4.1