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.

693 lines
30 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 base)
  19. #:use-module (guix packages)
  20. #:use-module (guix http)
  21. #:use-module (guix build-system gnu)
  22. #:use-module (guix utils))
  23. ;;; Commentary:
  24. ;;;
  25. ;;; A Guix-based distribution.
  26. ;;;
  27. ;;; Code:
  28. (define-public libsigsegv
  29. (package
  30. (name "libsigsegv")
  31. (version "2.10")
  32. (source (origin
  33. (method http-fetch)
  34. (uri (string-append
  35. "http://ftp.gnu.org/gnu/libsigsegv/libsigsegv-"
  36. version ".tar.gz"))
  37. (sha256
  38. (base32 "16hrs8k3nmc7a8jam5j1fpspd6sdpkamskvsdpcw6m29vnis8q44"))))
  39. (build-system gnu-build-system)
  40. (outputs '("out" "lib")) ; separate libdir from the rest
  41. (home-page "http://www.gnu.org/software/libsigsegv/")
  42. (description "GNU libsigsegv, a library to handle page faults in user mode")
  43. (long-description
  44. "GNU libsigsegv is a library for handling page faults in user mode. A page
  45. fault occurs when a program tries to access to a region of memory that is
  46. currently not available. Catching and handling a page fault is a useful
  47. technique for implementing pageable virtual memory, memory-mapped access to
  48. persistent databases, generational garbage collectors, stack overflow
  49. handlers, distributed shared memory, and more.")
  50. (license "GPLv2+")))
  51. (define-public gawk
  52. (package
  53. (name "gawk")
  54. (version "4.0.0")
  55. (source (origin
  56. (method http-fetch)
  57. (uri (string-append "http://ftp.gnu.org/gnu/gawk/gawk-" version
  58. ".tar.bz2"))
  59. (sha256
  60. (base32 "0sss7rhpvizi2a88h6giv0i7w5h07s2fxkw3s6n1hqvcnhrfgbb0"))))
  61. (build-system gnu-build-system)
  62. (arguments (case-lambda
  63. ((system)
  64. (if (string=? system "i686-cygwin")
  65. '(#:tests? #f) ; work around test failure on Cygwin
  66. '(#:parallel-tests? #f))) ; test suite fails in parallel
  67. ((system cross-system)
  68. '(#:parallel-tests? #f))))
  69. (inputs `(("libsigsegv" ,libsigsegv) ; headers
  70. ("libsigsegv/lib" ,libsigsegv "lib"))) ; library
  71. (home-page "http://www.gnu.org/software/gawk/")
  72. (description "GNU implementation of the Awk programming language")
  73. (long-description
  74. "Many computer users need to manipulate text files: extract and then
  75. operate on data from parts of certain lines while discarding the rest, make
  76. changes in various text files wherever certain patterns appear, and so on.
  77. To write a program to do these things in a language such as C or Pascal is a
  78. time-consuming inconvenience that may take many lines of code. The job is
  79. easy with awk, especially the GNU implementation: Gawk.
  80. The awk utility interprets a special-purpose programming language that makes
  81. it possible to handle many data-reformatting jobs with just a few lines of
  82. code.")
  83. (license "GPLv3+")))
  84. (define-public hello
  85. (package
  86. (name "hello")
  87. (version "2.8")
  88. (source (origin
  89. (method http-fetch)
  90. (uri (string-append "http://ftp.gnu.org/gnu/hello/hello-" version
  91. ".tar.gz"))
  92. (sha256
  93. (base32 "0wqd8sjmxfskrflaxywc7gqw7sfawrfvdxd9skxawzfgyy0pzdz6"))))
  94. (build-system gnu-build-system)
  95. (arguments '(#:configure-flags
  96. `("--disable-dependency-tracking"
  97. ,(string-append "--with-gawk=" ; for illustration purposes
  98. (assoc-ref %build-inputs "gawk")))))
  99. (inputs `(("gawk" ,gawk)))
  100. (description "GNU Hello")
  101. (long-description "Yeah...")
  102. (home-page "http://www.gnu.org/software/hello/")
  103. (license "GPLv3+")))
  104. (define-public m4
  105. (package
  106. (name "m4")
  107. (version "1.4.16")
  108. (source (origin
  109. (method http-fetch)
  110. (uri (string-append "http://ftp.gnu.org/gnu/m4/m4-"
  111. version ".tar.bz2"))
  112. (sha256
  113. (base32
  114. "035r7ma272j2cwni2961jp22k6bn3n9xwn3b3qbcn2yrvlghql22"))))
  115. (build-system gnu-build-system)
  116. (arguments (case-lambda
  117. ((system)
  118. ;; XXX: Disable tests on those platforms with know issues.
  119. `(#:tests? ,(not (member system
  120. '("x86_64-darwin"
  121. "i686-cygwin"
  122. "i686-sunos")))
  123. #:patches (list (assoc-ref %build-inputs "patch/s_isdir")
  124. (assoc-ref %build-inputs
  125. "patch/readlink-EINVAL"))))
  126. ((system cross-system)
  127. `(#:patches (list (assoc-ref %build-inputs "patch/s_isdir")
  128. (assoc-ref %build-inputs
  129. "patch/readlink-EINVAL"))))))
  130. (inputs `(("patch/s_isdir"
  131. ,(search-path %load-path "distro/m4-s_isdir.patch"))
  132. ("patch/readlink-EINVAL"
  133. ,(search-path %load-path "distro/m4-readlink-EINVAL.patch"))))
  134. (description "GNU M4, a macro processor")
  135. (long-description
  136. "GNU M4 is an implementation of the traditional Unix macro processor. It
  137. is mostly SVR4 compatible although it has some extensions (for example,
  138. handling more than 9 positional parameters to macros). GNU M4 also has
  139. built-in functions for including files, running shell commands, doing
  140. arithmetic, etc.
  141. GNU M4 is a macro processor in the sense that it copies its input to the
  142. output expanding macros as it goes. Macros are either builtin or
  143. user-defined and can take any number of arguments. Besides just doing macro
  144. expansion, m4 has builtin functions for including named files, running UNIX
  145. commands, doing integer arithmetic, manipulating text in various ways,
  146. recursion etc... m4 can be used either as a front-end to a compiler or as a
  147. macro processor in its own right.")
  148. (license "GPLv3+")
  149. (home-page "http://www.gnu.org/software/m4/")))
  150. (define-public gmp
  151. (package
  152. (name "gmp")
  153. (version "5.0.5")
  154. (source (origin
  155. (method http-fetch)
  156. (uri (string-append "http://ftp.gnu.org/gnu/gmp-" version
  157. ".tar.bz2"))
  158. (sha256
  159. (base32
  160. "1jfymbr90mpn0zw5sg001llqnvf2462y77vgjknrmfs1rjn8ln0z"))))
  161. (build-system gnu-build-system)
  162. (native-inputs `(("m4" ,m4)))
  163. (arguments `(#:configure-flags
  164. '(;; Build a "fat binary", with routines for several
  165. ;; sub-architectures.
  166. "--enable-fat"
  167. "--enable-cxx")))
  168. (description "GMP, the GNU multiple precision arithmetic library")
  169. (long-description
  170. "GMP is a free library for arbitrary precision arithmetic, operating on
  171. signed integers, rational numbers, and floating point numbers. There is no
  172. practical limit to the precision except the ones implied by the available
  173. memory in the machine GMP runs on. GMP has a rich set of functions, and the
  174. functions have a regular interface.
  175. The main target applications for GMP are cryptography applications and
  176. research, Internet security applications, algebra systems, computational
  177. algebra research, etc.
  178. GMP is carefully designed to be as fast as possible, both for small operands
  179. and for huge operands. The speed is achieved by using fullwords as the basic
  180. arithmetic type, by using fast algorithms, with highly optimised assembly
  181. code for the most common inner loops for a lot of CPUs, and by a general
  182. emphasis on speed.
  183. GMP is faster than any other bignum library. The advantage for GMP increases
  184. with the operand sizes for many operations, since GMP uses asymptotically
  185. faster algorithms.")
  186. (license "LGPLv3+")
  187. (home-page "http://gmplib.org/")))
  188. (define-public ncurses
  189. (let ((post-install-phase
  190. '(lambda* (#:key outputs #:allow-other-keys)
  191. (let ((out (assoc-ref outputs "out")))
  192. ;; When building a wide-character (Unicode) build, create backward
  193. ;; compatibility links from the the "normal" libraries to the
  194. ;; wide-character libraries (e.g. libncurses.so to libncursesw.so).
  195. (with-directory-excursion (string-append out "/lib")
  196. (for-each (lambda (lib)
  197. (define libw.a
  198. (string-append "lib" lib "w.a"))
  199. (define lib.a
  200. (string-append "lib" lib ".a"))
  201. (define libw.so.x
  202. (string-append "lib" lib "w.so.5"))
  203. (define lib.so.x
  204. (string-append "lib" lib ".so.5"))
  205. (define lib.so
  206. (string-append "lib" lib ".so"))
  207. (when (file-exists? libw.a)
  208. (format #t "creating symlinks for `lib~a'~%" lib)
  209. (symlink libw.a lib.a)
  210. (symlink libw.so.x lib.so.x)
  211. (false-if-exception (delete-file lib.so))
  212. (call-with-output-file lib.so
  213. (lambda (p)
  214. (format p "INPUT (-l~aw)~%" lib)))))
  215. '("curses" "ncurses" "form" "panel" "menu")))))))
  216. (package
  217. (name "ncurses")
  218. (version "5.9")
  219. (source (origin
  220. (method http-fetch)
  221. (uri (string-append "http://ftp.gnu.org/gnu/ncurses/ncurses-"
  222. version ".tar.gz"))
  223. (sha256
  224. (base32
  225. "0fsn7xis81za62afan0vvm38bvgzg5wfmv1m86flqcj0nj7jjilh"))))
  226. (build-system gnu-build-system)
  227. (arguments
  228. (case-lambda
  229. ((system)
  230. `(#:configure-flags
  231. `("--with-shared" "--without-debug" "--enable-widec"
  232. ;; By default headers land in an `ncursesw' subdir, which is not
  233. ;; what users expect.
  234. ,(string-append "--includedir=" (assoc-ref %outputs "out")
  235. "/include")
  236. ;; C++ bindings fail to build on
  237. ;; `i386-pc-solaris2.11' with GCC 3.4.3:
  238. ;; <http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=6395191>.
  239. ,,@(if (string=? system "i686-solaris")
  240. '("--without-cxx-binding")
  241. '()))
  242. #:tests? #f ; no "check" target
  243. #:phases (alist-cons-after 'install 'post-install
  244. ,post-install-phase
  245. %standard-phases)))
  246. ((system cross-system)
  247. (arguments cross-system))))
  248. (self-native-input? #t)
  249. (description
  250. "GNU Ncurses, a free software emulation of curses in SVR4 and more")
  251. (long-description
  252. "The Ncurses (new curses) library is a free software emulation of curses
  253. in System V Release 4.0, and more. It uses Terminfo format, supports pads
  254. and color and multiple highlights and forms characters and function-key
  255. mapping, and has all the other SYSV-curses enhancements over BSD Curses.
  256. The ncurses code was developed under GNU/Linux. It has been in use for some
  257. time with OpenBSD as the system curses library, and on FreeBSD and NetBSD as
  258. an external package. It should port easily to any ANSI/POSIX-conforming
  259. UNIX. It has even been ported to OS/2 Warp!")
  260. (license "X11")
  261. (home-page "http://www.gnu.org/software/ncurses/"))))
  262. (define-public readline
  263. (package
  264. (name "readline")
  265. (version "6.2")
  266. (source (origin
  267. (method http-fetch)
  268. (uri (string-append "http://ftp.gnu.org/gnu/readline/readline-"
  269. version ".tar.gz"))
  270. (sha256
  271. (base32
  272. "10ckm2bd2rkxhvdmj7nmbsylmihw0abwcsnxf8y27305183rd9kr"))))
  273. (build-system gnu-build-system)
  274. (propagated-inputs `(("ncurses" ,ncurses)))
  275. (inputs `(("patch/link-ncurses"
  276. ,(search-path %load-path
  277. "distro/readline-link-ncurses.patch"))))
  278. (arguments `(#:patches (list (assoc-ref %build-inputs
  279. "patch/link-ncurses"))
  280. #:patch-flags '("-p0")))
  281. (description "GNU Readline, a library for interactive line editing")
  282. (long-description
  283. "The GNU Readline library provides a set of functions for use by
  284. applications that allow users to edit command lines as they are typed in.
  285. Both Emacs and vi editing modes are available. The Readline library includes
  286. additional functions to maintain a list of previously-entered command lines,
  287. to recall and perhaps reedit those lines, and perform csh-like history
  288. expansion on previous commands.
  289. The history facilites are also placed into a separate library, the History
  290. library, as part of the build process. The History library may be used
  291. without Readline in applications which desire its capabilities.")
  292. (license "GPLv3+")
  293. (home-page "http://savannah.gnu.org/projects/readline/")))
  294. (define-public libtool
  295. (package
  296. (name "libtool")
  297. (version "2.4.2")
  298. (source (origin
  299. (method http-fetch)
  300. (uri (string-append "http://ftp.gnu.org/gnu/libtool/libtool-"
  301. version ".tar.gz"))
  302. (sha256
  303. (base32
  304. "0649qfpzkswgcj9vqkkr9rn4nlcx80faxpyqscy2k1x9c94f93dk"))))
  305. (build-system gnu-build-system)
  306. (native-inputs `(("m4" ,m4)
  307. ("perl" ,(nixpkgs-derivation* "perl"))))
  308. (description "GNU Libtool, a generic library support script")
  309. (long-description
  310. "GNU libtool is a generic library support script. Libtool hides the
  311. complexity of using shared libraries behind a consistent, portable interface.
  312. To use libtool, add the new generic library building commands to your
  313. Makefile, Makefile.in, or Makefile.am. See the documentation for
  314. details.")
  315. (license "GPLv3+")
  316. (home-page "http://www.gnu.org/software/libtool/")))
  317. (define-public libunistring
  318. (package
  319. (name "libunistring")
  320. (version "0.9.3")
  321. (source (origin
  322. (method http-fetch)
  323. (uri (string-append
  324. "http://ftp.gnu.org/gnu/libunistring/libunistring-"
  325. version ".tar.gz"))
  326. (sha256
  327. (base32
  328. "18q620269xzpw39dwvr9zpilnl2dkw5z5kz3mxaadnpv4k3kw3b1"))))
  329. (propagated-inputs '()) ; FIXME: add libiconv when !glibc
  330. (build-system gnu-build-system)
  331. (description "GNU Libunistring, a Unicode string library")
  332. (long-description
  333. "This library provides functions for manipulating Unicode strings and for
  334. manipulating C strings according to the Unicode standard.
  335. GNU libunistring is for you if your application involves non-trivial text
  336. processing, such as upper/lower case conversions, line breaking, operations
  337. on words, or more advanced analysis of text. Text provided by the user can,
  338. in general, contain characters of all kinds of scripts. The text processing
  339. functions provided by this library handle all scripts and all languages.
  340. libunistring is for you if your application already uses the ISO C / POSIX
  341. <ctype.h>, <wctype.h> functions and the text it operates on is provided by
  342. the user and can be in any language.
  343. libunistring is also for you if your application uses Unicode strings as
  344. internal in-memory representation.")
  345. (home-page "http://www.gnu.org/software/libunistring/")
  346. (license "LGPLv3+")))
  347. (define-public recutils
  348. (package
  349. (name "recutils")
  350. (version "1.5")
  351. (source (origin
  352. (method http-fetch)
  353. (uri (string-append "http://ftp.gnu.org/gnu/recutils/recutils-"
  354. version ".tar.gz"))
  355. (sha256
  356. (base32
  357. "1v2xzwwwhc5j5kmvg4sv6baxjpsfqh8ln7ilv4mgb1408rs7xmky"))))
  358. (build-system gnu-build-system)
  359. (inputs `(("curl" ,(nixpkgs-derivation* "curl"))
  360. ("emacs" ,(nixpkgs-derivation* "emacs"))
  361. ("check" ,(nixpkgs-derivation* "check"))
  362. ("bc" ,(nixpkgs-derivation* "bc"))))
  363. (description "GNU recutils, tools and libraries to access human-editable,
  364. text-based databases")
  365. (long-description
  366. "GNU recutils is a set of tools and libraries to access human-editable,
  367. text-based databases called recfiles. The data is stored as a sequence of
  368. records, each record containing an arbitrary number of named fields.")
  369. (license "GPLv3+")
  370. (home-page "http://www.gnu.org/software/recutils/")))
  371. (define-public guile-1.8
  372. (package
  373. (name "guile")
  374. (version "1.8.8")
  375. (source (origin
  376. (method http-fetch)
  377. (uri (string-append "http://ftp.gnu.org/gnu/guile/guile-" version
  378. ".tar.gz"))
  379. (sha256
  380. (base32
  381. "0l200a0v7h8bh0cwz6v7hc13ds39cgqsmfrks55b1rbj5vniyiy3"))))
  382. (build-system gnu-build-system)
  383. (arguments '(#:configure-flags '("--disable-error-on-warning")
  384. #:patches (list (assoc-ref %build-inputs "patch/snarf"))
  385. ;; Insert a phase before `configure' to patch things up.
  386. #:phases (alist-cons-before
  387. 'configure
  388. 'patch-loader-search-path
  389. (lambda* (#:key outputs #:allow-other-keys)
  390. ;; Add a call to `lt_dladdsearchdir' so that
  391. ;; `libguile-readline.so' & co. are in the
  392. ;; loader's search path.
  393. (substitute* "libguile/dynl.c"
  394. (("lt_dlinit.*$" match)
  395. (format #f
  396. " ~a~% lt_dladdsearchdir(\"~a/lib\");~%"
  397. match
  398. (assoc-ref outputs "out")))))
  399. %standard-phases)))
  400. (inputs `(("patch/snarf"
  401. ,(search-path %load-path "distro/guile-1.8-cpp-4.5.patch"))
  402. ("gawk" ,gawk)
  403. ("readline" ,readline)))
  404. ;; Since `guile-1.8.pc' has "Libs: ... -lgmp -lltdl", these must be
  405. ;; propagated.
  406. (propagated-inputs `(("gmp" ,gmp)
  407. ("libtool" ,libtool)))
  408. ;; When cross-compiling, a native version of Guile itself is needed.
  409. (self-native-input? #t)
  410. (description "GNU Guile 1.8, an embeddable Scheme interpreter")
  411. (long-description
  412. "GNU Guile 1.8 is an interpreter for the Scheme programming language,
  413. packaged as a library that can be embedded into programs to make them
  414. extensible. It supports many SRFIs.")
  415. (home-page "http://www.gnu.org/software/guile/")
  416. (license "LGPLv2+")))
  417. (define-public libffi
  418. (let ((post-install-phase
  419. ;; Install headers in the right place.
  420. '(lambda* (#:key outputs #:allow-other-keys)
  421. (define out (assoc-ref outputs "out"))
  422. (mkdir (string-append out "/include"))
  423. (with-directory-excursion
  424. (string-append out "/lib/libffi-3.0.9/include")
  425. (for-each (lambda (h)
  426. (format #t "moving `~a' to includedir~%" h)
  427. (rename-file h (string-append out "/include/" h)))
  428. (scandir "."
  429. (lambda (x)
  430. (not (member x '("." ".."))))))))))
  431. (package
  432. (name "libffi")
  433. (version "3.0.9")
  434. (source (origin
  435. (method http-fetch)
  436. (uri ;; FIXME: should be ftp://
  437. (string-append "http://sourceware.org/pub/libffi/"
  438. name "-" version ".tar.gz"))
  439. (sha256
  440. (base32
  441. "0ln4jbpb6clcsdpb9niqk0frgx4k0xki96wiv067ig0q4cajb7aq"))))
  442. (build-system gnu-build-system)
  443. (arguments `(#:modules ((guix build utils) (guix build gnu-build-system)
  444. (ice-9 ftw) (srfi srfi-26))
  445. #:phases (alist-cons-after 'install 'post-install
  446. ,post-install-phase
  447. %standard-phases)))
  448. (description "libffi, a foreign function call interface library")
  449. (long-description
  450. "The libffi library provides a portable, high level programming interface
  451. to various calling conventions. This allows a programmer to call any
  452. function specified by a call interface description at run-time.
  453. FFI stands for Foreign Function Interface. A foreign function interface is
  454. the popular name for the interface that allows code written in one language
  455. to call code written in another language. The libffi library really only
  456. provides the lowest, machine dependent layer of a fully featured foreign
  457. function interface. A layer must exist above libffi that handles type
  458. conversions for values passed between the two languages.")
  459. (home-page "http://sources.redhat.com/libffi/")
  460. ;; See <http://github.com/atgreen/libffi/blob/master/LICENSE>.
  461. (license "free, non-copyleft"))))
  462. (define-public guile-2.0
  463. (package
  464. (name "guile")
  465. (version "2.0.6")
  466. (source (origin
  467. (method http-fetch)
  468. (uri (string-append "http://ftp.gnu.org/gnu/guile/guile-" version
  469. ".tar.xz"))
  470. (sha256
  471. (base32
  472. "000ng5qsq3cl1k35jvzvhwxj92wx4q87745n2fppkd4irh58vv5l"))))
  473. (build-system gnu-build-system)
  474. (native-inputs `(("xz" ,(nixpkgs-derivation* "xz"))
  475. ("pkgconfig" ,(nixpkgs-derivation* "pkgconfig"))))
  476. (inputs `(("libffi" ,libffi)
  477. ("readline" ,readline)))
  478. (propagated-inputs
  479. `( ;; These ones aren't normally needed here, but since `libguile-2.0.la'
  480. ;; reads `-lltdl -lunistring', adding them here will add the needed
  481. ;; `-L' flags. As for why the `.la' file lacks the `-L' flags, see
  482. ;; <http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/18903>.
  483. ("libunistring" ,libunistring)
  484. ("libtool" ,libtool)
  485. ;; The headers and/or `guile-2.0.pc' refer to these packages, so they
  486. ;; must be propagated.
  487. ("bdw-gc" ,(nixpkgs-derivation* "boehmgc"))
  488. ("gmp" ,gmp)))
  489. (self-native-input? #t)
  490. (description "GNU Guile 2.0, an embeddable Scheme implementation")
  491. (long-description
  492. "GNU Guile is an implementation of the Scheme programming language, with
  493. support for many SRFIs, packaged for use in a wide variety of environments.
  494. In addition to implementing the R5RS Scheme standard and a large subset of
  495. R6RS, Guile includes a module system, full access to POSIX system calls,
  496. networking support, multiple threads, dynamic linking, a foreign function
  497. call interface, and powerful string processing.")
  498. (home-page "http://www.gnu.org/software/guile/")
  499. (license "LGPLv3+")))
  500. (define (guile-reader guile)
  501. "Build Guile-Reader against GUILE, a package of some version of Guile 1.8
  502. or 2.0."
  503. (package
  504. (name (string-append "guile-reader-for-guile-" (package-version guile)))
  505. (version "0.6")
  506. (source (origin
  507. (method http-fetch)
  508. (uri (string-append
  509. "http://download-mirror.savannah.gnu.org/releases/guile-reader/guile-reader-"
  510. version ".tar.gz"))
  511. (sha256
  512. (base32
  513. "1svlyk5pm4fsdp2g7n6qffdl6fdggxnlicj0jn9s4lxd63gzxy1n"))))
  514. (build-system gnu-build-system)
  515. (native-inputs `(("pkgconfig" ,(nixpkgs-derivation* "pkgconfig"))
  516. ("gperf" ,(nixpkgs-derivation* "gperf"))))
  517. (inputs `(("guile" ,guile)))
  518. (description "Guile-Reader, a simple framework for building readers for
  519. GNU Guile")
  520. (long-description
  521. "Guile-Reader is a simple framework for building readers for GNU Guile.
  522. The idea is to make it easy to build procedures that extend Guiles read
  523. procedure. Readers supporting various syntax variants can easily be written,
  524. possibly by re-using existing token readers of a standard Scheme
  525. readers. For example, it is used to implement Skribilos R5RS-derived
  526. document syntax.
  527. Guile-Readers approach is similar to Common Lisps read table, but
  528. hopefully more powerful and flexible (for instance, one may instantiate as
  529. many readers as needed).")
  530. (home-page "http://www.nongnu.org/guile-reader/")
  531. (license "GPLv3+")))
  532. (define-public guile-reader/guile-1.8
  533. ;; Guile-Reader built against Guile 1.8.
  534. (guile-reader guile-1.8))
  535. (define-public guile-reader/guile-2.0
  536. ;; Guile-Reader built against Guile 2.0.
  537. (guile-reader guile-2.0))
  538. (define-public lout
  539. ;; This one is a bit tricky, because it doesn't follow the GNU Build System
  540. ;; rules. Instead, it has a makefile that has to be patched to set the
  541. ;; prefix, etc., and it has no makefile rules to build its doc.
  542. (let ((configure-phase
  543. '(lambda* (#:key outputs #:allow-other-keys)
  544. (let ((out (assoc-ref outputs "out"))
  545. (doc (assoc-ref outputs "doc")))
  546. (substitute* "makefile"
  547. (("^PREFIX[[:blank:]]*=.*$")
  548. (string-append "PREFIX = " out "\n"))
  549. (("^LOUTLIBDIR[[:blank:]]*=.*$")
  550. (string-append "LOUTLIBDIR = " out "/lib/lout\n"))
  551. (("^LOUTDOCDIR[[:blank:]]*=.*$")
  552. (string-append "LOUTDOCDIR = " doc "/doc/lout\n"))
  553. (("^MANDIR[[:blank:]]*=.*$")
  554. (string-append "MANDIR = " out "/man\n")))
  555. (mkdir out)
  556. (mkdir (string-append out "/bin")) ; TODO: use `mkdir-p'
  557. (mkdir (string-append out "/lib"))
  558. (mkdir (string-append out "/man"))
  559. (mkdir doc)
  560. (mkdir (string-append doc "/doc"))
  561. (mkdir (string-append doc "/doc/lout")))))
  562. (install-man-phase
  563. '(lambda* (#:key outputs #:allow-other-keys)
  564. (zero? (system* "make" "installman"))))
  565. (doc-phase
  566. '(lambda* (#:key outputs #:allow-other-keys)
  567. (define out
  568. (assoc-ref outputs "doc"))
  569. (setenv "PATH"
  570. (string-append (assoc-ref outputs "out")
  571. "/bin:" (getenv "PATH")))
  572. (chdir "doc")
  573. (every (lambda (doc)
  574. (format #t "doc: building `~a'...~%" doc)
  575. (with-directory-excursion doc
  576. (let ((file (string-append out "/doc/lout/"
  577. doc ".ps")))
  578. (and (or (file-exists? "outfile.ps")
  579. (zero? (system* "lout" "-r4" "-o"
  580. "outfile.ps" "all")))
  581. (begin
  582. (copy-file "outfile.ps" file)
  583. #t)
  584. (zero? (system* "ps2pdf"
  585. "-dPDFSETTINGS=/prepress"
  586. "-sPAPERSIZE=a4"
  587. file
  588. (string-append out "/doc/lout/"
  589. doc ".pdf")))))))
  590. '("design" "expert" "slides" "user")))))
  591. (package
  592. (name "lout")
  593. (version "3.39")
  594. (source (origin
  595. (method http-fetch)
  596. ;; FIXME: `http-get' doesn't follow redirects, hence the URL.
  597. (uri (string-append
  598. "http://download-mirror.savannah.gnu.org/releases/lout/lout-"
  599. version ".tar.gz"))
  600. (sha256
  601. (base32
  602. "12gkyqrn0kaa8xq7sc7v3wm407pz2fxg9ngc75aybhi5z825b9vq"))))
  603. (build-system gnu-build-system) ; actually, just a makefile
  604. (outputs '("out" "doc"))
  605. (inputs `(("ghostscript" ,(nixpkgs-derivation* "ghostscript"))))
  606. (arguments `(#:modules ((guix build utils)
  607. (guix build gnu-build-system)
  608. (srfi srfi-1)) ; we need SRFI-1
  609. #:tests? #f ; no "check" target
  610. ;; Customize the build phases.
  611. #:phases (alist-replace
  612. 'configure ,configure-phase
  613. (alist-cons-after
  614. 'install 'install-man-pages
  615. ,install-man-phase
  616. (alist-cons-after
  617. 'install 'install-doc
  618. ,doc-phase
  619. %standard-phases)))))
  620. (description "Lout, a document layout system similar in style to LaTeX")
  621. (long-description
  622. "The Lout document formatting system is now reads a high-level description of
  623. a document similar in style to LaTeX and produces a PostScript or plain text
  624. output file.
  625. Lout offers an unprecedented range of advanced features, including optimal
  626. paragraph and page breaking, automatic hyphenation, PostScript EPS file
  627. inclusion and generation, equation formatting, tables, diagrams, rotation and
  628. scaling, sorted indexes, bibliographic databases, running headers and
  629. odd-even pages, automatic cross referencing, multilingual documents including
  630. hyphenation (most European languages are supported), formatting of computer
  631. programs, and much more, all ready to use. Furthermore, Lout is easily
  632. extended with definitions which are very much easier to write than troff of
  633. TeX macros because Lout is a high-level, purely functional language, the
  634. outcome of an eight-year research project that went back to the
  635. beginning.")
  636. (license "GPLv3+")
  637. (home-page "http://savannah.nongnu.org/projects/lout/"))))
  638. ;;; Local Variables:
  639. ;;; eval: (put 'lambda* 'scheme-indent-function 1)
  640. ;;; eval: (put 'substitute* 'scheme-indent-function 1)
  641. ;;; eval: (put 'with-directory-excursion 'scheme-indent-function 1)
  642. ;;; End: