From 34e00c7ba4686a5e589b8a0be25319302a4c0697 Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Thu, 10 May 2018 15:30:04 +0530 Subject: gnu: guile-dbi: Fix RPATH and dependencies. Prior to this change, libguile-dbi.so was unable to find libguile-dbd-sqlite3.so. * gnu/packages/guile.scm (guile-dbi-bootstrap): New variable. (guile-dbd-sqlite3)[propagated-inputs]: Remove guile-dbi. [native-inputs]: Add guile-dbi-bootstrap. (guile-dbi)[inputs]: Add guile-dbd-sqlite3. [arguments]: Set RPATH using #:make-flags. --- gnu/packages/guile.scm | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'gnu/packages/guile.scm') diff --git a/gnu/packages/guile.scm b/gnu/packages/guile.scm index 38076081b3..d5ca29584a 100644 --- a/gnu/packages/guile.scm +++ b/gnu/packages/guile.scm @@ -17,6 +17,7 @@ ;;; Copyright © 2017 Nils Gillmann ;;; Copyright © 2017 Tobias Geerinckx-Rice ;;; Copyright © 2018 Maxim Cournoyer +;;; Copyright © 2018 Arun Isaac ;;; ;;; This file is part of GNU Guix. ;;; @@ -1549,6 +1550,9 @@ provides access to that interface and its types from the Scheme level.") '(#:configure-flags (list (string-append "--with-guile-site-dir=" %output "/share/guile/site/2.2")) + #:make-flags + (list (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib:" + (assoc-ref %build-inputs "guile-dbd-sqlite3") "/lib")) #:phases (modify-phases %standard-phases (add-after 'install 'patch-extension-path @@ -1559,6 +1563,8 @@ provides access to that interface and its types from the Scheme level.") (ext (string-append out "/lib/libguile-dbi"))) (substitute* dbi.scm (("libguile-dbi") ext)) #t)))))) + (inputs + `(("guile-dbd-sqlite3" ,guile-dbd-sqlite3))) ; only shared library, no scheme files (propagated-inputs `(("guile" ,guile-2.2))) (synopsis "Guile database abstraction layer") @@ -1570,6 +1576,15 @@ programming interface is presented regardless of which database system is used. It currently supports MySQL, Postgres and SQLite3.") (license license:gpl2+))) +(define guile-dbi-bootstrap + (package + (inherit guile-dbi) + (name "guile-dbi-bootstrap") + (inputs '()) + (arguments + (substitute-keyword-arguments (package-arguments guile-dbi) + ((#:make-flags _) '(list)))))) + (define-public guile-dbd-sqlite3 (package (name "guile-dbd-sqlite3") @@ -1584,12 +1599,11 @@ It currently supports MySQL, Postgres and SQLite3.") "0rg71jchxd2y8x496s8zmfmikr5g8zxi8zv2ar3f7a23pph92iw2")))) (build-system gnu-build-system) (native-inputs - `(("pkg-config" ,pkg-config))) + `(("pkg-config" ,pkg-config) + ("guile-dbi-bootstrap" ,guile-dbi-bootstrap))) ; only required for headers (inputs `(("sqlite" ,sqlite) ("zlib" ,(@ (gnu packages compression) zlib)))) - (propagated-inputs - `(("guile-dbi" ,guile-dbi))) (synopsis "Guile DBI driver for SQLite") (home-page "https://github.com/jkalbhenn/guile-dbd-sqlite3") (description -- cgit v1.2.3 From f858e58f192a888273610e87baf34e68b7285e66 Mon Sep 17 00:00:00 2001 From: Rouby Pierre-Antoine Date: Tue, 15 May 2018 11:22:04 +0200 Subject: gnu: Add guile-simple-zmq. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/package/guile.scm (guile-simple-zmq): New variable. Signed-off-by: Ludovic Courtès --- gnu/packages/guile.scm | 91 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 91 insertions(+) (limited to 'gnu/packages/guile.scm') diff --git a/gnu/packages/guile.scm b/gnu/packages/guile.scm index d5ca29584a..9e24e90c23 100644 --- a/gnu/packages/guile.scm +++ b/gnu/packages/guile.scm @@ -18,6 +18,7 @@ ;;; Copyright © 2017 Tobias Geerinckx-Rice ;;; Copyright © 2018 Maxim Cournoyer ;;; Copyright © 2018 Arun Isaac +;;; Copyright © 2018 Pierre-Antoine Rouby ;;; ;;; This file is part of GNU Guix. ;;; @@ -67,6 +68,7 @@ #:use-module (gnu packages version-control) #:use-module (gnu packages xdisorg) #:use-module (gnu packages xorg) + #:use-module (gnu packages networking) #:use-module (guix packages) #:use-module (guix download) #:use-module (guix git-download) @@ -2116,4 +2118,93 @@ It has a nice, simple s-expression based syntax.") "Guile-colorized provides you with a colorized REPL for GNU Guile.") (license license:gpl3+))) +(define-public guile-simple-zmq + (let ((commit "d76657aeb1cd10ef8136edc06bb90999914c7c3c") + (revision "0")) + (package + (name "guile-simple-zmq") + (version (git-version "0.0.0" revision commit)) + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/jerry40/guile-simple-zmq") + (commit commit))) + (sha256 + (base32 + "1w73dy5gpyv33jn34dqlkqpwh9w4y8wm6hgvbpb3wbp6xsa2mk4z")) + (file-name (git-file-name name version)))) + (build-system trivial-build-system) + (arguments + `(#:modules ((guix build utils)) + #:builder + (begin + (use-modules (guix build utils) + (srfi srfi-26) + (ice-9 match) + (ice-9 popen) + (ice-9 rdelim)) + + (let* ((out (assoc-ref %outputs "out")) + (guile (assoc-ref %build-inputs "guile")) + (effective (read-line + (open-pipe* OPEN_READ + (string-append guile "/bin/guile") + "-c" "(display (effective-version))"))) + (module-dir (string-append out "/share/guile/site/" + effective)) + (go-dir (string-append out "/lib/guile/" + effective "/site-ccache/")) + (source (string-append (assoc-ref %build-inputs "source") + "/src")) + (scm-file "simple-zmq.scm") + (guild (string-append (assoc-ref %build-inputs "guile") + "/bin/guild")) + (zmq (assoc-ref %build-inputs "zeromq")) + (deps (list zmq)) + (path (string-join + (map (cut string-append <> + "/lib/") + deps) + ":"))) + ;; Make installation directories. + (mkdir-p module-dir) + (mkdir-p go-dir) + + ;; Compile .scm files and install. + (chdir source) + (setenv "GUILE_AUTO_COMPILE" "0") + (for-each (lambda (file) + (let* ((dest-file (string-append module-dir "/" + file)) + (go-file (match (string-split file #\.) + ((base _) + (string-append go-dir "/" + base ".go"))))) + ;; Install source module. + (copy-file file dest-file) + (substitute* dest-file + (("\\(dynamic-link \"libzmq\"\\)") + (format #f "(dynamic-link \"~a/lib/libzmq.so\")" + (assoc-ref %build-inputs "zeromq")))) + + ;; Install and compile module. + (unless (zero? (system* guild "compile" + "-L" source + "-o" go-file + dest-file)) + (error (format #f "Failed to compile ~s to ~s!" + file go-file))))) + (list scm-file)) + #t)))) + (propagated-inputs + `(("guile" ,guile-2.2) + ("zeromq" ,zeromq))) + (home-page "https://github.com/jerry40/guile-simple-zmq") + (synopsis "Guile wrapper over ZeroMQ library") + (description + "This package provides a Guile programming interface to the ZeroMQ +messaging library.") + (license license:gpl3+)))) + ;;; guile.scm ends here -- cgit v1.2.3