gnu: xorriso: Remove 'bzip2' and 'libcdio' from inputs.
[jackhill/guix/guix.git] / gnu / packages / guile.scm
index c314acb..3bc18ff 100644 (file)
@@ -15,6 +15,8 @@
 ;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com>
 ;;; Copyright © 2017 Theodoros Foradis <theodoros@foradis.org>
 ;;; Copyright © 2017 ng0 <ng0@infotropique.org>
+;;; Copyright © 2017 Tobias Geerinckx-Rice <me@tobias.gr>
+;;; Copyright © 2018 Maxim Cournoyer <maxim.cournoyer@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -71,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:))
 
 ;;; Commentary:
 ;;;
@@ -628,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 "/" version)))
-                               (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 generate
+         ;; 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))))))))))))
 
 (define-public guile-ics
   (package
@@ -1074,13 +1089,16 @@ inspired by the SCSH regular expression system.")
                 (compile-file
                  (lambda (in-file out-file)
                    (system* guild "compile" "-o" out-file in-file))))
-           ;; Make installation directories.
-           (mkdir-p module-dir)
-           (mkdir-p doc)
-
            ;; Switch directory for compiling and installing
            (chdir source)
 
+           ;; Install the documentation.
+           (install-file "README.md" doc)
+           (copy-recursively "examples" (string-append doc "/examples"))
+
+           ;; Make installation directories.
+           (mkdir-p module-dir)
+
            ;; copy the source
            (copy-file "gdbm.scm" gdbm.scm-dest)
 
@@ -1093,7 +1111,7 @@ inspired by the SCSH regular expression system.")
            ;; compile to the destination
            (compile-file gdbm.scm-dest gdbm.go-dest)))))
     (inputs
-     `(("guile" ,guile-2.0)))
+     `(("guile" ,guile-2.2)))
     (propagated-inputs
      `(("gdbm" ,gdbm)))
     (home-page "https://github.com/ijp/guile-gdbm")
@@ -1103,8 +1121,11 @@ inspired by the SCSH regular expression system.")
 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))
+  (deprecated-package "guile2.2-gdbm-ffi" guile-gdbm-ffi))
 
 (define-public guile-sqlite3
   (let ((commit "607721fe1174a299e45d457acacf94eefb964071"))
@@ -1507,16 +1528,16 @@ SQL databases.  This package implements the interface for SQLite.")
 (define-public guile-dsv
   (package
     (name "guile-dsv")
-    (version "0.2.0")
+    (version "0.2.1")
     (source (origin
               (method git-fetch)
               (uri (git-reference
                     (url "https://github.com/artyom-poptsov/guile-dsv")
-                    (commit "7d2e06a15e1d8478cd0e8fb4c79aec519dc4cfd0")))
+                    (commit "bdc5267d007478abc20ea96d7c459b7dd9560b3d")))
               (file-name (string-append name "-" version "-checkout"))
               (sha256
                (base32
-                "0ywb0hdbs4lcjag8b3id43fpyn5s6gscg7dk0n9ryigyvch80wxj"))))
+                "1irw6mz8998nwyhzrw9g94jcz60b9zljgqfmipaz1ybn8579qjx0"))))
     (build-system gnu-build-system)
     (native-inputs
      `(("autoconf" ,autoconf)
@@ -1651,90 +1672,18 @@ is no support for parsing block and inline level HTML.")
 (define-public guile-bytestructures
   (package
     (name "guile-bytestructures")
-    (version "20170402.91d042e")
+    (version "1.0.1")
     (source (origin
-              (method git-fetch)
-              (uri (git-reference
-                    (url "https://github.com/TaylanUB/scheme-bytestructures")
-                    (commit "91d042e3427e1d7740b604b6296c616cf2eec13d")))
-              (file-name (string-append name "-" version "-checkout"))
+              (method url-fetch)
+              (uri (string-append "https://github.com/TaylanUB/scheme-bytestructures"
+                                  "/releases/download/v" version
+                                  "/bytestructures-" version ".tar.gz"))
               (sha256
                (base32
-                "04lgh0nk6ddnwgh20hnz4pyhczaik0xbd50kikjsxcwcl46shavb"))
-              (patches (search-patches "guile-bytestructures-name-clash.patch"))))
-    (build-system trivial-build-system)
-    (arguments
-     `(#:modules ((guix build utils))
-       #:builder
-       (begin
-         (use-modules (guix build utils)
-                      (ice-9 ftw)
-                      (ice-9 match)
-                      (ice-9 popen)
-                      (ice-9 rdelim))
-         ;; Unpack.
-         (setenv "PATH"
-                 (string-join (list (assoc-ref %build-inputs "tar")
-                                    (assoc-ref %build-inputs "xz"))
-                              "/bin:" 'suffix))
-         (system* "tar" "xf" (assoc-ref %build-inputs "source"))
-         (match (scandir ".")
-           (("." ".." directory)
-            (chdir directory)))
-
-         (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))
-                (object-dir (string-append out "/lib/guile/" effective
-                                           "/site-ccache"))
-                (source (getcwd))
-                (doc (string-append out "/share/doc/scheme-bytestructures"))
-                (sld-files (with-directory-excursion source
-                             (find-files "bytestructures/r7" "\\.exports.sld$")))
-                (scm-files (filter (lambda (path)
-                                     (not (string-prefix? "bytestructures/r7" path)))
-                                   (with-directory-excursion source
-                                     (find-files "bytestructures" "\\.scm$"))))
-                (guild (string-append (assoc-ref %build-inputs "guile")
-                                      "/bin/guild")))
-           ;; Make installation directories.
-           (mkdir-p doc)
-
-           ;; 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 (string-append object-dir "/"
-                                                      (substring file 0
-                                                                 (string-rindex file #\.))
-                                                      ".go")))
-                         ;; Install source module.
-                         (mkdir-p (dirname dest-file))
-                         (copy-file file dest-file)
-
-                         ;; Install compiled module.
-                         (mkdir-p (dirname go-file))
-                         (unless (zero? (system* guild "compile"
-                                                 "-L" source
-                                                 "-o" go-file
-                                                 file))
-                           (error (format #f "Failed to compile ~s to ~s!"
-                                          file go-file)))))
-                     (append sld-files scm-files))
-
-           ;; Also copy over the README.
-           (install-file "README.md" doc)
-           #t))))
+                "1lnfcy65mqj823lamy2n2vaghdz0g7mj011bgnhmd6hwpnaidnh2"))))
+    (build-system gnu-build-system)
     (native-inputs
-     `(("tar" ,tar)
-       ("xz" ,xz)))
+     `(("pkg-config" ,pkg-config)))
     (inputs
      `(("guile" ,guile-2.2)))
     (home-page "https://github.com/TaylanUB/scheme-bytestructures")