all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [PATCH] gnu: unison: Add "doc" output.
@ 2015-12-19  1:42 Eric Bavier
  2015-12-20 20:57 ` Leo Famulari
  2015-12-20 22:11 ` Ludovic Courtès
  0 siblings, 2 replies; 9+ messages in thread
From: Eric Bavier @ 2015-12-19  1:42 UTC (permalink / raw)
  To: guix-devel

* 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 <mhw@netris.org>
 ;;; Copyright © 2015 Andreas Enge <andreas@enge.fr>
 ;;; Copyright © 2015 David Hashe <david.hashe@dhashe.com>
+;;; Copyright © 2015 Eric Bavier <bavier@member.fsf.org>
 ;;;
 ;;; 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

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2016-01-18  9:49 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-19  1:42 [PATCH] gnu: unison: Add "doc" output Eric Bavier
2015-12-20 20:57 ` Leo Famulari
2015-12-20 22:11 ` Ludovic Courtès
2015-12-21  4:01   ` Eric Bavier
2015-12-21 10:39     ` Ludovic Courtès
2016-01-08  7:13       ` Eric Bavier
2016-01-08 10:19         ` Ludovic Courtès
2016-01-17  6:28           ` Eric Bavier
2016-01-18  9:49             ` Ludovic Courtès

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.