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.

315 lines
14 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 guile-1.8
  105. (package
  106. (name "guile")
  107. (version "1.8.8")
  108. (source (origin
  109. (method http-fetch)
  110. (uri (string-append "http://ftp.gnu.org/gnu/guile/guile-" version
  111. ".tar.gz"))
  112. (sha256
  113. (base32
  114. "0l200a0v7h8bh0cwz6v7hc13ds39cgqsmfrks55b1rbj5vniyiy3"))))
  115. (build-system gnu-build-system)
  116. (arguments '(#:configure-flags '("--disable-error-on-warning")
  117. #:patches (list (assoc-ref %build-inputs "patch/snarf"))
  118. ;; Insert a phase before `configure' to patch things up.
  119. #:phases (alist-cons-before
  120. 'configure
  121. 'patch-loader-search-path
  122. (lambda* (#:key outputs #:allow-other-keys)
  123. ;; Add a call to `lt_dladdsearchdir' so that
  124. ;; `libguile-readline.so' & co. are in the
  125. ;; loader's search path.
  126. (substitute* "libguile/dynl.c"
  127. (("lt_dlinit.*$" match)
  128. (format #f
  129. " ~a~% lt_dladdsearchdir(\"~a/lib\");~%"
  130. match
  131. (assoc-ref outputs "out")))))
  132. %standard-phases)))
  133. (inputs `(("patch/snarf"
  134. ,(search-path %load-path "distro/guile-1.8-cpp-4.5.patch"))
  135. ("gawk" ,gawk)
  136. ("readline" ,(nixpkgs-derivation "readline"))))
  137. ;; Since `guile-1.8.pc' has "Libs: ... -lgmp -lltdl", these must be
  138. ;; propagated.
  139. (propagated-inputs `(("gmp" ,(nixpkgs-derivation "gmp"))
  140. ("libtool" ,(nixpkgs-derivation "libtool"))))
  141. ;; When cross-compiling, a native version of Guile itself is needed.
  142. (self-native-input? #t)
  143. (description "GNU Guile 1.8, an embeddable Scheme interpreter")
  144. (long-description
  145. "GNU Guile 1.8 is an interpreter for the Scheme programming language,
  146. packaged as a library that can be embedded into programs to make them
  147. extensible. It supports many SRFIs.")
  148. (home-page "http://www.gnu.org/software/guile/")
  149. (license "LGPLv2+")))
  150. (define-public guile-2.0
  151. (package
  152. (name "guile")
  153. (version "2.0.6")
  154. (source (origin
  155. (method http-fetch)
  156. (uri (string-append "http://ftp.gnu.org/gnu/guile/guile-" version
  157. ".tar.xz"))
  158. (sha256
  159. (base32
  160. "000ng5qsq3cl1k35jvzvhwxj92wx4q87745n2fppkd4irh58vv5l"))))
  161. (build-system gnu-build-system)
  162. (native-inputs `(("xz" ,(nixpkgs-derivation "xz"))
  163. ("pkgconfig" ,(nixpkgs-derivation "pkgconfig"))))
  164. (inputs `(("libffi" ,(nixpkgs-derivation "libffi"))
  165. ("readline" ,(nixpkgs-derivation "readline"))))
  166. (propagated-inputs
  167. `( ;; These ones aren't normally needed here, but since `libguile-2.0.la'
  168. ;; reads `-lltdl -lunistring', adding them here will add the needed
  169. ;; `-L' flags. As for why the `.la' file lacks the `-L' flags, see
  170. ;; <http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/18903>.
  171. ("libunistring" ,(nixpkgs-derivation "libunistring"))
  172. ("libtool" ,(nixpkgs-derivation "libtool"))
  173. ;; The headers and/or `guile-2.0.pc' refer to these packages, so they
  174. ;; must be propagated.
  175. ("bdw-gc" ,(nixpkgs-derivation "boehmgc"))
  176. ("gmp" ,(nixpkgs-derivation "gmp"))))
  177. (self-native-input? #t)
  178. (description "GNU Guile 2.0, an embeddable Scheme implementation")
  179. (long-description
  180. "GNU Guile is an implementation of the Scheme programming language, with
  181. support for many SRFIs, packaged for use in a wide variety of environments.
  182. In addition to implementing the R5RS Scheme standard and a large subset of
  183. R6RS, Guile includes a module system, full access to POSIX system calls,
  184. networking support, multiple threads, dynamic linking, a foreign function
  185. call interface, and powerful string processing.")
  186. (home-page "http://www.gnu.org/software/guile/")
  187. (license "LGPLv3+")))
  188. (define-public lout
  189. ;; This one is a bit tricky, because it doesn't follow the GNU Build System
  190. ;; rules. Instead, it has a makefile that has to be patched to set the
  191. ;; prefix, etc., and it has no makefile rules to build its doc.
  192. (let ((configure-phase
  193. '(lambda* (#:key outputs #:allow-other-keys)
  194. (let ((out (assoc-ref outputs "out"))
  195. (doc (assoc-ref outputs "doc")))
  196. (substitute* "makefile"
  197. (("^PREFIX[[:blank:]]*=.*$")
  198. (string-append "PREFIX = " out "\n"))
  199. (("^LOUTLIBDIR[[:blank:]]*=.*$")
  200. (string-append "LOUTLIBDIR = " out "/lib/lout\n"))
  201. (("^LOUTDOCDIR[[:blank:]]*=.*$")
  202. (string-append "LOUTDOCDIR = " doc "/doc/lout\n"))
  203. (("^MANDIR[[:blank:]]*=.*$")
  204. (string-append "MANDIR = " out "/man\n")))
  205. (mkdir out)
  206. (mkdir (string-append out "/bin")) ; TODO: use `mkdir-p'
  207. (mkdir (string-append out "/lib"))
  208. (mkdir (string-append out "/man"))
  209. (mkdir doc)
  210. (mkdir (string-append doc "/doc"))
  211. (mkdir (string-append doc "/doc/lout")))))
  212. (install-man-phase
  213. '(lambda* (#:key outputs #:allow-other-keys)
  214. (zero? (system* "make" "installman"))))
  215. (doc-phase
  216. '(lambda* (#:key outputs #:allow-other-keys)
  217. (define out
  218. (assoc-ref outputs "doc"))
  219. (setenv "PATH"
  220. (string-append (assoc-ref outputs "out")
  221. "/bin:" (getenv "PATH")))
  222. (chdir "doc")
  223. (every (lambda (doc)
  224. (format #t "doc: building `~a'...~%" doc)
  225. (with-directory-excursion doc
  226. (let ((file (string-append out "/doc/lout/"
  227. doc ".ps")))
  228. (and (or (file-exists? "outfile.ps")
  229. (zero? (system* "lout" "-r4" "-o"
  230. "outfile.ps" "all")))
  231. (begin
  232. (copy-file "outfile.ps" file)
  233. #t)
  234. (zero? (system* "ps2pdf"
  235. "-dPDFSETTINGS=/prepress"
  236. "-sPAPERSIZE=a4"
  237. file
  238. (string-append out "/doc/lout/"
  239. doc ".pdf")))))))
  240. '("design" "expert" "slides" "user")))))
  241. (package
  242. (name "lout")
  243. (version "3.39")
  244. (source (origin
  245. (method http-fetch)
  246. ;; FIXME: `http-get' doesn't follow redirects, hence the URL.
  247. (uri (string-append
  248. "http://download-mirror.savannah.gnu.org/releases/lout/lout-"
  249. version ".tar.gz"))
  250. (sha256
  251. (base32
  252. "12gkyqrn0kaa8xq7sc7v3wm407pz2fxg9ngc75aybhi5z825b9vq"))))
  253. (build-system gnu-build-system) ; actually, just a makefile
  254. (outputs '("out" "doc"))
  255. (inputs `(("ghostscript" ,(nixpkgs-derivation "ghostscript"))))
  256. (arguments `(#:modules ((guix build utils)
  257. (guix build gnu-build-system)
  258. (srfi srfi-1)) ; we need SRFI-1
  259. #:tests? #f ; no "check" target
  260. ;; Customize the build phases.
  261. #:phases (alist-replace
  262. 'configure ,configure-phase
  263. (alist-cons-after
  264. 'install 'install-man-pages
  265. ,install-man-phase
  266. (alist-cons-after
  267. 'install 'install-doc
  268. ,doc-phase
  269. %standard-phases)))))
  270. (description "Lout, a document layout system similar in style to LaTeX")
  271. (long-description
  272. "The Lout document formatting system is now reads a high-level description of
  273. a document similar in style to LaTeX and produces a PostScript or plain text
  274. output file.
  275. Lout offers an unprecedented range of advanced features, including optimal
  276. paragraph and page breaking, automatic hyphenation, PostScript EPS file
  277. inclusion and generation, equation formatting, tables, diagrams, rotation and
  278. scaling, sorted indexes, bibliographic databases, running headers and
  279. odd-even pages, automatic cross referencing, multilingual documents including
  280. hyphenation (most European languages are supported), formatting of computer
  281. programs, and much more, all ready to use. Furthermore, Lout is easily
  282. extended with definitions which are very much easier to write than troff of
  283. TeX macros because Lout is a high-level, purely functional language, the
  284. outcome of an eight-year research project that went back to the
  285. beginning.")
  286. (license "GPLv3+")
  287. (home-page "http://savannah.nongnu.org/projects/lout/"))))
  288. ;;; Local Variables:
  289. ;;; eval: (put 'lambda* 'scheme-indent-function 1)
  290. ;;; eval: (put 'substitute* 'scheme-indent-function 1)
  291. ;;; eval: (put 'with-directory-excursion 'scheme-indent-function 1)
  292. ;;; End: