summary refs log tree commit diff
diff options
context:
space:
mode:
authorMark H Weaver <mhw@netris.org>2014-07-24 11:38:42 -0400
committerMark H Weaver <mhw@netris.org>2014-08-14 23:53:15 -0400
commit18d2621008c5b41f05bb634a6aaf2e8be228cf10 (patch)
tree861b7804677a1786a5f171b900bdafb4ddee3786
parentfe4163f35141c4bc9c2c8ec7be19a0827c66841b (diff)
downloadguix-18d2621008c5b41f05bb634a6aaf2e8be228cf10.tar.gz
gnu: Add emacs-w3m.
* gnu/packages/emacs.scm (emacs-w3m): New variable.
-rw-r--r--gnu/packages/emacs.scm77
1 files changed, 77 insertions, 0 deletions
diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm
index 7d91f94e62..eb7610a42f 100644
--- a/gnu/packages/emacs.scm
+++ b/gnu/packages/emacs.scm
@@ -37,6 +37,9 @@
   #:use-module (gnu packages giflib)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages version-control)
+  #:use-module (gnu packages imagemagick)
+  #:use-module (gnu packages w3m)
+  #:use-module (gnu packages autotools)
   #:use-module ((gnu packages compression)
                 #:renamer (symbol-prefix-proc 'compression:))
   #:use-module (gnu packages xml)
@@ -249,3 +252,77 @@ example, and you can browse the history of past changes.  There is support for
 cherry picking, reverting, merging, rebasing, and other common Git
 operations.")
     (license gpl3+)))
+
+
+;;;
+;;; Web browsing.
+;;;
+
+(define-public emacs-w3m
+  (package
+    (name "emacs-w3m")
+    (version "1.4.483+0.20120614")
+    (source (origin
+             (method url-fetch)
+             (uri (string-append "mirror://debian/pool/main/w/w3m-el/w3m-el_"
+                                 version ".orig.tar.gz"))
+             (sha256
+              (base32 "0ms181gjavnfk79hhv5xl9llik4c6kj0w3c04kgyif8lcy2sxljx"))))
+    (build-system gnu-build-system)
+    (native-inputs `(("autoconf" ,autoconf)))
+    (inputs `(("w3m" ,w3m)
+              ("imagemagick" ,imagemagick)
+              ("emacs" ,emacs)))
+    (arguments
+     '(#:modules ((guix build gnu-build-system)
+                  (guix build utils)
+                  (guix build emacs-utils))
+       #:imported-modules ((guix build gnu-build-system)
+                           (guix build utils)
+                           (guix build emacs-utils))
+       #:configure-flags
+       (let ((out (assoc-ref %outputs "out")))
+         (list (string-append "--with-lispdir="
+                              out "/share/emacs/site-lisp")
+               (string-append "--with-icondir="
+                              out "/share/images/emacs-w3m")))
+       #:tests? #f  ; no check target
+       #:phases
+       (alist-cons-before
+        'configure 'pre-configure
+        (lambda _
+          (zero? (system* "autoconf")))
+        (alist-cons-before
+         'build 'patch-exec-paths
+         (lambda* (#:key inputs outputs #:allow-other-keys)
+          (let ((out (assoc-ref outputs "out"))
+                (w3m (assoc-ref inputs "w3m"))
+                (imagemagick (assoc-ref inputs "imagemagick"))
+                (coreutils (assoc-ref inputs "coreutils")))
+            (emacs-substitute-variables "w3m.el"
+              ("w3m-command" (string-append w3m "/bin/w3m"))
+              ("w3m-touch-command" (string-append coreutils "/bin/touch"))
+              ("w3m-image-viewer" (string-append imagemagick "/bin/display"))
+              ("w3m-icon-directory" (string-append out
+                                                   "/share/images/emacs-w3m")))
+            (emacs-substitute-variables "w3m-image.el"
+              ("w3m-imagick-convert-program" (string-append imagemagick
+                                                            "/bin/convert"))
+              ("w3m-imagick-identify-program" (string-append imagemagick
+                                                             "/bin/identify")))
+            #t))
+         (alist-replace
+          'install
+          (lambda* (#:key outputs #:allow-other-keys)
+            (and (zero? (system* "make" "install" "install-icons"))
+                 (with-directory-excursion
+                     (string-append (assoc-ref outputs "out")
+                                    "/share/emacs/site-lisp")
+                   (for-each delete-file '("ChangeLog" "ChangeLog.1"))
+                   #t)))
+          %standard-phases)))))
+    (home-page "http://emacs-w3m.namazu.org/")
+    (synopsis "Simple Web browser for Emacs based on w3m")
+    (description
+     "emacs-w3m is an emacs interface for the w3m web browser.")
+    (license gpl2+)))