;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 Ludovic Courtès ;;; Copyright © 2014 Cyril Roelandt ;;; Copyright © 2014, 2016, 2018 David Thompson ;;; Copyright © 2014, 2017, 2018 Mark H Weaver ;;; Copyright © 2015, 2017 Christopher Allan Webber ;;; Copyright © 2016 Jan Nieuwenhuizen ;;; Copyright © 2016, 2017 Leo Famulari ;;; Copyright © 2016, 2019, 2020 Ricardo Wurmus ;;; Copyright © 2017 Andy Wingo ;;; Copyright © 2017 Marius Bakke ;;; Copyright © 2017, 2019 Mathieu Othacehe ;;; Copyright © 2017 Tobias Geerinckx-Rice ;;; Copyright © 2017, 2018 Amirouche ;;; Copyright © 2018 Danny Milosavljevic ;;; Copyright © 2018 E
aboutsummaryrefslogtreecommitdiff
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2016-2020, 2023 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2022 Maxim Cournoyer <maxim.cournoyer@gmail.com>
;;; Copyright © 2023 Bruno Victal <mirai@makinata.eu>
;;;
;;; This file is part of GNU Guix.
;;;
;;; GNU Guix is free software; you can redistribute it and/or modify it
;;; under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 3 of the License, or (at
;;; your option) any later version.
;;;
;;; GNU Guix is distributed in the hope that it will be useful, but
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.

(define-module (gnu services mcron)
  #:use-module (gnu services)
  #:use-module ((gnu services configuration) #:select
                (define-configuration/no-serialization))
  #:use-module (gnu services shepherd)
  #:use-module (gnu system privilege)
  #:use-module (gnu packages guile-xyz)
  #:use-module ((guix packages) #:select (package?))
  #:use-module (guix records)
  #:use-module (guix gexp)
  #:use-module (srfi srfi-1)
  #:use-module (ice-9 match)
  #:use-module (ice-9 vlist)
  #:export (mcron-configuration
            mcron-configuration?
            mcron-configuration-mcron
            mcron-configuration-jobs
            mcron-configuration-log?
            mcron-configuration-log-file
            mcron-configuration-log-format
            mcron-configuration-date-format
            mcron-configuration-home-service?

            mcron-service-type

            cron-daemon-configuration
            cron-daemon-configuration-cron
            cron-daemon-configuration-
            cron-daemon-service-type))

;;; Commentary:
;;;
;;; This module implements a service that to run instances of GNU mcron, a
;;; periodic job execution daemon.  Example of a service:
;;
;;  (service mcron-service-type
;;           (mcron-configuration
;;            (jobs (list #~(job next-second-from
;;                               (lambda ()
;;                                 (call-with-output-file "/dev/console"
;;                                   (lambda (port)
;;                                     (display "hello!\n" port)))))))))
;;;
;;; Code:

