[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] gnu: Add NetSurf.
From: |
Alex Kost |
Subject: |
Re: [PATCH] gnu: Add NetSurf. |
Date: |
Tue, 16 Aug 2016 10:43:22 +0300 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) |
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 <address@hidden>
> 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