From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Bavier Subject: [PATCH] gnu: unison: Add "doc" output. Date: Fri, 18 Dec 2015 19:42:15 -0600 Message-ID: <20151218194215.50af651c@openmailbox.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:52287) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aAB8l-0005K2-GB for guix-devel@gnu.org; Sat, 19 Dec 2015 01:37:16 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aAB8i-0000ye-9t for guix-devel@gnu.org; Sat, 19 Dec 2015 01:37:15 -0500 Received: from mail2.openmailbox.org ([62.4.1.33]:49389) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aAB8i-0000yY-0g for guix-devel@gnu.org; Sat, 19 Dec 2015 01:37:12 -0500 List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: guix-devel@gnu.org * 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 =C2=A9 2014, 2015 Mark H Weaver ;;; Copyright =C2=A9 2015 Andreas Enge ;;; Copyright =C2=A9 2015 David Hashe +;;; Copyright =C2=A9 2015 Eric Bavier ;;; ;;; 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))) =20 +(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 Makefi= le + #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") --=20 2.6.3