;; Configuration of mcron.
;; XXX: 'define-configuration' cannot be used here due to the need for
;; 'thunked' and 'innate' fields as well as 'this-mcron-configuration'.
(define-record-type* <mcron-configuration> mcron-configuration
  make-mcron-configuration
  mcron-configuration?
  this-mcron-configuration

  (mcron       mcron-configuration-mcron          ;file-like
               (default mcron))
  (jobs        mcron-configuration-jobs           ;list of gexps
               (default '()))
  (log?        mcron-configuration-log?           ;Boolean
               (default #t))
  (log-file    mcron-configuration-log-file       ;string | gexp
               (thunked)
               (default
                 (if (mcron-configuration-home-service?
                      this-mcron-configuration)
                     #~(string-append %user-log-dir "/mcron.log")
                     "/var/log/mcron.log")))
  (log-format  mcron-configuration-log-format     ;string
               (default "~1@*~a ~a: ~a~%"))
  (date-format mcron-configuration-date-format    ;string | #f
               (default #f))

  (home-service? mcron-configuration-home-service?
                 (default for-home?) (innate)))

(define (job-files mcron jobs)
  "Return a list of file-like object for JOBS, a list of gexps."
  (define (validated-file job)
    ;; This procedure behaves like 'scheme-file' but it runs 'mcron
    ;; --schedule' to detect any error in JOB.
    (computed-file "mcron-job"
                   (with-imported-modules '((guix build utils))
                     #~(begin
                         (use-modules (guix build utils))

                         (call-with-output-file "prologue"
                           (lambda (port)
                             ;; This prologue allows 'mcron --schedule' to
                             ;; proceed no matter what #:user option is passed
                             ;; to 'job'.
                             (write '(set! getpw
                                       (const (getpwuid (getuid))))
                                    port)))

                         (call-with-output-file "job"
                           (lambda (port)
                             (write '#$job port)))

                         (invoke #+(file-append mcron "/bin/mcron")
                                 "--schedule=20" "prologue" "job")
                         (copy-file "job" #$output)))
                   #:options '(#:env-vars (("COLUMNS" . "150")))))

  (map validated-file jobs))

(define (shepherd-schedule-action mcron files)
  "Return a Shepherd action that runs MCRON with '--schedule' for the given
files."
  (shepherd-action
   (name 'schedule)
   (documentation
    "Display jobs that are going to be scheduled.")
   (procedure
    #~(lambda* (_ #:optional (n "5"))
        ;; XXX: This is a global side effect.
        (setenv "GUILE_AUTO_COMPILE" "0")

        ;; Run 'mcron' in a pipe so we can explicitly redirect its output to
        ;; 'current-output-port', which at this stage is bound to the client
        ;; connection.
        (let ((pipe (open-pipe* OPEN_READ
                                #$(file-append mcron "/bin/mcron")
                                (string-append "--schedule=" n)
                                #$@files)))
          (let loop ()
            (match (read-line pipe 'concat)
              ((? eof-object?)
               (catch 'system-error
                 (lambda ()
                   (zero? (close-pipe pipe)))
                 (lambda args
                   ;; There's a race with the SIGCHLD handler, which
                   ;; could call 'waitpid' before 'close-pipe' above does.  If
                   ;; we get ECHILD, that means we lost the race, but that's
                   ;; fine.
                   (or (= ECHILD (system-error-errno args))
                       (apply throw args)))))
              (line
               (display line)
               (loop)))))))))

(define (mcron-shepherd-services config)
  (match-record config <mcron-configuration>
    (mcron jobs log? log-file log-format date-format home-service?)
    (if (eq? jobs '())
        '()                             ;nothing to do
        (let ((files (job-files mcron jobs)))
          (list (shepherd-service
                 (provision '(mcron))
                 (requirement (if home-service?
                                  '()
                                  '(user-processes)))
                 (modules `((srfi srfi-1)
                            (srfi srfi-26)
                            (ice-9 popen) ;for the 'schedule' action
                            (ice-9 rdelim)
                            (ice-9 match)
                            ((shepherd support) #:hide (mkdir-p)) ;for '%user-log-dir'
                            ,@%default-modules))
                 (start #~(make-forkexec-constructor
                           (list #$(file-append mcron "/bin/mcron")
                                 #$@(if log?
                                        `("--log" "--log-format" ,log-format
                                          ,@(if date-format
                                                (list "--date-format"
                                                      date-format)
                                                '()))
                                        '())
                                 #$@files)

                           ;; Disable auto-compilation of the job files and
                           ;; set a sane value for 'PATH'.
                           #:environment-variables
                           (cons* "GUILE_AUTO_COMPILE=0"
                                  #$(if home-service?
                                        '(environ)
                                        '(cons*
                                          "PATH=/run/current-system/profile/bin"
                                          (remove (cut string-prefix? "PATH=" <>)
                                                  (environ)))))

                           #:log-file #$log-file))
                 (stop #~(make-kill-destructor))
                 (actions
                  (list (shepherd-schedule-action mcron files)))))))))

(define mcron-service-type
  (service-type (name 'mcron)
                (description
                 "Run the mcron job scheduling daemon.")
                (extensions
                 (list (service-extension shepherd-root-service-type
                                          mcron-shepherd-services)
                       (service-extension profile-service-type
                                          (compose list
                                                   mcron-configuration-mcron))))
                (compose concatenate)
                (extend (lambda (config jobs)
                          (mcron-configuration
                           (inherit config)
                           (home-service?
                            (mcron-configuration-home-service? config))
                           (jobs (append (mcron-configuration-jobs config)
                                         jobs)))))
                (default-value (mcron-configuration)))) ;empty job list



(define-configuration/no-serialization cron-daemon-configuration
  (cron
   (package mcron)
   "The cron package to use.")
  (monitor-etc?
   (boolean #f)
   "Whether to check /etc/crontab for updates."))

(define (cron-daemon-shepherd-services config)
  (list (shepherd-service
         (provision '(cron-daemon))
         (start #~(make-forkexec-constructor
                   '(#$(file-append (cron-daemon-configuration-cron config)
                                    "/sbin/cron")
                     #$@(if (cron-daemon-configuration-monitor-etc? config)
                            '()
                            '("--noetc")))
                   #:pid-file "/var/run/cron.pid"))
         (stop #~(make-kill-destructor)))))

(define cron-daemon-activation
  (const #~(mkdir-p "/var/cron/tabs")))

(define (cron-daemon-setuid-programs config)
  (list (privileged-program
         (program (file-append (cron-daemon-configuration-cron config)
                               "/sbin/crontab-access")))))

(define cron-daemon-service-type
  (service-type (name 'cron-daemon)
                (description
                 "Run the traditional cron daemon.")
                (extensions
                 (list (service-extension shepherd-root-service-type
                                          cron-daemon-shepherd-services)
                       (service-extension activation-service-type
                                          cron-daemon-activation)
                       (service-extension privileged-program-service-type
                                          cron-daemon-setuid-programs)))
                (default-value (cron-daemon-configuration))))

;;; mcron.scm ends here
time . 36000))))) ;10 hours (needed on ARM ; when heavily loaded) (define* (make-guile-readline guile #:optional (name "guile-readline")) (package (name name) (version (package-version guile)) (source (package-source guile)) (build-system gnu-build-system) (arguments '(#:configure-flags '("--disable-silent-rules") #:phases (modify-phases %standard-phases (add-before 'build 'chdir (lambda* (#:key outputs #:allow-other-keys) (invoke "make" "-C" "libguile" "scmconfig.h") (invoke "make" "-C" "lib") (chdir "guile-readline") (substitute* "Makefile" (("../libguile/libguile-[[:graph:]]+\\.la") ;; Remove dependency on libguile-X.Y.la. "") (("^READLINE_LIBS = (.*)$" _ libs) ;; Link against the provided libguile. (string-append "READLINE_LIBS = " "-lguile-$(GUILE_EFFECTIVE_VERSION) " libs "\n")) (("\\$\\(top_builddir\\)/meta/build-env") ;; Use the provided Guile, not the one from ;; $(builddir). "") ;; Install modules to the 'site' directories. (("^moddir = .*$") "moddir = $(pkgdatadir)/site/$(GUILE_EFFECTIVE_VERSION)\n") (("^ccachedir = .*$") "ccachedir = $(pkglibdir)/$(GUILE_EFFECTIVE_VERSION)/site-ccache\n")) ;; Load 'guile-readline.so' from the right place. (substitute* "ice-9/readline.scm" (("load-extension \"guile-readline\"") (format #f "load-extension \ (string-append ~s \"/lib/guile/\" (effective-version) \"/extensions/guile-readline\")" (assoc-ref outputs "out")))) #t))))) (home-page (package-home-page guile)) (native-inputs (package-native-inputs guile)) (inputs `(,@(package-inputs guile) ;to placate 'configure' ,@(package-propagated-inputs guile) ("guile" ,guile) ("readline" ,readline))) (synopsis "Line editing support for GNU Guile") (description "This module provides line editing support via the Readline library for GNU@tie{}Guile. Use the @code{(ice-9 readline)} module and call its @code{activate-readline} procedure to enable it.") (license license:gpl3+))) (define-public guile-readline (make-guile-readline guile-3.0)) (define-public guile2.2-readline (make-guile-readline guile-2.2 "guile2.2-readline")) (define (guile-variant-package-name prefix) (lambda (name) "Return NAME with PREFIX instead of \"guile-\", when applicable." (if (string-prefix? "guile-" name) (string-append prefix "-" (string-drop name (string-length "guile-"))) name))) (define package-for-guile-2.0 ;; A procedure that rewrites the dependency tree of the given package to use ;; GUILE-2.0 instead of GUILE-3.0. (package-input-rewriting `((,guile-3.0 . ,guile-2.0)) (guile-variant-package-name "guile2.0") #:deep? #f)) (define package-for-guile-2.2 (package-input-rewriting `((,guile-3.0 . ,guile-2.2)) (guile-variant-package-name "guile2.2") #:deep? #f)) (define-syntax define-deprecated-guile3.0-package (lambda (s) "Define a deprecated package alias for \"guile3.0-something\"." (syntax-case s () ((_ name) (and (identifier? #'name) (string-prefix? "guile3.0-" (symbol->string (syntax->datum #'name)))) (let ((->guile (lambda (str) (let ((base (string-drop str (string-length "guile3.0-")))) (string-append "guile-" base))))) (with-syntax ((package-name (symbol->string (syntax->datum #'name))) (package (datum->syntax #'name (string->symbol (->guile (symbol->string (syntax->datum #'name)))))) (old-name ;; XXX: This is the name generated by ;; 'define-deprecated'. (datum->syntax #'name (symbol-append '% (syntax->datum #'name) '/deprecated)))) #'(begin (define-deprecated name package (deprecated-package package-name package)) (export old-name)))))))) (define-deprecated-guile3.0-package guile3.0-readline) (define-public guile-for-guile-emacs (let ((commit "15ca78482ac0dd2e3eb36dcb31765d8652d7106d") (revision "1")) (package (inherit guile-2.2) (name "guile-for-guile-emacs") (version (git-version "2.1.2" revision commit)) (source (origin (method git-fetch) (uri (git-reference (url "git://git.savannah.gnu.org/guile.git") (commit commit))) (file-name (git-file-name name version)) (sha256 (base32 "1l7ik4q4zk7vq4m3gnwizc0b64b1mdr31hxqlzxs94xaf2lvi7s2")))) (arguments (substitute-keyword-arguments (package-arguments guile-2.2) ((#:phases phases '%standard-phases) `(modify-phases ,phases (replace 'bootstrap (lambda _ ;; Disable broken tests. ;; TODO: Fix them! (substitute* "test-suite/tests/gc.test" (("\\(pass-if \"after-gc-hook gets called\"" m) (string-append "#;" m))) (substitute* "test-suite/tests/version.test" (("\\(pass-if \"version reporting works\"" m) (string-append "#;" m))) ;; Warning: Unwind-only `out-of-memory' exception; skipping pre-unwind handler. ;; FAIL: test-out-of-memory (substitute* "test-suite/standalone/Makefile.am" (("(check_SCRIPTS|TESTS) \\+= test-out-of-memory") "")) (patch-shebang "build-aux/git-version-gen") (invoke "sh" "autogen.sh") #t)))))) (native-inputs `(("autoconf" ,autoconf) ("automake" ,automake) ("libtool" ,libtool) ("flex" ,flex) ("texinfo" ,texinfo) ("gettext" ,gettext-minimal) ,@(package-native-inputs guile-2.2)))))) ;;; ;;; Extensions. ;;; (define-public guile-json-1 (package (name "guile-json") (version "1.3.2") (home-page "https://github.com/aconchillo/guile-json") (source (origin (method url-fetch) (uri (string-append "mirror://savannah/guile-json/guile-json-" version ".tar.gz")) (sha256 (base32 "0m6yzb169r6iz56k3nkncjaiijwi4p0x9ijn1p5ax3s77jklxy9k")))) (build-system gnu-build-system) (arguments `(#:make-flags '("GUILE_AUTO_COMPILE=0"))) ;to prevent guild warnings (native-inputs `(("pkg-config" ,pkg-config) ("guile" ,guile-2.2))) (inputs `(("guile" ,guile-2.2))) (synopsis "JSON module for Guile") (description "Guile-JSON supports parsing and building JSON documents according to the specification. These are the main features: @itemize @item Strictly complies to @uref{http://json.org, specification}. @item Build JSON documents programmatically via macros. @item Unicode support for strings. @item Allows JSON pretty printing. @end itemize\n") ;; Version 1.2.0 switched to GPLv3+ (from LGPLv3+). (license license:gpl3+))) ;; Deprecate the 'guile-json' alias to force the use 'guile-json-1' or ;; 'guile-json-3'. In the future, we may reuse 'guile-json' as an alias for ;; 'guile-json-3'. (define-deprecated guile-json guile-json-1) (export guile-json) (define-public guile2.0-json (package-for-guile-2.0 guile-json-1)) (define-public guile-json-3 ;; This version is incompatible with 1.x; see the 'NEWS' file. (package (inherit guile-json-1) (name "guile-json") (version "3.5.0") (source (origin (method url-fetch) (uri (string-append "mirror://savannah/guile-json/guile-json-" version ".tar.gz")) (sha256 (base32 "0nj0684qgh6ppkbdyxqfyjwsv2qbyairxpi8fzrhsi3xnc7jn4im")))) (native-inputs `(("pkg-config" ,pkg-config) ("guile" ,guile-3.0))) (inputs `(("guile" ,guile-3.0))))) (define-public guile3.0-json (deprecated-package "guile3.0-json" guile-json-3)) (define-public guile-json-4 (package (inherit guile-json-3) (name "guile-json") (version "4.4.1") (source (origin (method url-fetch) (uri (string-append "mirror://savannah/guile-json/guile-json-" version ".tar.gz")) (sha256 (base32 "1xq4f59rdk28xy4sdn6amy07aa19ikrk48iily3kfhwpkbg6v9jj")))))) (define-public guile2.2-json (package-for-guile-2.2 guile-json-4)) ;; There are two guile-gdbm packages, one using the FFI and one with ;; direct C bindings, hence the verbose name. (define-public guile-gdbm-ffi (package (name "guile-gdbm-ffi") (version "20120209.fa1d5b6") (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/ijp/guile-gdbm") (commit "fa1d5b6231d0e4d096687b378c025f2148c5f246"))) (file-name (string-append name "-" version "-checkout")) (patches (search-patches "guile-gdbm-ffi-support-gdbm-1.14.patch")) (sha256 (base32 "1j8wrsw7v9w6qkl47xz0rdikg50v16nn6kbs3lgzcymjzpa7babj")))) (build-system guile-build-system) (arguments '(#:phases (modify-phases %standard-phases (add-after 'unpack 'move-examples (lambda* (#:key outputs #:allow-other-keys) ;; Move examples where they belong. (let* ((out (assoc-ref outputs "out")) (doc (string-append out "/share/doc/" (strip-store-file-name out) "/examples"))) (copy-recursively "examples" doc) (delete-file-recursively "examples") #t))) (add-after 'unpack 'set-libgdbm-file-name (lambda* (#:key inputs #:allow-other-keys) (substitute* "gdbm.scm" (("\\(dynamic-link \"libgdbm\"\\)") (format #f "(dynamic-link \"~a/lib/libgdbm.so\")" (assoc-ref inputs "gdbm")))) #t))))) (native-inputs `(("guile" ,guile-3.0))) (inputs `(("gdbm" ,gdbm))) (home-page "https://github.com/ijp/guile-gdbm") (synopsis "Guile bindings to the GDBM library via Guile's FFI") (description "Guile bindings to the GDBM key-value storage system, using Guile's foreign function interface.") (license license:gpl3+))) (define-public guile2.0-gdbm-ffi (package-for-guile-2.0 guile-gdbm-ffi)) (define-public guile2.2-gdbm-ffi (package-for-guile-2.2 guile-gdbm-ffi)) (define-deprecated-guile3.0-package guile3.0-gdbm-ffi) (define-public guile-sqlite3 (package (name "guile-sqlite3") (version "0.1.2") (home-page "https://notabug.org/guile-sqlite3/guile-sqlite3.git") (source (origin (method git-fetch) (uri (git-reference (url home-page) (commit (string-append "v" version)))) (sha256 (base32 "1nryy9j3bk34i0alkmc9bmqsm0ayz92k1cdf752mvhyjjn8nr928")) (file-name (string-append name "-" version "-checkout")))) (build-system gnu-build-system) (native-inputs `(("autoconf" ,autoconf) ("automake" ,automake) ("guile" ,guile-3.0) ("pkg-config" ,pkg-config))) (inputs `(("guile" ,guile-3.0) ("sqlite" ,sqlite))) (synopsis "Access SQLite databases from Guile") (description "This package provides Guile bindings to the SQLite database system.") (license license:gpl3+))) (define-public guile2.0-sqlite3 (package-for-guile-2.0 guile-sqlite3)) (define-public guile2.2-sqlite3 (package-for-guile-2.2 guile-sqlite3)) (define-deprecated-guile3.0-package guile3.0-sqlite3) (define-public guile-bytestructures (package (name "guile-bytestructures") (version "1.0.9") (home-page "https://github.com/TaylanUB/scheme-bytestructures") (source (origin (method git-fetch) (uri (git-reference (url home-page) (commit version))) (file-name (git-file-name name version)) (sha256 (base32 "0r59sqrvwbsknw21bf44bppi6wdhd2rl2v5dw9i2vij3v8w7pgkm")))) (build-system gnu-build-system) (arguments `(#:make-flags '("GUILE_AUTO_COMPILE=0") ;to prevent guild warnings #:phases (modify-phases %standard-phases (add-after 'install 'install-doc (lambda* (#:key outputs #:allow-other-keys) (let* ((out (assoc-ref outputs "out")) (package ,(package-full-name this-package "-")) (doc (string-append out "/share/doc/" package))) (install-file "README.md" doc) #t)))))) (native-inputs `(("autoconf" ,autoconf) ("automake" ,automake) ("pkg-config" ,pkg-config) ("guile" ,guile-3.0))) (inputs `(("guile" ,guile-3.0))) (synopsis "Structured access to bytevector contents for Guile") (description "Guile bytestructures offers a system imitating the type system of the C programming language, to be used on bytevectors. C's type system works on raw memory, and Guile works on bytevectors which are an abstraction over raw memory. It's also more powerful than the C type system, elevating types to first-class status.") (license license:gpl3+) (properties '((upstream-name . "bytestructures"))))) (define-public guile2.0-bytestructures (package-for-guile-2.0 guile-bytestructures)) (define-public guile2.2-bytestructures (package-for-guile-2.2 guile-bytestructures)) (define-deprecated-guile3.0-package guile3.0-bytestructures) (define-public guile-git (package (name "guile-git") (version "0.4.0") (home-page "https://gitlab.com/guile-git/guile-git.git") (source (origin (method url-fetch) (uri (string-append "https://gitlab.com/guile-git/guile-git/uploads/" "2600bb0dfdfb00bfbe46811dccad51d8/guile-git-" version ".tar.gz")) (sha256 (base32 "1kxyg9x2aa1pg69cl48wysq0pbxvwfahy1xpl5ab6p8babhf7kic")))) (build-system gnu-build-system) (arguments `(#:make-flags '("GUILE_AUTO_COMPILE=0"))) ; to prevent guild warnings (native-inputs `(("pkg-config" ,pkg-config) ("guile" ,guile-3.0) ("guile-bytestructures" ,guile-bytestructures))) (inputs `(("guile" ,guile-3.0) ("libgit2" ,libgit2))) (propagated-inputs `(("guile-bytestructures" ,guile-bytestructures))) (synopsis "Guile bindings for libgit2") (description "This package provides Guile bindings to libgit2, a library to manipulate repositories of the Git version control system.") (license license:gpl3+))) (define-public guile2.2-git (package-for-guile-2.2 guile-git)) (define-public guile2.0-git (package-for-guile-2.0 guile-git)) (define-deprecated-guile3.0-package guile3.0-git) (define-public guile-zlib (package (name "guile-zlib") (version "0.0.1") (source (origin ;; XXX: Do not use "git-fetch" method here that would create and ;; endless inclusion loop, because this package is used as an extension ;; in the same method. (method url-fetch) (uri (string-append "https://notabug.org/guile-zlib/guile-zlib/archive/" version ".tar.gz")) (file-name (string-append name "-" version ".tar.gz")) (sha256 (base32 "1caz6cbl6sg5567nk68z88rshp0m26zmb0a9ry1jkc1ivpk0n47i")))) (build-system gnu-build-system) (arguments '(#:make-flags '("GUILE_AUTO_COMPILE=0"))) ;to prevent guild warnings (native-inputs `(("autoconf" ,autoconf) ("automake" ,automake) ("pkg-config" ,pkg-config) ,@(if (%current-target-system) `(("guile" ,guile-3.0)) ;for 'guild compile' and 'guile-3.0.pc' '()))) (inputs `(("guile" ,guile-3.0) ("zlib" ,zlib))) (synopsis "Guile bindings to zlib") (description "This package provides Guile bindings for zlib, a lossless data-compression library. The bindings are written in pure Scheme by using Guile's foreign function interface.") (home-page "https://notabug.org/guile-zlib/guile-zlib") (license license:gpl3+))) (define-public guile-lzlib (package (name "guile-lzlib") (version "0.0.2") (source (origin (method url-fetch) (uri (string-append "https://notabug.org/guile-lzlib/guile-lzlib/archive/" version ".tar.gz")) (file-name (string-append name "-" version ".tar.gz")) (sha256 (base32 "11sggvncyx08ssp1s5xii4d6nskh1qwqihnbpzzvkrs7sivxn8w6")))) (build-system gnu-build-system) (arguments '(#:make-flags '("GUILE_AUTO_COMPILE=0"))) ;to prevent guild warnings (native-inputs `(("autoconf" ,autoconf) ("automake" ,automake) ("pkg-config" ,pkg-config) ,@(if (%current-target-system) `(("guile" ,guile-3.0)) ;for 'guild compile' and 'guile-3.0.pc' '()))) (inputs `(("guile" ,guile-3.0) ("lzlib" ,lzlib))) (synopsis "Guile bindings to lzlib") (description "This package provides Guile bindings for lzlib, a C library for in-memory LZMA compression and decompression. The bindings are written in pure Scheme by using Guile's foreign function interface.") (home-page "https://notabug.org/guile-lzlib/guile-lzlib") (license license:gpl3+))) (define-public guile-zstd (package (name "guile-zstd") (version "0.1.1") (home-page "https://notabug.org/guile-zstd/guile-zstd") (source (origin (method git-fetch) (uri (git-reference (url home-page) (commit (string-append "v" version)))) (file-name (git-file-name name version)) (sha256 (base32 "1c8l7829b5yx8wdc0mrhzjfwb6h9hb7cd8dfxcr71a7vlsi86310")))) (build-system gnu-build-system) (native-inputs `(("autoconf" ,autoconf) ("automake" ,automake) ("pkg-config" ,pkg-config) ("guile" ,guile-3.0))) (inputs `(("zstd" ,zstd "lib") ("guile" ,guile-3.0))) (synopsis "GNU Guile bindings to the zstd compression library") (description "This package provides a GNU Guile interface to the zstd (``zstandard'') compression library.") (license license:gpl3+))) ;;; guile.scm ends here