>From a73293cb66f3978e60e1244124cd28b623d6c30c Mon Sep 17 00:00:00 2001 From: Roel Janssen Date: Tue, 10 May 2016 15:55:52 +0200 Subject: [PATCH 2/2] gnu: graphviz: Add graphviz-guile. * gnu/packages/graphviz.scm (graphviz): New variable. --- gnu/packages/graphviz.scm | 48 ++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 47 insertions(+), 1 deletion(-) diff --git a/gnu/packages/graphviz.scm b/gnu/packages/graphviz.scm index 489a71c..f9c49ef 100644 --- a/gnu/packages/graphviz.scm +++ b/gnu/packages/graphviz.scm @@ -20,7 +20,9 @@ (define-module (gnu packages graphviz) #:use-module (guix packages) #:use-module (guix build-system gnu) + #:use-module (guix build-system trivial) #:use-module (guix download) + #:use-module (gnu packages base) #:use-module (gnu packages xorg) #:use-module (gnu packages gtk) #:use-module (gnu packages xml) @@ -34,7 +36,7 @@ #:use-module (gnu packages compression) #:use-module (gnu packages gd) #:use-module (gnu packages swig) - #:use-module ((guix licenses) #:select (lgpl2.0+ epl1.0))) + #:use-module ((guix licenses) #:select (gpl3+ lgpl2.0+ epl1.0))) (define-public graphviz (package @@ -111,6 +113,50 @@ software engineering, database and web design, machine learning, and in visual interfaces for other technical domains.") (license epl1.0))) +(define-public graphviz-guile + (package + (name "graphviz-guile") + (version "1.0") + (source (origin + (method url-fetch) + (uri (string-append + "https://github.com/roelj/graphviz-guile/archive/v" + version ".tar.gz")) + (sha256 + (base32 "1ccmr4isj85j7djg9m56n54rqq1z94bjmrrs6vv4qdcp6ihv3c3r")) + (file-name (string-append name "-" version ".tar.gz")))) + (build-system trivial-build-system) + (arguments + `(#:modules ((guix build utils)) + #:builder + (begin + (use-modules (guix build utils)) + (let ((tar (string-append (assoc-ref %build-inputs "tar") "/bin/tar")) + (PATH (string-append (assoc-ref %build-inputs "gzip") "/bin")) + (dest-dir (string-append %output "/share/guile/site/2.0")) + (gv (string-append (assoc-ref %build-inputs "graphviz") + "/lib/guile/2.0"))) + (setenv "PATH" PATH) + (mkdir-p dest-dir) + (system* tar "xvf" (assoc-ref %build-inputs "source")) + (chdir "graphviz-guile-1.0") + ;; Use the absolute path to the graphviz library so that + ;; Guix can find it. + (substitute* "graphviz.scm" + (("libgv_guile.so") (string-append gv "/libgv_guile.so"))) + (copy-file "graphviz.scm" + (string-append dest-dir "/graphviz.scm")))))) + (native-inputs + `(("tar" ,tar) + ("gzip" ,gzip))) + (propagated-inputs + `(("graphviz" ,graphviz))) + (home-page "https://github.com/roelj/graphviz-guile") + (synopsis "Graphviz module for Guile") + (description "This package provides a Graphviz module file for Guile. It +uses the library provided by the Graphviz package.") + (license gpl3+))) + (define-public gts (package (name "gts") -- 2.7.4