projects/guix·blob java-team · refs

285 lines · 11.7 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2013 Nikita Karetnikov <[email protected]>
3;;; Copyright © 2016 Efraim Flashner <[email protected]>
4;;; Copyright © 2016 Nicolas Goaziou <[email protected]>
5;;; Copyright © 2016 Ludovic Courtès <[email protected]>
6;;; Copyright © 2018 Tobias Geerinckx-Rice <[email protected]>
7;;; Copyright © 2021 Maxime Devos <[email protected]>
8;;; Copyright © 2024 Jorge Acereda <[email protected]>
9;;; Copyright © 2025 Maxim Cournoyer <[email protected]>
10;;;
11;;; This file is part of GNU Guix.
12;;;
13;;; GNU Guix is free software; you can redistribute it and/or modify it
14;;; under the terms of the GNU General Public License as published by
15;;; the Free Software Foundation; either version 3 of the License, or (at
16;;; your option) any later version.
17;;;
18;;; GNU Guix is distributed in the hope that it will be useful, but
19;;; WITHOUT ANY WARRANTY; without even the implied warranty of
20;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21;;; GNU General Public License for more details.
22;;;
23;;; You should have received a copy of the GNU General Public License
24;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
25
26(define-module (gnu packages smalltalk)
27 #:use-module ((guix licenses) #:prefix license:)
28 #:use-module (guix packages)
29 #:use-module (guix download)
30 #:use-module (guix utils)
31 #:use-module (guix build-system cmake)
32 #:use-module (guix build-system gnu)
33 #:use-module (guix gexp)
34 #:use-module (gnu packages)
35 #:use-module (gnu packages assembly)
36 #:use-module (gnu packages audio)
37 #:use-module (gnu packages autotools)
38 #:use-module (gnu packages base)
39 #:use-module (gnu packages bash)
40 #:use-module (gnu packages compression)
41 #:use-module (gnu packages fontutils)
42 #:use-module (gnu packages gl)
43 #:use-module (gnu packages glib)
44 #:use-module (gnu packages gtk)
45 #:use-module (gnu packages image)
46 #:use-module (gnu packages libffi)
47 #:use-module (gnu packages libsigsegv)
48 #:use-module (gnu packages linux)
49 #:use-module (gnu packages multiprecision)
50 #:use-module (gnu packages pkg-config)
51 #:use-module (gnu packages pulseaudio)
52 #:use-module (gnu packages sdl)
53 #:use-module (gnu packages tls)
54 #:use-module (gnu packages version-control)
55 #:use-module (gnu packages xdisorg)
56 #:use-module (gnu packages xorg))
57
58(define-public pharo-vm
59 (package
60 (name "pharo-vm")
61 ;; Use the latest release made available from
62 ;; <https://files.pharo.org/vm/pharo-spur64-headless/Linux-x86_64/source/>.
63 (version "10.3.7+3.af67084")
64 (source
65 (origin
66 (method url-fetch)
67 ;; These source distributions of Pharo VM include the pre-generated C
68 ;; source files that are used to bootstrap Pharo.
69 (uri (string-append "https://files.pharo.org/vm/pharo-spur64-headless/"
70 "Linux-x86_64/source/PharoVM-v" version
71 "-Linux-x86_64-c-src.tar.gz"))
72 (sha256
73 (base32 "0h4qqrxgw7kv4al8k6dr6xai6gwrc25vgsamj6czqrvnskfln8fh"))
74 (patches (search-patches "pharo-vm-cmake.patch"))))
75 (build-system cmake-build-system)
76 (arguments
77 (list
78 ;; The test suite requires a pre-built binary image (that it fetches
79 ;; from the network), along a VM archive that is also requires
80 ;; downloading online resources to be produced.
81 #:tests? #f
82 #:configure-flags
83 #~(list "-DBUILD_BUNDLE=OFF"
84 ;; Relax a warning turned error with GCC 14.
85 "-DCMAKE_C_FLAGS=-Wno-error=incompatible-pointer-types"
86 ;; The 'GENEERATE_SOURCES=OFF' is to tell the build system to
87 ;; use the pre-generated C source files, avoiding the need for a
88 ;; pharo bootstrap binary.
89 "-DGENERATE_SOURCES=OFF"
90 "-DGENERATED_SOURCE_DIR=."
91 ;; This ensures the plugins can be found in RUNPATH.
92 (string-append "-DPHARO_LIBRARY_PATH=" #$output "/lib")
93 "-DVERBOSE_BUILD=ON"
94 "-DVERSION_UPDATE_FROM_GIT=OFF")
95 #:phases
96 #~(modify-phases %standard-phases
97 (add-after 'unpack 'make-reproducible
98 (lambda _
99 (substitute* "include/pharovm/config.h.in"
100 ;; Per (info "(cmake) CMAKE_SYSTEM"), CMAKE_SYSTEM includes
101 ;; CMAKE_SYSTEM_VERSION, which is the version of the kernel.
102 ;; Do not capture that, as it introduces non-reproducibilities.
103 (("\\$\\{CMAKE_SYSTEM}")
104 "${CMAKE_SYSTEM_NAME}"))))
105 (add-after 'install 'wrap-ld-library-path
106 ;; The following libraries are dlopen'd.
107 (lambda* (#:key inputs #:allow-other-keys)
108 (wrap-program (string-append #$output "/bin/pharo")
109 `("LD_LIBRARY_PATH" ":" prefix
110
111 ,(map (lambda (name)
112 (string-append (assoc-ref inputs name)
113 "/lib"))
114 '("cairo" "freetype" "libgit2" "pixman" "sdl2"
115 "util-linux"))))))
116 (add-after 'wrap-ld-library-path 'workaround-#1674
117 ;; pharo crashes when argv[0] is not an absolute file name. This
118 ;; can be removed after
119 ;; <https://codeberg.org/guix/guix/issues/1674> is resolved.
120 (lambda _
121 (substitute* (string-append #$output "/bin/pharo")
122 (("\\$\\{0##\\*/}") "$0")))))))
123 (inputs
124 (list bash-minimal
125 cairo
126 freetype
127 libffi
128 libgit2
129 libpng
130 openssl
131 pixman
132 sdl2
133 `(,util-linux "lib"))) ;for libuuid
134 (synopsis "Clean and innovative Smalltalk-inspired environment")
135 (home-page "https://github.com/pharo-project/pharo-vm")
136 (description
137 "Pharo aims to provide a clean and innovative Smalltalk-inspired
138environment. With a stable and small core system, advanced development tools,
139and maintained releases, the Pharo platform can be used to build and deploy
140mission critical applications.")
141 ;; The "spur64" C source bootstrap is only for 64 bit platforms. The
142 ;; "spur32" variant is no longer maintained.
143 (supported-systems %64bit-supported-systems)
144 (license license:expat)))
145
146(define-public smalltalk
147 (package
148 (name "smalltalk")
149 (version "3.2.91")
150 (source
151 (origin
152 (method url-fetch)
153 ;; XXX: Revert to mirror://gnu with the next release of Smalltalk.
154 (uri (string-append "https://alpha.gnu.org/gnu/smalltalk/smalltalk-"
155 version ".tar.xz"))
156 (sha256
157 (base32
158 "1zb2h5cbz1cwybqjl24lflw359lwj7sjvvhwb4x6miypzhwq4qh0"))
159 ;; XXX: To be removed with the next release of Smalltalk.
160 (patches (search-patches "smalltalk-multiplication-overflow.patch"))))
161 (build-system gnu-build-system)
162 (native-inputs
163 (list pkg-config
164 (libc-utf8-locales-for-target)
165 ;; XXX: To be removed with the next release of Smalltalk.
166 autoconf
167 automake
168 libtool
169 zip))
170 ;; TODO: These optional dependencies raise the closure size to ~1 GiB
171 ;; from the current ~100 MiB, although some of them might be very
172 ;; useful for end users:
173 ;; - freeglut
174 ;; - glib
175 ;; - gobject-introspection
176 ;; - gtk+-2
177 ;; - tcl/tk
178 ;; - SDL (sdl-union)
179 ;; - sqlite
180 ;; - zlib
181 (inputs
182 (list gmp libffi libltdl libsigsegv lightning))
183 (arguments
184 `(#:make-flags '("CFLAGS=-Wno-incompatible-pointer-types")
185 ;; FIXME: Tests fail on x86-64 in the build container, but they pass
186 ;; in a regular shell.
187 #:tests? ,(not (target-x86-64?))
188 #:phases
189 (modify-phases %standard-phases
190 ;; XXX: To be removed with the next release of Smalltalk.
191 ;; The overflow patch modifies configure.ac, therefore remove
192 ;; old configure script and enforce an autoreconf.
193 (add-before 'bootstrap 'remove-unpatched-configure
194 (lambda _
195 (delete-file "configure")
196 #t))
197 ;; XXX: To be removed with the next release of Smalltalk.
198 ;; We don't want to regenerate the info files.
199 (add-after 'build 'keep-generated-info-manual
200 (lambda _
201 (for-each (lambda (file)
202 (invoke "touch" file))
203 (find-files "doc" "\\.info"))
204 #t))
205 (add-before 'configure 'fix-libc
206 (lambda* (#:key inputs #:allow-other-keys)
207 (let ((libc (or (assoc-ref inputs "libc")
208 ;; When cross-compiling, the input
209 ;; is named "cross-libc" instead of
210 ;; simply "libc".
211 (assoc-ref inputs "cross-libc"))))
212 (substitute* "libc.la.in"
213 (("@LIBC_SO_NAME@") "libc.so")
214 (("@LIBC_SO_DIR@") (string-append libc "/lib"))))
215 #t)))))
216 (home-page "https://smalltalk.gnu.org/")
217 (synopsis "Programming language environment")
218 (description
219 "GNU Smalltalk is a free implementation of the Smalltalk language. It
220implements the ANSI standard for the language and also includes extra classes
221such as ones for networking and GUI programming.")
222 (license license:gpl2+)))
223
224(define-public squeak-vm
225 (package
226 (name "squeak-vm")
227 (version "4.10.2.2614")
228 (source
229 (origin
230 (method url-fetch)
231 (uri (string-append "http://squeakvm.org/unix/release/"
232 "Squeak-" version "-src-no-mp3.tar.gz"))
233 (sha256
234 (base32 "01miyjpka9x24xsp4j54mm9zjiaci670sss50qvd94y5q2iq9cx7"))
235 (modules '((guix build utils)))
236 (snippet
237 ;; Make builds bit-reproducible.
238 '(begin
239 (substitute* "unix/cmake/verstamp"
240 (("vm_date=.*")
241 "vm_date = \"1970-01-01\";\n")
242 (("ux_version=.*")
243 "ux_version = \"GNU\";\n"))
244 (substitute* "unix/vm/config.cmake"
245 (("\\(VM_BUILD_STRING.*")
246 "(VM_BUILD_STRING \\\"Built with GNU Guix\\\")"))))
247 (patches (search-patches "squeak-vm-gcc-14-fix.patch"))))
248 (build-system cmake-build-system)
249 (arguments
250 (list #:tests? #f ;no check target
251 #:configure-flags
252 #~(list (string-append "-DVM_HOST=" #$(nix-system->gnu-triplet
253 (or (%current-target-system)
254 (%current-system))))
255 (string-append "-DVM_VERSION=" #$version)
256 "-DCMAKE_VERBOSE_MAKEFILE=ON")
257 #:phases
258 #~(modify-phases %standard-phases
259 (add-after 'unpack 'chdir
260 (lambda _
261 (chdir "unix")))
262 (add-after 'chdir 'remove-hardcoded-PATH
263 (lambda _
264 ;; Remove hard-coded FHS PATH entries.
265 (substitute* '("cmake/squeak.in"
266 "cmake/squeak.sh.in")
267 (("^PATH=.*") "")))))))
268 (native-inputs (list pkg-config))
269 (inputs
270 (list alsa-lib
271 dbus
272 freetype
273 libffi
274 libxrender
275 mesa
276 pulseaudio))
277 (synopsis "Smalltalk programming language and environment")
278 (description "Squeak is a full-featured implementation of the Smalltalk
279programming language and environment based on (and largely compatible with)
280the original Smalltalk-80 system. Squeak has very powerful 2- and 3-D
281graphics, sound, video, MIDI, animation and other multimedia capabilities. It
282also includes a customisable framework for creating dynamic HTTP servers and
283interactively extensible Web sites.")
284 (home-page "http://squeakvm.org/")
285 (license license:x11)))