Mirror of GNU Guix
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

182 lines
7.0 KiB

  1. ;;; Guix --- Nix package management from Guile. -*- coding: utf-8 -*-
  2. ;;; Copyright (C) 2012 Ludovic Courtès <ludo@gnu.org>
  3. ;;;
  4. ;;; This file is part of Guix.
  5. ;;;
  6. ;;; Guix is free software; you can redistribute it and/or modify it
  7. ;;; under the terms of the GNU General Public License as published by
  8. ;;; the Free Software Foundation; either version 3 of the License, or (at
  9. ;;; your option) any later version.
  10. ;;;
  11. ;;; Guix is distributed in the hope that it will be useful, but
  12. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  13. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. ;;; GNU General Public License for more details.
  15. ;;;
  16. ;;; You should have received a copy of the GNU General Public License
  17. ;;; along with Guix. If not, see <http://www.gnu.org/licenses/>.
  18. (define-module (distro packages guile)
  19. #:use-module (distro)
  20. #:use-module (distro packages bdw-gc)
  21. #:use-module (distro packages gawk)
  22. #:use-module (distro packages libffi)
  23. #:use-module (distro packages libtool)
  24. #:use-module (distro packages libunistring)
  25. #:use-module (distro packages m4)
  26. #:use-module (distro packages multiprecision)
  27. #:use-module (distro packages pkg-config)
  28. #:use-module (distro packages readline)
  29. #:use-module (guix packages)
  30. #:use-module (guix http)
  31. #:use-module (guix utils)
  32. #:use-module (guix build-system gnu))
  33. ;;; Commentary:
  34. ;;;
  35. ;;; GNU Guile, and modules and extensions.
  36. ;;;
  37. ;;; Code:
  38. (define-public guile-1.8
  39. (package
  40. (name "guile")
  41. (version "1.8.8")
  42. (source (origin
  43. (method http-fetch)
  44. (uri (string-append "http://ftp.gnu.org/gnu/guile/guile-" version
  45. ".tar.gz"))
  46. (sha256
  47. (base32
  48. "0l200a0v7h8bh0cwz6v7hc13ds39cgqsmfrks55b1rbj5vniyiy3"))))
  49. (build-system gnu-build-system)
  50. (arguments '(#:configure-flags '("--disable-error-on-warning")
  51. #:patches (list (assoc-ref %build-inputs "patch/snarf"))
  52. ;; Insert a phase before `configure' to patch things up.
  53. #:phases (alist-cons-before
  54. 'configure
  55. 'patch-loader-search-path
  56. (lambda* (#:key outputs #:allow-other-keys)
  57. ;; Add a call to `lt_dladdsearchdir' so that
  58. ;; `libguile-readline.so' & co. are in the
  59. ;; loader's search path.
  60. (substitute* "libguile/dynl.c"
  61. (("lt_dlinit.*$" match)
  62. (format #f
  63. " ~a~% lt_dladdsearchdir(\"~a/lib\");~%"
  64. match
  65. (assoc-ref outputs "out")))))
  66. %standard-phases)))
  67. (inputs `(("patch/snarf" ,(search-patch "guile-1.8-cpp-4.5.patch"))
  68. ("gawk" ,gawk)
  69. ("readline" ,readline)))
  70. ;; Since `guile-1.8.pc' has "Libs: ... -lgmp -lltdl", these must be
  71. ;; propagated.
  72. (propagated-inputs `(("gmp" ,gmp)
  73. ("libtool" ,libtool)))
  74. ;; When cross-compiling, a native version of Guile itself is needed.
  75. (self-native-input? #t)
  76. (synopsis "GNU Guile 1.8, an embeddable Scheme interpreter")
  77. (description
  78. "GNU Guile 1.8 is an interpreter for the Scheme programming language,
  79. packaged as a library that can be embedded into programs to make them
  80. extensible. It supports many SRFIs.")
  81. (home-page "http://www.gnu.org/software/guile/")
  82. (license "LGPLv2+")))
  83. (define-public guile-2.0
  84. (package
  85. (name "guile")
  86. (version "2.0.6")
  87. (source (origin
  88. (method http-fetch)
  89. (uri (string-append "http://ftp.gnu.org/gnu/guile/guile-" version
  90. ".tar.xz"))
  91. (sha256
  92. (base32
  93. "000ng5qsq3cl1k35jvzvhwxj92wx4q87745n2fppkd4irh58vv5l"))))
  94. (build-system gnu-build-system)
  95. (native-inputs `(("pkgconfig" ,pkg-config)))
  96. (inputs `(("libffi" ,libffi)
  97. ("readline" ,readline)))
  98. (propagated-inputs
  99. `( ;; These ones aren't normally needed here, but since `libguile-2.0.la'
  100. ;; reads `-lltdl -lunistring', adding them here will add the needed
  101. ;; `-L' flags. As for why the `.la' file lacks the `-L' flags, see
  102. ;; <http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/18903>.
  103. ("libunistring" ,libunistring)
  104. ("libtool" ,libtool)
  105. ;; The headers and/or `guile-2.0.pc' refer to these packages, so they
  106. ;; must be propagated.
  107. ("bdw-gc" ,libgc)
  108. ("gmp" ,gmp)))
  109. (self-native-input? #t)
  110. (synopsis "GNU Guile 2.0, an embeddable Scheme implementation")
  111. (description
  112. "GNU Guile is an implementation of the Scheme programming language, with
  113. support for many SRFIs, packaged for use in a wide variety of environments.
  114. In addition to implementing the R5RS Scheme standard and a large subset of
  115. R6RS, Guile includes a module system, full access to POSIX system calls,
  116. networking support, multiple threads, dynamic linking, a foreign function
  117. call interface, and powerful string processing.")
  118. (home-page "http://www.gnu.org/software/guile/")
  119. (license "LGPLv3+")))
  120. ;;;
  121. ;;; Extensions.
  122. ;;;
  123. (define (guile-reader guile)
  124. "Build Guile-Reader against GUILE, a package of some version of Guile 1.8
  125. or 2.0."
  126. (package
  127. (name (string-append "guile-reader-for-guile-" (package-version guile)))
  128. (version "0.6")
  129. (source (origin
  130. (method http-fetch)
  131. (uri (string-append
  132. "http://download-mirror.savannah.gnu.org/releases/guile-reader/guile-reader-"
  133. version ".tar.gz"))
  134. (sha256
  135. (base32
  136. "1svlyk5pm4fsdp2g7n6qffdl6fdggxnlicj0jn9s4lxd63gzxy1n"))))
  137. (build-system gnu-build-system)
  138. (native-inputs `(("pkgconfig" ,pkg-config)
  139. ("gperf" ,(false-if-exception ; FIXME
  140. (nixpkgs-derivation "gperf")))))
  141. (inputs `(("guile" ,guile)))
  142. (synopsis "Guile-Reader, a simple framework for building readers for
  143. GNU Guile")
  144. (description
  145. "Guile-Reader is a simple framework for building readers for GNU Guile.
  146. The idea is to make it easy to build procedures that extend Guiles read
  147. procedure. Readers supporting various syntax variants can easily be written,
  148. possibly by re-using existing token readers of a standard Scheme
  149. readers. For example, it is used to implement Skribilos R5RS-derived
  150. document syntax.
  151. Guile-Readers approach is similar to Common Lisps read table, but
  152. hopefully more powerful and flexible (for instance, one may instantiate as
  153. many readers as needed).")
  154. (home-page "http://www.nongnu.org/guile-reader/")
  155. (license "GPLv3+")))
  156. (define-public guile-reader/guile-1.8
  157. ;; Guile-Reader built against Guile 1.8.
  158. (guile-reader guile-1.8))
  159. (define-public guile-reader/guile-2.0
  160. ;; Guile-Reader built against Guile 2.0.
  161. (guile-reader guile-2.0))
  162. ;;; guile.scm ends here