diff options
Diffstat (limited to 'gnu/packages/guile.scm')
-rw-r--r-- | gnu/packages/guile.scm | 258 |
1 files changed, 133 insertions, 125 deletions
diff --git a/gnu/packages/guile.scm b/gnu/packages/guile.scm index 2108b9f9d3..941b718364 100644 --- a/gnu/packages/guile.scm +++ b/gnu/packages/guile.scm @@ -16,6 +16,7 @@ ;;; Copyright © 2018 Eric Bavier <bavier@member.fsf.org> ;;; Copyright © 2019 Taylan Kammer <taylan.kammer@gmail.com> ;;; Copyright © 2020, 2021 Efraim Flashner <efraim@flashner.co.il> +;;; Copyright © 2021 Maxime Devos <maximedevos@telenet.be> ;;; ;;; This file is part of GNU Guix. ;;; @@ -62,9 +63,7 @@ #:use-module (guix build-system gnu) #:use-module (guix build-system guile) #:use-module (guix deprecation) - #:use-module (guix utils) - #:use-module (ice-9 match) - #:use-module ((srfi srfi-1) #:prefix srfi-1:)) + #:use-module (guix utils)) ;;; Commentary: ;;; @@ -85,7 +84,12 @@ "0l200a0v7h8bh0cwz6v7hc13ds39cgqsmfrks55b1rbj5vniyiy3")) (patches (search-patches "guile-1.8-cpp-4.5.patch")))) (build-system gnu-build-system) - (arguments '(#:configure-flags '("--disable-error-on-warning") + (arguments '(#:configure-flags '("--disable-error-on-warning" + + ;; Build with '-O1' to work around GC + ;; crash on x86_64: + ;; <https://issues.guix.gnu.org/50427>. + "CFLAGS=-O1 -g -Wall") ;; Insert a phase before `configure' to patch things up. #:phases @@ -104,21 +108,24 @@ ;; The usual /bin/sh... (substitute* "ice-9/popen.scm" - (("/bin/sh") (which "sh"))) - #t))))) + (("/bin/sh") (which "sh")))))) + + ;; XXX: Several numerical tests and tests related to + ;; 'inet-pton' fail on glibc 2.33/GCC 10. Disable them. + ;; TODO: Remove this package when its dependents no longer + ;; need it. + #:tests? #f)) ;; When cross-compiling, a native version of Guile itself is needed. (native-inputs (if (%current-target-system) `(("self" ,this-package)) '())) - (inputs `(("gawk" ,gawk) - ("readline" ,readline))) + (inputs (list gawk readline)) ;; Since `guile-1.8.pc' has "Libs: ... -lgmp -lltdl", these must be ;; propagated. - (propagated-inputs `(("gmp" ,gmp) - ("libltdl" ,libltdl))) + (propagated-inputs (list gmp libltdl)) (native-search-paths (list (search-path-specification @@ -180,6 +187,11 @@ without requiring the source code to be rewritten.") (arguments `(#:configure-flags '("--disable-static") ; saves 3 MiB + + ;; Work around non-reproducible .go files as described in + ;; <https://bugs.gnu.org/20272>, which affects 2.0, 2.2, and 3.0 so far. + #:parallel-build? #f + #:phases (modify-phases %standard-phases ,@(if (hurd-system?) @@ -246,7 +258,8 @@ without requiring the source code to be rewritten.") "013mydzhfswqci6xmyc1ajzd59pfbdak15i0b090nhr9bzm7dxyd")) (modules '((guix build utils))) (patches (search-patches - "guile-2.2-skip-oom-test.patch")) + "guile-2.2-skip-oom-test.patch" + "guile-2.2-skip-so-test.patch")) ;; Remove the pre-built object files. Instead, build everything ;; from source, at the expense of significantly longer build @@ -255,6 +268,13 @@ without requiring the source code to be rewritten.") (for-each delete-file (find-files "prebuilt" "\\.go$")) #t)))) + (arguments + (substitute-keyword-arguments (package-arguments guile-2.0) + ((#:configure-flags flags ''()) + (if (target-x86-32?) ;<https://issues.guix.gnu.org/49368> + `(append ,flags '("CFLAGS=-g -O2 -fexcess-precision=standard")) + flags)))) + (properties '((timeout . 72000) ;20 hours (max-silent-time . 36000))) ;10 hours (needed on ARM ; when heavily loaded) @@ -285,21 +305,75 @@ without requiring the source code to be rewritten.") (package (inherit guile-2.2) (name "guile") - (version "3.0.2") + (version "3.0.7") (source (origin (inherit (package-source guile-2.2)) + (patches '()) ; We no longer need the patches. (uri (string-append "mirror://gnu/guile/guile-" version ".tar.xz")) (sha256 (base32 - "12lziar4j27j9whqp2n18427q45y9ghq7gdd8lqhmj1k0lr7vi2k")))) + "1dwiwsrpm4f96alfnz6wibq378242z4f16vsxgy1n9r00v3qczgm")) + ;; Replace the snippet because the oom-test still + ;; fails on some 32-bit architectures. + (snippet '(begin + (substitute* "test-suite/standalone/Makefile.in" + (("test-out-of-memory") "")) + (for-each delete-file + (find-files "prebuilt" "\\.go$")))))) + + ;; Build with the bundled mini-GMP to avoid interference with GnuTLS' own + ;; use of GMP via Nettle: <https://issues.guix.gnu.org/46330>. + (propagated-inputs + (modify-inputs (package-propagated-inputs guile-2.2) + (delete "gmp" "libltdl"))) (arguments - ;; XXX: JIT-enabled Guile crashes in obscure ways on GNU/Hurd. - (if (hurd-target?) - (substitute-keyword-arguments (package-arguments guile-2.2) - ((#:configure-flags flags ''()) - `(cons "--disable-jit" ,flags))) - (package-arguments guile-2.2))) + (substitute-keyword-arguments (package-arguments guile-2.0) + ((#:configure-flags flags ''()) + ;; XXX: JIT-enabled Guile crashes in obscure ways on GNU/Hurd. + `(cons* ,@(if (hurd-target?) + '("--disable-jit") + '()) + ;; -fexcess-precision=standard is required when compiling for + ;; i686-linux, otherwise "numbers.test" will fail + ;; (see <https://issues.guix.gnu.org/49368> and + ;; <https://issues.guix.gnu.org/49659>). + ;; TODO: Keep this in GUILE-2.2 and remove from here on next + ;; rebuild cycle. + ,@(if (target-x86-32?) + '("CFLAGS=-g -O2 -fexcess-precision=standard") + '()) + "--enable-mini-gmp" + ,flags)) + ((#:phases phases) + `(modify-phases ,phases + (add-before 'check 'disable-stack-overflow-test + (lambda _ + ;; This test can invoke the "OOM killer", especially when + ;; running on emulated hardware (QEMU). Skip it. + (substitute* "test-suite/standalone/test-stack-overflow" + (("!#") + "!#\n(exit 77)\n")))) + + ,@(if (string-prefix? "powerpc-" (%current-system)) + `((add-after 'unpack 'adjust-bootstrap-flags + (lambda _ + ;; Upstream knows about suggested solution. + ;; https://debbugs.gnu.org/cgi/bugreport.cgi?bug=45214 + (substitute* "bootstrap/Makefile.in" + (("^GUILE_OPTIMIZATIONS.*") + "GUILE_OPTIMIZATIONS = -O1 -Oresolve-primitives -Ocps\n"))))) + '()) + ,@(if (or (target-ppc32?) + (target-riscv64?)) + `((add-after 'unpack 'skip-failing-fdes-test + (lambda _ + ;; ERROR: ((system-error "seek" "~A" ("Bad file descriptor") (9))) + (substitute* "test-suite/tests/ports.test" + (("fdes not closed\"" all) (string-append all "(exit 77)"))) + #t))) + '()))))) + (native-search-paths (list (search-path-specification (variable "GUILE_LOAD_PATH") @@ -310,31 +384,7 @@ without requiring the source code to be rewritten.") "share/guile/site/3.0"))))))) (define-public guile-3.0-latest - ;; TODO: Make this 'guile-3.0' on the next rebuild cycle. - (package - (inherit guile-3.0) - (version "3.0.7") - (source (origin - (inherit (package-source guile-3.0)) ;preserve snippet - (patches '()) - (uri (string-append "mirror://gnu/guile/guile-" - version ".tar.xz")) - (sha256 - (base32 - "1dwiwsrpm4f96alfnz6wibq378242z4f16vsxgy1n9r00v3qczgm")))) - - ;; Build with the bundled mini-GMP to avoid interference with GnuTLS' own - ;; use of GMP via Nettle: <https://issues.guix.gnu.org/46330>. Use - ;; LIBGC/DISABLE-MUNMAP to work around <https://bugs.gnu.org/40525>. - ;; Remove libltdl, which is no longer used. - (propagated-inputs - `(("bdw-gc" ,libgc/disable-munmap) - ,@(srfi-1:fold srfi-1:alist-delete (package-propagated-inputs guile-3.0) - '("gmp" "libltdl" "bdw-gc")))) - (arguments - (substitute-keyword-arguments (package-arguments guile-3.0) - ((#:configure-flags flags ''()) - `(cons "--enable-mini-gmp" ,flags)))))) + guile-3.0) (define-public guile-3.0/libgc-7 ;; Using libgc-7 avoid crashes that can occur, particularly when loading @@ -344,8 +394,8 @@ without requiring the source code to be rewritten.") (package (inherit guile-3.0-latest) (propagated-inputs - `(("bdw-gc" ,libgc-7) - ,@(srfi-1:alist-delete "bdw-gc" (package-propagated-inputs guile-3.0))))))) + (modify-inputs (package-propagated-inputs guile-3.0) + (replace "bdw-gc" libgc-7)))))) (define-public guile-3.0/fixed ;; A package of Guile that's rarely changed. It is the one used in the @@ -386,14 +436,14 @@ without requiring the source code to be rewritten.") (delete-file "test-suite/tests/version.test") #t)))))) (native-inputs - `(("autoconf" ,autoconf) - ("automake" ,automake) - ("libtool" ,libtool) - ("flex" ,flex) - ("gettext" ,gnu-gettext) - ("texinfo" ,texinfo) - ("gperf" ,gperf) - ,@(package-native-inputs guile-3.0))) + (modify-inputs (package-native-inputs guile-3.0) + (prepend autoconf + automake + libtool + flex + gnu-gettext + texinfo + gperf))) (synopsis "Development version of GNU Guile")))) (define* (make-guile-readline guile #:optional (name "guile-readline")) @@ -403,7 +453,8 @@ without requiring the source code to be rewritten.") (source (package-source guile)) (build-system gnu-build-system) (arguments - '(#:configure-flags '("--disable-silent-rules") + '(#:configure-flags '("--disable-silent-rules" + "--enable-mini-gmp") ;for Guile >= 3.0.6 #:phases (modify-phases %standard-phases (add-before 'build 'chdir (lambda* (#:key outputs #:allow-other-keys) @@ -512,18 +563,18 @@ GNU@tie{}Guile. Use the @code{(ice-9 readline)} module and call its ;; 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)))))) + (modify-inputs (package-native-inputs guile-2.2) + (prepend autoconf + automake + libtool + flex + texinfo + gettext-minimal)))))) ;;; @@ -545,9 +596,8 @@ GNU@tie{}Guile. Use the @code{(ice-9 readline)} module and call its (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))) + (native-inputs (list pkg-config guile-2.2)) + (inputs (list guile-2.2)) (synopsis "JSON module for Guile") (description "Guile-JSON supports parsing and building JSON documents according to the @@ -585,9 +635,8 @@ specification. These are the main features: (sha256 (base32 "0nj0684qgh6ppkbdyxqfyjwsv2qbyairxpi8fzrhsi3xnc7jn4im")))) - (native-inputs `(("pkg-config" ,pkg-config) - ("guile" ,guile-3.0))) - (inputs `(("guile" ,guile-3.0))))) + (native-inputs (list pkg-config guile-3.0)) + (inputs (list guile-3.0)))) (define-public guile-json-4 (package @@ -643,10 +692,8 @@ specification. These are the main features: (format #f "(dynamic-link \"~a/lib/libgdbm.so\")" (assoc-ref inputs "gdbm")))) #t))))) - (native-inputs - `(("guile" ,guile-3.0))) - (inputs - `(("gdbm" ,gdbm))) + (native-inputs (list guile-3.0)) + (inputs (list gdbm)) (home-page "https://github.com/ijp/guile-gdbm") (synopsis "Guile bindings to the GDBM library via Guile's FFI") (description @@ -675,14 +722,8 @@ Guile's foreign function interface.") "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))) + (native-inputs (list autoconf automake guile-3.0 pkg-config)) + (inputs (list guile-3.0 sqlite)) (synopsis "Access SQLite databases from Guile") (description "This package provides Guile bindings to the SQLite database system.") @@ -720,13 +761,8 @@ Guile's foreign function interface.") (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))) + (native-inputs (list autoconf automake pkg-config guile-3.0)) + (inputs (list guile-3.0)) (synopsis "Structured access to bytevector contents for Guile") (description "Guile bytestructures offers a system imitating the type system @@ -761,17 +797,11 @@ type system, elevating types to first-class status.") (arguments `(#:make-flags '("GUILE_AUTO_COMPILE=0"))) ; to prevent guild warnings (native-inputs - `(("pkg-config" ,pkg-config) - ("autoconf" ,autoconf) - ("automake" ,automake) - ("texinfo" ,texinfo) - ("guile" ,guile-3.0) - ("guile-bytestructures" ,guile-bytestructures))) + (list pkg-config autoconf automake texinfo guile-3.0 guile-bytestructures)) (inputs - `(("guile" ,guile-3.0) - ("libgit2" ,libgit2))) + (list guile-3.0 libgit2)) (propagated-inputs - `(("guile-bytestructures" ,guile-bytestructures))) + (list guile-bytestructures)) (synopsis "Guile bindings for libgit2") (description "This package provides Guile bindings to libgit2, a library to @@ -806,16 +836,8 @@ manipulate repositories of the Git version control 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))) + (native-inputs (list autoconf automake pkg-config guile-3.0)) + (inputs (list guile-3.0 zlib)) (synopsis "Guile bindings to zlib") (description "This package provides Guile bindings for zlib, a lossless @@ -845,16 +867,8 @@ Guile's foreign function interface.") (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))) + (native-inputs (list autoconf automake pkg-config guile-3.0)) + (inputs (list guile-3.0 lzlib)) (synopsis "Guile bindings to lzlib") (description "This package provides Guile bindings for lzlib, a C library for @@ -880,14 +894,8 @@ pure Scheme by using Guile's foreign function interface.") (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))) + (native-inputs (list autoconf automake pkg-config guile-3.0)) + (inputs (list `(,zstd "lib") guile-3.0)) (synopsis "GNU Guile bindings to the zstd compression library") (description "This package provides a GNU Guile interface to the zstd (``zstandard'') |