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.
 
 
 
 
 
 

407 lines
17 KiB

  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2013 Ludovic Courtès <ludo@gnu.org>
  3. ;;;
  4. ;;; This file is part of GNU Guix.
  5. ;;;
  6. ;;; GNU 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. ;;; GNU 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 GNU Guix. If not, see <http://www.gnu.org/licenses/>.
  18. (define-module (gnu packages scheme)
  19. #:use-module (gnu packages)
  20. #:use-module (guix licenses)
  21. #:use-module (guix packages)
  22. #:use-module (guix download)
  23. #:use-module (guix build-system gnu)
  24. #:use-module (gnu packages m4)
  25. #:use-module (gnu packages multiprecision)
  26. #:use-module (gnu packages emacs)
  27. #:use-module (gnu packages texinfo)
  28. #:use-module (gnu packages patchelf)
  29. #:use-module (gnu packages which)
  30. #:use-module (gnu packages pkg-config)
  31. #:use-module (gnu packages avahi)
  32. #:use-module (gnu packages libphidget)
  33. #:use-module (gnu packages glib)
  34. #:use-module (gnu packages gtk)
  35. #:use-module (gnu packages libffi)
  36. #:use-module (gnu packages libjpeg)
  37. #:use-module (ice-9 match))
  38. (define-public mit-scheme
  39. (package
  40. (name "mit-scheme")
  41. (version "9.1.1")
  42. (source #f) ; see below
  43. (build-system gnu-build-system)
  44. (arguments
  45. `(#:tests? #f ; no "check" target
  46. #:phases
  47. (alist-replace
  48. 'unpack
  49. (lambda* (#:key inputs #:allow-other-keys)
  50. (and (zero? (system* "tar" "xzvf"
  51. (assoc-ref inputs "source")))
  52. (chdir ,(string-append name "-" version))
  53. (begin
  54. ;; Delete these dangling symlinks since they break
  55. ;; `patch-shebangs'.
  56. (for-each delete-file
  57. (append (find-files "src/lib/lib" "\\.so$")
  58. (find-files "src/lib" "^ffi-test")))
  59. (chdir "src")
  60. #t)))
  61. (alist-replace
  62. 'build
  63. (lambda* (#:key system outputs #:allow-other-keys)
  64. (let ((out (assoc-ref outputs "out")))
  65. (if (or (string-prefix? "x86_64" system)
  66. (string-prefix? "i686" system))
  67. (zero? (system* "make" "compile-microcode"))
  68. (zero? (system* "./etc/make-liarc.sh"
  69. (string-append "--prefix=" out))))))
  70. %standard-phases))))
  71. (inputs
  72. `(;; TODO: Build doc when TeX Live is available.
  73. ;; ("automake" ,automake)
  74. ;; ("texlive-core" ,texlive-core)
  75. ("texinfo" ,texinfo)
  76. ("m4" ,m4)
  77. ("source"
  78. ;; MIT/GNU Scheme is not bootstrappable, so it's recommended to
  79. ;; compile from the architecture-specific tarballs, which contain
  80. ;; pre-built binaries. It leads to more efficient code than when
  81. ;; building the tarball that contains generated C code instead of
  82. ;; those binaries.
  83. ,(origin
  84. (method url-fetch)
  85. (uri (string-append "mirror://gnu/mit-scheme/stable.pkg/"
  86. version "/mit-scheme-"
  87. version "-"
  88. (match (%current-system)
  89. ("x86_64-linux" "x86-64")
  90. ("i686-linux" "i386")
  91. (_ "c"))
  92. ".tar.gz"))
  93. (sha256
  94. (match (%current-system)
  95. ("x86_64-linux"
  96. (base32
  97. "1wcxm9hyfc53myvlcn93fyqrnnn4scwkknl9hkbp1cphc6mp291x"))
  98. ("i686-linux"
  99. (base32
  100. "0vi760fy550d9db538m0vzbq1mpdncvw9g8bk4lswk0kcdira55z"))
  101. (_
  102. (base32
  103. "0pclakzwxbqgy6wqwvs6ml62wgby8ba8xzmwzdwhx1v8wv05yw1j"))))))))
  104. (home-page "http://www.gnu.org/software/mit-scheme/")
  105. (synopsis "Scheme implementation with integrated editor and debugger")
  106. (description
  107. "MIT/GNU Scheme is an implementation of the Scheme programming
  108. language. It provides an interpreter, a compiler and a debugger. It also
  109. features an integrated Emacs-like editor and a large runtime library.")
  110. (license gpl2+)))
  111. (define-public bigloo
  112. (package
  113. (name "bigloo")
  114. (version "4.0b")
  115. (source (origin
  116. (method url-fetch)
  117. (uri (string-append "ftp://ftp-sop.inria.fr/indes/fp/Bigloo/bigloo"
  118. version ".tar.gz"))
  119. (sha256
  120. (base32
  121. "1fck2h48f0bvh8fl437cagmp0syfxy9lqacy1zwsis20fc76jvzi"))
  122. (patches (list (search-patch "bigloo-gc-shebangs.patch")))))
  123. (build-system gnu-build-system)
  124. (arguments
  125. `(#:test-target "test"
  126. #:phases (alist-replace
  127. 'configure
  128. (lambda* (#:key outputs #:allow-other-keys)
  129. (substitute* "configure"
  130. (("^shell=.*$")
  131. (string-append "shell=" (which "bash") "\n")))
  132. ;; Since libgc's pthread redirects are used, we end up
  133. ;; using libgc symbols, so we must link against it.
  134. ;; Reported on 2013-06-25.
  135. (substitute* "api/pthread/src/Makefile"
  136. (("^EXTRALIBS[[:blank:]]*=(.*)$" _ value)
  137. (string-append "EXTRALIBS = "
  138. (string-trim-right value)
  139. " -l$(GCLIB)_fth-$(RELEASE)"
  140. " -Wl,-rpath=" (assoc-ref outputs "out")
  141. "/lib/bigloo/" ,version)))
  142. ;; Those variables are used by libgc's `configure'.
  143. (setenv "SHELL" (which "sh"))
  144. (setenv "CONFIG_SHELL" (which "sh"))
  145. ;; ... but they turned out to be overridden later, so work
  146. ;; around that.
  147. (substitute* (find-files "gc" "^configure-gc")
  148. (("sh=/bin/sh")
  149. (string-append "sh=" (which "sh"))))
  150. ;; The `configure' script doesn't understand options
  151. ;; of those of Autoconf.
  152. (let ((out (assoc-ref outputs "out")))
  153. (zero?
  154. (system* "./configure"
  155. (string-append "--prefix=" out)
  156. (string-append"--mv=" (which "mv"))
  157. (string-append "--rm=" (which "rm"))))))
  158. (alist-cons-after
  159. 'install 'install-emacs-modes
  160. (lambda* (#:key outputs #:allow-other-keys)
  161. (let* ((out (assoc-ref outputs "out"))
  162. (dir (string-append out "/share/emacs/site-lisp")))
  163. (zero? (system* "make" "-C" "bmacs" "all" "install"
  164. (string-append "EMACSBRAND=emacs24")
  165. (string-append "EMACSDIR=" dir)))))
  166. %standard-phases))))
  167. (inputs
  168. `(("emacs" ,emacs)
  169. ;; Optional APIs for which Bigloo has bindings.
  170. ("avahi" ,avahi)
  171. ("libphidget" ,libphidget)))
  172. (native-inputs
  173. `(("pkg-config" ,pkg-config)))
  174. (propagated-inputs
  175. `(("gmp" ,gmp))) ; bigloo.h refers to gmp.h
  176. (home-page "http://www-sop.inria.fr/indes/fp/Bigloo/")
  177. (synopsis "Bigloo, an efficient Scheme compiler")
  178. (description
  179. "Bigloo is a Scheme implementation devoted to one goal: enabling
  180. Scheme based programming style where C(++) is usually
  181. required. Bigloo attempts to make Scheme practical by offering
  182. features usually presented by traditional programming languages
  183. but not offered by Scheme and functional programming. Bigloo
  184. compiles Scheme modules. It delivers small and fast stand alone
  185. binary executables. Bigloo enables full connections between
  186. Scheme and C programs, between Scheme and Java programs, and
  187. between Scheme and C# programs.")
  188. (license gpl2+)))
  189. (define-public hop
  190. (package
  191. (name "hop")
  192. (version "2.4.0")
  193. (source (origin
  194. (method url-fetch)
  195. (uri (string-append "ftp://ftp-sop.inria.fr/indes/fp/Hop/hop-"
  196. version ".tar.gz"))
  197. (sha256
  198. (base32
  199. "1v2r4ga58kk1sx0frn8qa8ccmjpic9csqzpk499wc95y9c4b1wy3"))
  200. (patches (list (search-patch "hop-bigloo-4.0b.patch")))))
  201. (build-system gnu-build-system)
  202. (arguments
  203. '(#:phases
  204. (alist-replace
  205. 'configure
  206. (lambda* (#:key inputs outputs #:allow-other-keys)
  207. (let ((out (assoc-ref outputs "out")))
  208. (zero?
  209. (system* "./configure"
  210. (string-append"--prefix=" out)))))
  211. (alist-cons-after
  212. 'strip 'patch-rpath
  213. (lambda* (#:key outputs #:allow-other-keys)
  214. ;; Patch the RPATH of every installed library to point to $out/lib
  215. ;; instead of $TMPDIR. Note that "patchelf --set-rpath" produces
  216. ;; invalid binaries when used before stripping.
  217. (let ((out (assoc-ref outputs "out"))
  218. (tmpdir (getcwd)))
  219. (every (lambda (lib)
  220. (let* ((in (open-pipe* OPEN_READ "patchelf"
  221. "--print-rpath" lib))
  222. (rpath (read-line in)))
  223. (and (zero? (close-pipe in))
  224. (let ((rpath* (regexp-substitute/global
  225. #f (regexp-quote tmpdir) rpath
  226. 'pre out 'post)))
  227. (or (equal? rpath rpath*)
  228. (begin
  229. (format #t "~a: changing RPATH from `~a' to `~a'~%"
  230. lib rpath rpath*)
  231. (zero?
  232. (system* "patchelf" "--set-rpath"
  233. rpath* lib))))))))
  234. (append (find-files (string-append out "/bin")
  235. ".*")
  236. (find-files (string-append out "/lib")
  237. "\\.so$")))))
  238. %standard-phases))
  239. #:tests? #f ; no test suite
  240. #:modules ((guix build gnu-build-system)
  241. (guix build utils)
  242. (ice-9 popen)
  243. (ice-9 regex)
  244. (ice-9 rdelim)
  245. (srfi srfi-1))))
  246. (inputs `(("bigloo" ,bigloo)
  247. ("which" ,which)
  248. ("patchelf" ,patchelf)))
  249. (home-page "http://hop.inria.fr/")
  250. (synopsis "A multi-tier programming language for the Web 2.0")
  251. (description
  252. "HOP is a multi-tier programming language for the Web 2.0 and the
  253. so-called diffuse Web. It is designed for programming interactive web
  254. applications in many fields such as multimedia (web galleries, music players,
  255. ...), ubiquitous and house automation (SmartPhones, personal appliance),
  256. mashups, office (web agendas, mail clients, ...), etc.")
  257. (license gpl2+)))
  258. (define-public chicken
  259. (package
  260. (name "chicken")
  261. (version "4.8.0.3")
  262. (source (origin
  263. (method url-fetch)
  264. (uri (string-append "http://code.call-cc.org/releases/4.8.0/chicken-"
  265. version ".tar.gz"))
  266. (sha256
  267. (base32
  268. "1hwrnc2dhgbnz3mlpcb4qvg76kwsfzqylw24gxyy91jmygk1853a"))))
  269. (build-system gnu-build-system)
  270. (arguments
  271. `(#:modules ((guix build gnu-build-system)
  272. (guix build utils)
  273. (srfi srfi-1))
  274. ;; No `configure' script; run "make check" after "make install" as
  275. ;; prescribed by README.
  276. #:phases (alist-cons-after
  277. 'install 'check
  278. (assoc-ref %standard-phases 'check)
  279. (fold alist-delete %standard-phases
  280. '(configure check)))
  281. #:make-flags (let ((out (assoc-ref %outputs "out")))
  282. (list "PLATFORM=linux"
  283. (string-append "PREFIX=" out)
  284. (string-append "VARDIR=" out "/var/lib")))
  285. ;; Parallel builds are not supported, as noted in README.
  286. #:parallel-build? #f))
  287. (home-page "http://www.call-cc.org/")
  288. (synopsis "R5RS Scheme implementation that compiles native code via C")
  289. (description
  290. "CHICKEN is a compiler for the Scheme programming language. CHICKEN
  291. produces portable and efficient C, supports almost all of the R5RS Scheme
  292. language standard, and includes many enhancements and extensions.")
  293. (license bsd-3)))
  294. (define-public scheme48
  295. (package
  296. (name "scheme48")
  297. (version "1.9")
  298. (source (origin
  299. (method url-fetch)
  300. (uri (string-append "http://s48.org/" version
  301. "/scheme48-" version ".tgz"))
  302. (sha256
  303. (base32
  304. "0rw2lz5xgld0klvld292ds6hvfk5l12vskzgf1hhwjdpa38r3fnw"))
  305. (patches (list (search-patch "scheme48-tests.patch")))))
  306. (build-system gnu-build-system)
  307. (home-page "http://s48.org/")
  308. (synopsis "Scheme implementation using a bytecode interpreter")
  309. (description
  310. "Scheme 48 is an implementation of Scheme based on a byte-code
  311. interpreter and is designed to be used as a testbed for experiments in
  312. implementation techniques and as an expository tool.")
  313. ;; Most files are BSD-3; see COPYING for the few exceptions.
  314. (license bsd-3)))
  315. (define-public racket
  316. (package
  317. (name "racket")
  318. (version "5.3.4")
  319. (source (origin
  320. (method url-fetch)
  321. (uri (list (string-append "http://download.racket-lang.org/installers/"
  322. version "/racket/racket-" version
  323. "-src-unix.tgz")
  324. (string-append
  325. "http://mirror.informatik.uni-tuebingen.de/mirror/racket/"
  326. version "/racket/racket-" version "-src-unix.tgz")))
  327. (sha256
  328. ;; XXX: Used to be 1xhnx3yd74zrvn6sfcqmk57kxj51cwvm660dwiaxr1qxnm5lq0v7.
  329. (base32 "0yrdmpdvzf092869y6zjjjxl6j2kypgiv7qrfkv7lj8w01pbh7sd"))))
  330. (build-system gnu-build-system)
  331. (arguments
  332. '(#:phases
  333. (let* ((gui-libs
  334. (lambda (inputs)
  335. (define (lib input)
  336. (string-append (assoc-ref inputs input) "/lib"))
  337. (list (lib "glib")
  338. (lib "cairo")
  339. (lib "pango")
  340. (lib "libjpeg")
  341. (lib "gtk")
  342. (lib "gdk-pixbuf")))))
  343. (alist-cons-before
  344. 'configure 'pre-configure
  345. (lambda* (#:key inputs #:allow-other-keys)
  346. (chdir "src")
  347. ;; The GUI libs are dynamically opened through the FFI, so they
  348. ;; must be in the loader's search path.
  349. (setenv "LD_LIBRARY_PATH" (string-join (gui-libs inputs) ":")))
  350. (alist-cons-after
  351. 'unpack 'patch-/bin/sh
  352. (lambda _
  353. (substitute* "collects/racket/system.rkt"
  354. (("/bin/sh") (which "sh"))))
  355. (alist-cons-after
  356. 'install 'wrap-programs
  357. (lambda* (#:key inputs outputs #:allow-other-keys)
  358. (let ((out (assoc-ref outputs "out")))
  359. (define (wrap prog)
  360. (wrap-program prog
  361. `("LD_LIBRARY_PATH" ":" prefix
  362. ,(gui-libs inputs))))
  363. (with-directory-excursion (string-append out "/bin")
  364. (for-each wrap
  365. (list "gracket" "drracket" "slideshow" "mred"))
  366. #t)))
  367. %standard-phases))))
  368. #:tests? #f ; XXX: how to run them?
  369. ))
  370. (inputs `(("libffi" ,libffi)
  371. ("glib" ,glib) ; for DrRacket
  372. ("cairo" ,cairo)
  373. ("pango" ,pango)
  374. ("libjpeg" ,libjpeg-8)
  375. ("gdk-pixbuf" ,gdk-pixbuf)
  376. ("gtk" ,gtk+-2)))
  377. (home-page "http://racket-lang.org")
  378. (synopsis "Implementation of Scheme and related languages")
  379. (description
  380. "Racket is an implementation of the Scheme programming language (R5RS and
  381. R6RS) and related languages, such as Typed Racket. It features a compiler and
  382. a virtual machine with just-in-time native compilation, as well as a large set
  383. of libraries.")
  384. (license lgpl2.0+)))