From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alex Kost Subject: Re: [PATCH] gnu: Add NetSurf. Date: Tue, 16 Aug 2016 10:43:22 +0300 Message-ID: <87fuq5gnvp.fsf@gmail.com> References: <20160811125915.17723-1-ericbavier@openmailbox.org> <20160816010326.391ff6de@openmailbox.org> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:37561) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bZZ1z-0008SP-J2 for guix-devel@gnu.org; Tue, 16 Aug 2016 03:43:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bZZ1w-0007gU-2x for guix-devel@gnu.org; Tue, 16 Aug 2016 03:43:27 -0400 Received: from mail-wm0-x235.google.com ([2a00:1450:400c:c09::235]:37180) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bZZ1v-0007gK-PG for guix-devel@gnu.org; Tue, 16 Aug 2016 03:43:24 -0400 Received: by mail-wm0-x235.google.com with SMTP id i5so148386824wmg.0 for ; Tue, 16 Aug 2016 00:43:23 -0700 (PDT) In-Reply-To: <20160816010326.391ff6de@openmailbox.org> (Eric Bavier's message of "Tue, 16 Aug 2016 01:03:26 -0500") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Eric Bavier Cc: guix-devel@gnu.org, Eric Bavier Eric Bavier (2016-08-16 09:03 +0300) wrote: Impressive work on this package, thanks! > From 3aa59b69066d8850b3f62d05020df5aae0fbded3 Mon Sep 17 00:00:00 2001 > From: Eric Bavier > Date: Thu, 7 Jul 2016 00:55:41 -0500 > Subject: [PATCH] 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. [...] > + (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* (#:key outputs #:allow-other-keys) 'outputs' arg is not used in this phase, so it can simply be (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* _ Just 'lambda' (without *) > + ;; 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+))) -- Alex