smalltalk.scm 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2013 Nikita Karetnikov <nikita@karetnikov.org>
  3. ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
  4. ;;; Copyright © 2016 Nicolas Goaziou <mail@nicolasgoaziou.fr>
  5. ;;; Copyright © 2016 Ludovic Courtès <ludo@gnu.org>
  6. ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
  7. ;;; Copyright © 2021 Maxime Devos <maximedevos@telenet.be>
  8. ;;;
  9. ;;; This file is part of GNU Guix.
  10. ;;;
  11. ;;; GNU Guix is free software; you can redistribute it and/or modify it
  12. ;;; under the terms of the GNU General Public License as published by
  13. ;;; the Free Software Foundation; either version 3 of the License, or (at
  14. ;;; your option) any later version.
  15. ;;;
  16. ;;; GNU Guix is distributed in the hope that it will be useful, but
  17. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  18. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  19. ;;; GNU General Public License for more details.
  20. ;;;
  21. ;;; You should have received a copy of the GNU General Public License
  22. ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
  23. (define-module (gnu packages smalltalk)
  24. #:use-module ((guix licenses) #:prefix license:)
  25. #:use-module (guix packages)
  26. #:use-module (guix download)
  27. #:use-module (guix build-system cmake)
  28. #:use-module (guix build-system gnu)
  29. #:use-module (gnu packages)
  30. #:use-module (gnu packages assembly)
  31. #:use-module (gnu packages audio)
  32. #:use-module (gnu packages autotools)
  33. #:use-module (gnu packages base)
  34. #:use-module (gnu packages compression)
  35. #:use-module (gnu packages fontutils)
  36. #:use-module (gnu packages gl)
  37. #:use-module (gnu packages glib)
  38. #:use-module (gnu packages libffi)
  39. #:use-module (gnu packages libsigsegv)
  40. #:use-module (gnu packages linux)
  41. #:use-module (gnu packages multiprecision)
  42. #:use-module (gnu packages pkg-config)
  43. #:use-module (gnu packages pulseaudio)
  44. #:use-module (gnu packages xorg))
  45. (define-public smalltalk
  46. (package
  47. (name "smalltalk")
  48. (version "3.2.91")
  49. (source
  50. (origin
  51. (method url-fetch)
  52. ;; XXX: Revert to mirror://gnu with the next release of Smalltalk.
  53. (uri (string-append "https://alpha.gnu.org/gnu/smalltalk/smalltalk-"
  54. version ".tar.xz"))
  55. (sha256
  56. (base32
  57. "1zb2h5cbz1cwybqjl24lflw359lwj7sjvvhwb4x6miypzhwq4qh0"))
  58. ;; XXX: To be removed with the next release of Smalltalk.
  59. (patches (search-patches "smalltalk-multiplication-overflow.patch"))))
  60. (build-system gnu-build-system)
  61. (native-inputs
  62. `(("pkg-config" ,pkg-config)
  63. ;; XXX: To be removed with the next release of Smalltalk.
  64. ("autoconf" ,autoconf)
  65. ("automake" ,automake)
  66. ("libtool" ,libtool)
  67. ("zip" ,zip)))
  68. ;; TODO: These optional dependencies raise the closure size to ~1 GiB
  69. ;; from the current ~100 MiB, although some of them might be very
  70. ;; useful for end users:
  71. ;; - freeglut
  72. ;; - glib
  73. ;; - gobject-introspection
  74. ;; - gtk+-2
  75. ;; - tcl/tk
  76. ;; - SDL (sdl-union)
  77. ;; - sqlite
  78. ;; - zlib
  79. (inputs
  80. `(("gmp" ,gmp)
  81. ("libffi" ,libffi)
  82. ("libltdl" ,libltdl)
  83. ("libsigsegv" ,libsigsegv)
  84. ("lightning" ,lightning)))
  85. (arguments
  86. `(#:phases
  87. (modify-phases %standard-phases
  88. ;; XXX: To be removed with the next release of Smalltalk.
  89. ;; The overflow patch modifies configure.ac, therefore remove
  90. ;; old configure script and enforce an autoreconf.
  91. (add-before 'bootstrap 'remove-unpatched-configure
  92. (lambda _
  93. (delete-file "configure")
  94. #t))
  95. ;; XXX: To be removed with the next release of Smalltalk.
  96. ;; We don't want to regenerate the info files.
  97. (add-after 'build 'keep-generated-info-manual
  98. (lambda _
  99. (for-each (lambda (file)
  100. (invoke "touch" file))
  101. (find-files "doc" "\\.info"))
  102. #t))
  103. (add-before 'configure 'fix-libc
  104. (lambda* (#:key inputs #:allow-other-keys)
  105. (let ((libc (or (assoc-ref inputs "libc")
  106. ;; When cross-compiling, the input
  107. ;; is named "cross-libc" instead of
  108. ;; simply "libc".
  109. (assoc-ref inputs "cross-libc"))))
  110. (substitute* "libc.la.in"
  111. (("@LIBC_SO_NAME@") "libc.so")
  112. (("@LIBC_SO_DIR@") (string-append libc "/lib"))))
  113. #t)))))
  114. (home-page "http://smalltalk.gnu.org/")
  115. (synopsis "Smalltalk environment")
  116. (description
  117. "GNU Smalltalk is a free implementation of the Smalltalk language. It
  118. implements the ANSI standard for the language and also includes extra classes
  119. such as ones for networking and GUI programming.")
  120. (license license:gpl2+)))
  121. (define-public squeak-vm
  122. (package
  123. (name "squeak-vm")
  124. (version "4.10.2.2614")
  125. (source
  126. (origin
  127. (method url-fetch)
  128. (uri (string-append "http://squeakvm.org/unix/release/"
  129. "Squeak-" version "-src.tar.gz"))
  130. (sha256
  131. (base32 "0bpwbnpy2sb4gylchfx50sha70z36bwgdxraym4vrr93l8pd3dix"))
  132. (modules '((guix build utils)))
  133. (snippet
  134. ;; Make builds bit-reproducible.
  135. '(begin
  136. (substitute* "unix/cmake/verstamp"
  137. (("vm_date=.*")
  138. "vm_date = \"1970-01-01\";\n")
  139. (("ux_version=.*")
  140. "ux_version = \"GNU\";\n"))
  141. (substitute* "unix/vm/config.cmake"
  142. (("\\(VM_BUILD_STRING.*")
  143. "(VM_BUILD_STRING \\\"Built with GNU Guix\\\")"))
  144. #t))))
  145. (inputs
  146. `(("alsa-lib" ,alsa-lib)
  147. ("dbus" ,dbus)
  148. ("freetype" ,freetype)
  149. ("libffi" ,libffi)
  150. ("libxrender" ,libxrender)
  151. ("mesa" ,mesa)
  152. ("pulseaudio" ,pulseaudio)))
  153. (native-inputs
  154. `(("pkg-config" ,pkg-config)))
  155. (build-system cmake-build-system)
  156. (arguments
  157. `(#:tests? #f ;no check target
  158. #:phases
  159. (modify-phases %standard-phases
  160. (add-after 'unpack 'remove-hardcoded-PATH
  161. (lambda _
  162. ;; Remove hard-coded FHS PATH entries.
  163. (substitute* '("unix/cmake/squeak.in"
  164. "unix/cmake/squeak.sh.in")
  165. (("^PATH=.*") ""))
  166. #t))
  167. (add-before 'configure 'enter-build-directory
  168. (lambda _
  169. (mkdir "build")
  170. (chdir "build")
  171. #t))
  172. (replace 'configure
  173. (lambda* (#:key outputs #:allow-other-keys)
  174. (let ((out (assoc-ref outputs "out")))
  175. (invoke "../unix/cmake/configure"
  176. (string-append "--prefix=" out)
  177. "--without-quartz")
  178. #t))))))
  179. (synopsis "Smalltalk programming language and environment")
  180. (description "Squeak is a full-featured implementation of the Smalltalk
  181. programming language and environment based on (and largely compatible with)
  182. the original Smalltalk-80 system. Squeak has very powerful 2- and 3-D
  183. graphics, sound, video, MIDI, animation and other multimedia capabilities. It
  184. also includes a customisable framework for creating dynamic HTTP servers and
  185. interactively extensible Web sites.")
  186. (home-page "http://squeakvm.org/")
  187. (license license:x11)))