From 385343b1370d87e6104ebe2ef473bf2d1e31f2f2 Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer Date: Sun, 4 Feb 2018 14:05:40 -0500 Subject: [PATCH] gnu: mcron2: Correct and enhance the wrap phase. * gnu/packages/guile.scm (mcron2)[inputs]: Rename "guile-2.2" to just "guile". [phases]: Install mcron2 modules to guile/site/2.2 instead of guile/site/2.0. Add Guile 2.2 and GnuTLS modules to the wrap phase. --- gnu/packages/guile.scm | 43 ++++++++++++++++++++++++++----------------- 1 file changed, 26 insertions(+), 17 deletions(-) diff --git a/gnu/packages/guile.scm b/gnu/packages/guile.scm index 3bc18ffdd..37e6703fa 100644 --- a/gnu/packages/guile.scm +++ b/gnu/packages/guile.scm @@ -64,6 +64,7 @@ #:use-module (gnu packages sdl) #:use-module (gnu packages maths) #:use-module (gnu packages image) + #:use-module (gnu packages tls) #:use-module (gnu packages version-control) #:use-module (gnu packages xdisorg) #:use-module (gnu packages xorg) @@ -632,7 +633,8 @@ format is also supported.") ("texinfo" ,texinfo) ("help2man" ,help2man))) (inputs - `(("guile-2.2" ,guile-2.2) + `(("guile" ,guile-2.2) + ("gnutls" ,gnutls) ;for the wrap-mcron phase ,@(srfi-1:alist-delete "guile" (package-inputs mcron)))) (arguments `(#:modules ((ice-9 match) (ice-9 ftw) @@ -645,6 +647,7 @@ format is also supported.") (add-after 'unpack 'use-guile-2.2 (lambda _ (substitute* "configure.ac" + (("guile/site/2.0") "guile/site/2.2") (("PKG_CHECK_MODULES\\(\\[GUILE\\],.*$") "PKG_CHECK_MODULES([GUILE], [guile-2.2])\n")) #t)) @@ -652,22 +655,28 @@ format is also supported.") (lambda _ (invoke "autoreconf" "-vfi"))) (add-after 'install 'wrap-mcron - (lambda* (#:key outputs #:allow-other-keys) - ;; Wrap the 'mcron' command to refer to the right - ;; modules. - (let* ((out (assoc-ref outputs "out")) - (bin (string-append out "/bin")) - (site (string-append - out "/share/guile/site"))) - (match (scandir site) - (("." ".." version) - (let ((modules (string-append site "/" version))) - (wrap-program (string-append bin "/mcron") - `("GUILE_LOAD_PATH" ":" prefix - (,modules)) - `("GUILE_LOAD_COMPILED_PATH" ":" prefix - (,modules))) - #t)))))))))))) + (lambda* (#:key inputs outputs #:allow-other-keys) + ;; Wrap the 'mcron' command to refer to the right modules. We + ;; also include Guile 2.2 modules and GnuTLS, so that Guile + ;; libraries can be used in mcron jobs without having to + ;; propagate those in a user profile. + (let* ((site-dir "/share/guile/site/2.2") + (ccache-dir "/lib/guile/2.2/ccache") + (mcron (assoc-ref outputs "out")) + (mcron-bin (string-append mcron "/bin/mcron")) + (mcron-modules (string-append mcron site-dir)) + (guile (assoc-ref inputs "guile")) + (guile-modules (string-append guile site-dir)) + (guile-ccache (string-append guile ccache-dir)) + (gnutls (assoc-ref inputs "gnutls")) + (gnutls-modules (string-append gnutls site-dir)) + (gnutls-ccache (string-append gnutls ccache-dir))) + (wrap-program mcron-bin + `("GUILE_LOAD_PATH" ":" prefix + (,mcron-modules ,guile-modules ,gnutls-modules)) + `("GUILE_LOAD_COMPILED_PATH" ":" prefix + (,mcron-modules ,guile-ccache ,gnutls-ccache))) + #t))))))))) (define-public guile-ics (package -- 2.16.0