summary refs log tree commit diff
path: root/gnu/packages/web.scm
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/packages/web.scm')
-rw-r--r--gnu/packages/web.scm126
1 files changed, 123 insertions, 3 deletions
diff --git a/gnu/packages/web.scm b/gnu/packages/web.scm
index fa791ffbe1..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)
@@ -453,7 +458,7 @@ for efficient socket-like bidirectional reliable communication channels.")
 (define-public libpsl
   (package
     (name "libpsl")
-    (version "0.13.0")
+    (version "0.14.0")
     (source (origin
               (method url-fetch)
               (uri (string-append "https://github.com/rockdaboot/libpsl/"
@@ -461,7 +466,7 @@ for efficient socket-like bidirectional reliable communication channels.")
                                   "/libpsl-" version ".tar.gz"))
               (sha256
                (base32
-                "0afn2c4s2m65xifa5sfdll0s2gyqbh2q9k9nq4nsmx1b6c2i3i7x"))))
+                "1yrfkwjw5b9y9qb4xqw7g0hk0wdscay701c1wkg8fp7lxny99iz8"))))
     (build-system gnu-build-system)
     (inputs
      `(("icu4c" ,icu4c)
@@ -3293,7 +3298,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
@@ -3385,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&nbsp;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+)))