From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56658) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1egkb1-0007bk-10 for guix-patches@gnu.org; Wed, 31 Jan 2018 00:06:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1egkax-000773-31 for guix-patches@gnu.org; Wed, 31 Jan 2018 00:06:07 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:42284) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1egkaw-00076I-UQ for guix-patches@gnu.org; Wed, 31 Jan 2018 00:06:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1egkaw-0007fH-Kp for guix-patches@gnu.org; Wed, 31 Jan 2018 00:06:02 -0500 Subject: [bug#30300] [PATCH] gnu: mcron2: Use Guile 2.2 instead of 2.0. Resent-Message-ID: Received: from eggs.gnu.org ([2001:4830:134:3::10]:56516) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1egka7-0007IR-FP for guix-patches@gnu.org; Wed, 31 Jan 2018 00:05:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1egka1-0005vJ-DY for guix-patches@gnu.org; Wed, 31 Jan 2018 00:05:11 -0500 Received: from mail-it0-x22c.google.com ([2607:f8b0:4001:c0b::22c]:33465) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1egka1-0005v3-5f for guix-patches@gnu.org; Wed, 31 Jan 2018 00:05:05 -0500 Received: by mail-it0-x22c.google.com with SMTP id u12so4808815ite.0 for ; Tue, 30 Jan 2018 21:05:04 -0800 (PST) Received: from apteryx ([45.72.232.234]) by smtp.gmail.com with ESMTPSA id o137sm8791526ito.5.2018.01.30.21.05.03 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 30 Jan 2018 21:05:03 -0800 (PST) From: Maxim Cournoyer Date: Wed, 31 Jan 2018 00:05:02 -0500 Message-ID: <87r2q61uv5.fsf@gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 30300@debbugs.gnu.org --=-=-= Content-Type: text/plain Hello, This updates our mcron2 packages (used by default in our mcron service) to Guile 2.2, so that we can use new goodies in our job scripts. Here's an example that didn't work before with Guile 2.0, because its http-get method lacked HTTPS support: --8<---------------cut here---------------start------------->8--- (define duckdns-job ;; Update personal domain IP every 5 minutes. #~(job '(next-minute (range 0 60 5)) (lambda () (use-modules (web client)) (http-get (string-append "https://www.duckdns.org/update?domains=apteryx&token=" #$sec-dyndns-token "&ip="))))) --8<---------------cut here---------------end--------------->8--- I've also fixed the manual page which was failing to be generated for mcron2. Thank you, Maxim --=-=-= Content-Type: text/x-patch; charset=utf-8 Content-Disposition: attachment; filename=0001-gnu-mcron2-Use-Guile-2.2-instead-of-2.0.patch Content-Transfer-Encoding: quoted-printable >From 2525c59459b7a66fbe6b5f093bdceb97d66c82eb Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer Date: Tue, 30 Jan 2018 22:38:10 -0500 Subject: [PATCH] gnu: mcron2: Use Guile 2.2 instead of 2.0. Motivation: Using Guile 2.2 instead of Guile 2.0 gives us the scripting abilities of Guile 2.2 when writing mcron jobs, such as HTTPS support. * gnu/packages/guile.scm (gnu): Use the srfi-1 module for the alist-delete function. (mcron2)[inputs]: Replace guile-2.0 with guile-2.2. [parallel-build?]: Disable to fix manual page generation. [phases]: Add a "use-guile-2.2" phase so the build system uses Guile 2.2. Replace `system*' with `invoke' in the "bootstrap" phase. --- gnu/packages/guile.scm | 60 +++++++++++++++++++++++++++++++---------------= ---- 1 file changed, 37 insertions(+), 23 deletions(-) diff --git a/gnu/packages/guile.scm b/gnu/packages/guile.scm index a778bbf45..3bc18ffdd 100644 --- a/gnu/packages/guile.scm +++ b/gnu/packages/guile.scm @@ -16,6 +16,7 @@ ;;; Copyright =C2=A9 2017 Theodoros Foradis ;;; Copyright =C2=A9 2017 ng0 ;;; Copyright =C2=A9 2017 Tobias Geerinckx-Rice +;;; Copyright =C2=A9 2018 Maxim Cournoyer ;;; ;;; This file is part of GNU Guix. ;;; @@ -72,7 +73,8 @@ #:use-module (guix build-system gnu) #:use-module (guix build-system trivial) #:use-module (guix utils) - #:use-module (ice-9 match)) + #:use-module (ice-9 match) + #:use-module ((srfi srfi-1) #:prefix srfi-1:)) =20 ;;; Commentary: ;;; @@ -629,31 +631,43 @@ format is also supported.") ("pkg-config" ,pkg-config) ("texinfo" ,texinfo) ("help2man" ,help2man))) + (inputs + `(("guile-2.2" ,guile-2.2) + ,@(srfi-1:alist-delete "guile" (package-inputs mcron)))) (arguments `(#:modules ((ice-9 match) (ice-9 ftw) ,@%gnu-build-system-modules) - - #:phases (modify-phases %standard-phases - (add-after 'unpack 'bootstrap - (lambda _ - (zero? (system* "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 "/" versio= n))) - (wrap-program (string-append bin "/mcron") - `("GUILE_LOAD_PATH" ":" prefix - (,modules)) - `("GUILE_LOAD_COMPILED_PATH" ":" prefix - (,modules))) - #t)))))))))))) + ;; When building the targets in parallel, help2man tries to gener= ate + ;; the manpage from ./cron --help before it is built, which fails. + #:parallel-build? #f + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'use-guile-2.2 + (lambda _ + (substitute* "configure.ac" + (("PKG_CHECK_MODULES\\(\\[GUILE\\],.*$") + "PKG_CHECK_MODULES([GUILE], [guile-2.2])\n")) + #t)) + (add-after 'use-guile-2.2 'bootstrap + (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)))))))))))) =20 (define-public guile-ics (package --=20 2.16.0 --=-=-=--