guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] gnu: unison: Add "doc" output.


From: Eric Bavier
Subject: [PATCH] gnu: unison: Add "doc" output.
Date: Fri, 18 Dec 2015 19:42:15 -0600

* gnu/packages/ocaml.scm (unison-doc): New function.
  (unison)[source]: Use versioned URI.
  [inputs, outputs]: New fields.
  [arguments]: Add 'install-doc phase.
---
 gnu/packages/ocaml.scm | 37 +++++++++++++++++++++++++++++++++++--
 1 file changed, 35 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/ocaml.scm b/gnu/packages/ocaml.scm
index 7f80fc8..241be85 100644
--- a/gnu/packages/ocaml.scm
+++ b/gnu/packages/ocaml.scm
@@ -3,6 +3,7 @@
 ;;; Copyright © 2014, 2015 Mark H Weaver <address@hidden>
 ;;; Copyright © 2015 Andreas Enge <address@hidden>
 ;;; Copyright © 2015 David Hashe <address@hidden>
+;;; Copyright © 2015 Eric Bavier <address@hidden>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -490,6 +491,14 @@ libglade (and it an generate OCaml code
from .glade files), libpanel, librsvg and quartz.")
     (license lgpl2.1)))
 
+(define (unison-doc ext version hash)
+  (origin
+    (method url-fetch)
+    (uri (string-append "https://www.seas.upenn.edu/~bcpierce/unison/";
+                        "download/releases/unison-" version "/unison-"
+                        version "-manual." ext))
+    (sha256 (base32 hash))))
+
 (define-public unison
   (package
     (name "unison")
@@ -498,12 +507,24 @@ libpanel, librsvg and quartz.")
       (origin
         (method url-fetch)
           (uri (string-append "https://www.seas.upenn.edu/~bcpierce/unison/";
-                              "download/releases/stable/unison-" version
-                              ".tar.gz"))
+                              "download/releases/unison-" version "/unison-"
+                              version ".tar.gz"))
           (sha256
             (base32
               "10sln52rnnsj213jy3166m0q97qpwnrwl6mm529xfy10x3xkq3gl"))))
     (build-system gnu-build-system)
+    (outputs '("out"
+               "doc"))                  ; 1.5 MiB of documentation
+    (inputs
+     `(("doc-pdf"
+        ,(unison-doc "pdf" version
+                     "0y5mywjn352nw4wqli94gnc5vn1f72g56jqqk1nqajz0ark998nb"))
+       ("doc-ps"
+        ,(unison-doc "ps" version
+                     "11awy1xxhmckwnx42hllmngmx8q4ck18vpwpgfqqhj0x8vx0b3ha"))
+       ("doc-html"
+        ,(unison-doc "html" version
+                     "06myrpv067j5ffm265fm0a83gm41j9bv3ps3yiyb1hqgfy1qy3ah"))))
(native-inputs `(("ocaml" ,ocaml)))
     (arguments
@@ -522,6 +543,18 @@ libpanel, librsvg and quartz.")
                       (bin (string-append out "/bin")))
                  (mkdir-p bin)
                  (setenv "HOME" out) ; forces correct INSTALLDIR in Makefile
+                 #t)))
+           (add-after 'install 'install-doc
+             (lambda* (#:key inputs outputs #:allow-other-keys)
+               (let ((doc (string-append (assoc-ref outputs "doc")
+                                         "/share/doc/unison")))
+                 (mkdir-p doc)
+                 (for-each
+                  (lambda (i)
+                    (let* ((file (assoc-ref inputs i))
+                           (dest (strip-store-file-name file)))
+                      (copy-file file (string-append doc "/" dest))))
+                  '("doc-pdf" "doc-ps" "doc-html"))
                  #t))))))
     (home-page "https://www.cis.upenn.edu/~bcpierce/unison/";)
     (synopsis "File synchronizer")
-- 
2.6.3




reply via email to

[Prev in Thread] Current Thread [Next in Thread]