projects/guix·blob java-team · refs

345 lines · 13.6 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2013 Nikita Karetnikov <[email protected]>
3;;; Copyright © 2013 Mark H Weaver <[email protected]>
4;;; Copyright © 2020 Brett Gilio <[email protected]>
5;;; Copyright © 2021, 2024 Efraim Flashner <[email protected]>
6;;; Copyright © 2021 Maxime Devos <[email protected]>
7;;; Copyright © 2024-2026 jgart <[email protected]>
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
24(define-module (gnu packages prolog)
25 #:use-module (guix download)
26 #:use-module (guix gexp)
27 #:use-module (guix git-download)
28 #:use-module ((guix licenses) #:prefix license:)
29 #:use-module (guix packages)
30 #:use-module (guix build-system cargo)
31 #:use-module (guix build-system cmake)
32 #:use-module (guix build-system gnu)
33 #:use-module (guix utils)
34 #:use-module (gnu packages backup)
35 #:use-module (gnu packages bash)
36 #:use-module (gnu packages compression)
37 #:use-module (gnu packages crypto)
38 #:use-module (gnu packages curl)
39 #:use-module (gnu packages fontutils)
40 #:use-module (gnu packages game-development)
41 #:use-module (gnu packages image)
42 #:use-module (gnu packages libedit)
43 #:use-module (gnu packages libffi)
44 #:use-module (gnu packages libunwind)
45 #:use-module (gnu packages maths)
46 #:use-module (gnu packages multiprecision)
47 #:use-module (gnu packages perl)
48 #:use-module (gnu packages pkg-config)
49 #:use-module (gnu packages readline)
50 #:use-module (gnu packages sqlite)
51 #:use-module (gnu packages texinfo)
52 #:use-module (gnu packages tls)
53 #:use-module (gnu packages valgrind)
54 #:use-module (gnu packages version-control)
55 #:use-module (gnu packages vim)
56 #:use-module (gnu packages xorg)
57 #:use-module (srfi srfi-1))
58
59(define-public gprolog
60 (package
61 (name "gprolog")
62 (version "1.5.0")
63 (source
64 (origin
65 (method url-fetch)
66 ;; Recent versions are not hosted on the GNU mirrors.
67 (uri (list (string-append "http://gprolog.org/gprolog-" version
68 ".tar.gz")
69 (string-append "mirror://gnu/gprolog/gprolog-" version
70 ".tar.gz")))
71 (sha256
72 (base32
73 "009ca4wn2q6xdmb0js0vz647cw5ygsqyyqc9svmjgahg7js441k7"))))
74 (build-system gnu-build-system)
75 (arguments
76 `(#:configure-flags
77 (list (string-append
78 "--with-install-dir=" %output "/share/gprolog"))
79 #:phases
80 (modify-phases %standard-phases
81 (add-before 'configure 'change-dir
82 (lambda _
83 (chdir "src"))))))
84 (home-page "https://www.gnu.org/software/gprolog/")
85 (synopsis "Prolog compiler")
86 (description
87 "GNU Prolog is a standards-compliant Prolog compiler with constraint
88solving over finite domains. It accepts Prolog+ constraint programs and
89produces a compiled, native binary which can function in a stand-alone
90manner. It also features an interactive interpreter.")
91 (license (list license:gpl2+
92 license:lgpl3+))
93
94 ;; See 'configure' for the list of supported architectures.
95 (supported-systems (fold delete
96 %supported-systems
97 '("armhf-linux" "mips64el-linux")))))
98
99(define-public scryer-prolog
100 (package
101 (name "scryer-prolog")
102 (version "0.10.0")
103 (source
104 (origin
105 (method url-fetch)
106 (uri (crate-uri "scryer-prolog" version))
107 (file-name (string-append name "-" version ".tar.gz"))
108 (sha256
109 (base32 "08sn216bcwjx8y62pl3idfjpc1kxw0p0kq5zj3ydpjnnm0gmn03i"))))
110 (build-system cargo-build-system)
111 (arguments
112 (list #:install-source? #f
113 #:cargo-build-flags ''("--no-default-features")
114 #:cargo-test-flags
115 ''("--"
116 "--skip=issues::issue_delete_directory"
117 "--skip=issues::issue_delete_file"
118 "--skip=issues::issue_directory_files"
119 "--skip=issues::issue_file_copy"
120 "--skip=issues::issue_file_exists"
121 "--skip=issues::issue_file_size"
122 "--skip=issues::issue_file_time"
123 "--skip=issues::issue_make_directory"
124 "--skip=issues::issue_make_directory_path"
125 "--skip=issues::issue_path_canonical"
126 "--skip=issues::issue_rename_file")))
127 (inputs
128 (cons* libffi
129 openssl
130 (cargo-inputs 'scryer-prolog)))
131 (native-inputs
132 (cons* pkg-config
133 (if (%current-target-system)
134 (list this-package)
135 '())))
136 (home-page "https://github.com/mthom/scryer-prolog")
137 (synopsis "Modern Prolog implementation written mostly in Rust")
138 (description
139 "Scryer Prolog aims to provide an open source industrial strength
140production environment that is also a testbed for bleeding edge research in
141logic and constraint programming, which is itself written in a high-level
142language.")
143 (license license:bsd-3)))
144
145(define-public swi-prolog
146 (package
147 (name "swi-prolog")
148 (version "9.3.8")
149 (source (origin
150 (method git-fetch)
151 (uri (git-reference
152 (url "https://github.com/SWI-Prolog/swipl-devel")
153 (recursive? #t) ; TODO: Determine if this can be split out.
154 (commit (string-append "V" version))))
155 (file-name (git-file-name name version))
156 (sha256
157 (base32
158 "1q2dg7n3vf0qc9nxppbcqgbzj4rcjw8sv2vbg9s6i4ixxlsxr5y3"))))
159 (build-system cmake-build-system)
160 (arguments
161 `(#:parallel-build? #t
162 #:configure-flags
163 ,#~(list
164 #$@(if (%current-target-system)
165 ;; Set this manually, otherwise CMake would need to
166 ;; run a cross-compiled binary, which it can't do.
167 ;; These values were found on a Linux system.
168 #~("-DBSD_SIGNALS=1" "-DQSORT_R_GNU=1"
169 ;; If absent, the non-existent 'cc' is used.
170 "-DCMAKE_HOST_CC=gcc"
171 ;; swi-prolog needs a native copy of itself for
172 ;; cross-compilation.
173 "-DSWIPL_NATIVE_FRIEND=/nowhere"
174 (string-append "-DPROG_SWIPL="
175 #+(this-package-native-input "swi-prolog")
176 "/bin/swipl"))
177 #~())
178 (string-append "-DPOSIX_SHELL="
179 #$(this-package-input "bash-minimal")
180 "/bin/sh")
181 "-DINSTALL_DOCUMENTATION=ON"
182 "-DSWIPL_INSTALL_IN_LIB=OFF") ; FIXME: Breaks RUNPATH validation.
183 #:phases
184 ,#~(modify-phases %standard-phases
185 ;; XXX: Delete the test phase that attempts to write to the
186 ;; immutable store.
187 (add-after 'unpack 'delete-failing-tests
188 (lambda _
189 (substitute* "src/CMakeLists.txt"
190 ((" save") ""))
191 (substitute* "src/test.pl"
192 (("testdir\\('Tests/save'\\).") ""))
193 (delete-file-recursively "src/Tests/save")))
194 #$@(if (%current-target-system)
195 ;; Prevent man_server.pl and swipl-lfr.pl from keeping a
196 ;; reference to the native swi-prolog.
197 ;; FIXME: libswipl.so and swipl-ld keep a reference to the
198 ;; cross-compiler.
199 #~((add-after 'install 'fix-cross-references
200 (lambda _
201 (define bin `(,(string-append #$output "/bin")))
202 (for-each (lambda (file) (patch-shebang file bin))
203 (find-files #$output ".pl$")))))
204 #~()))))
205 (native-inputs
206 `(,@(if (%current-target-system)
207 (begin
208 (unless (equal? (target-64bit?)
209 (target-64bit? (%current-system)))
210 (error "swi-prolog requires --system and --target to have \
211the same word size"))
212 `(("swi-prolog" ,this-package)))
213 '())
214 ("texinfo" ,texinfo)
215 ("perl" ,perl)
216 ("pkg-config" ,pkg-config)))
217 (inputs
218 `(("bash-minimal" ,bash-minimal) ;for some scripts in 'lib'
219 ("zlib" ,zlib)
220 ("gmp" ,gmp)
221 ("readline" ,readline)
222 ("libarchive" ,libarchive)
223 ("libunwind" ,libunwind)
224 ("libjpeg" ,libjpeg-turbo)
225 ("libxcrypt" ,libxcrypt)
226 ("libxft" ,libxft)
227 ("fontconfig" ,fontconfig)
228 ("openssl" ,openssl)))
229 (home-page "https://www.swi-prolog.org/")
230 (synopsis "ISO/Edinburgh-style Prolog interpreter")
231 (description "SWI-Prolog is a fast and powerful ISO/Edinburgh-style Prolog
232compiler with a rich set of built-in predicates. It offers a fast, robust and
233small environment which enables substantial applications to be developed with
234it.")
235 (license license:bsd-2)))
236
237(define-public trealla
238 (package
239 (name "trealla")
240 (version "3.12.6")
241 (source
242 (origin
243 (method git-fetch)
244 (uri
245 (git-reference
246 (url "https://github.com/trealla-prolog/trealla")
247 (commit (string-append "v" version))))
248 (sha256
249 (base32 "1d7jam1hxzwjy3ya7scjl9f050w2z0lrim9fvrydigcrh9fwmpyx"))
250 (file-name (git-file-name name version))))
251 (build-system gnu-build-system)
252 (inputs
253 (list curl
254 gsl
255 libedit
256 libffi
257 openssl
258 raylib
259 readline
260 sqlite))
261 (arguments
262 (list
263 #:make-flags
264 #~(list (string-append "PREFIX=" #$output)
265 (string-append "CC=" #$(cc-for-target))
266 (string-append "HOST_CC=" #$(cc-for-target)))
267 #:test-target "test"
268 #:phases
269 #~(modify-phases %standard-phases
270 ;; Upstream does not use a configure script.
271 (delete 'configure)
272 (add-before 'build 'patch-package-version
273 (lambda _
274 (substitute* "GNUmakefile"
275 (("\\$\\(shell git describe --abbrev=4 --dirty --always --tags\\)")
276 (string-append "v" #$version)))))
277 (add-after 'unpack 'fix-paths
278 (lambda* (#:key inputs #:allow-other-keys)
279 (substitute* "library/curl.pl"
280 (("libcurl\\.so")
281 (search-input-file inputs "lib/libcurl.so")))
282 (substitute* "library/gsl.pl"
283 (("libgsl\\.so")
284 (search-input-file inputs "lib/libgsl.so"))
285 (("libgslcblas\\.so")
286 (search-input-file inputs "lib/libgslcblas.so")))
287 (substitute* "library/raylib.pl"
288 (("libraylib\\.so")
289 (search-input-file inputs "lib/libraylib.so")))
290 (substitute* "library/sqlite3.pl"
291 (("libsqlite3\\.so")
292 (search-input-file inputs "lib/libsqlite3.so"))))))))
293 (home-page "https://trealla-prolog.org/")
294 (synopsis "Compact and efficient Prolog interpreter")
295 (description "This package provides a compact and efficient Prolog
296interpreter with ISO Prolog aspirations.")
297 (license
298 (list license:expat
299 ;; The tiny-regex-c library uses the Unlicense license.
300 license:unlicense))))
301
302(define-public logtalk
303 (package
304 (name "logtalk")
305 (version "3.99.0")
306 (source
307 (origin
308 (method url-fetch)
309 (uri (string-append "https://logtalk.org/files/logtalk-"
310 version ".tar.bz2"))
311 (sha256 (base32 "04namz3lj2j1j741bb41qy5c172b9zawp1li148i7pd2s0jiwjjr"))))
312 (build-system gnu-build-system)
313 (arguments
314 (list #:tests? #f ;no tests
315 #:phases
316 #~(modify-phases %standard-phases
317 (delete 'configure) ;no configure script and Makefile
318 (delete 'build)
319 (replace 'install
320 (lambda* (#:key outputs #:allow-other-keys)
321 (mkdir #$output)
322 (invoke "./scripts/install.sh" "-p" #$output))))))
323 (native-search-paths
324 (list (search-path-specification
325 (variable "LOGTALKHOME")
326 (separator #f) ;single valued
327 (files '("share/logtalk")))))
328 (home-page "https://logtalk.org/")
329 (synopsis "Object-oriented logic programming language")
330 (description "Logtalk is a declarative object-oriented logic programming language
331that extends and leverages the Prolog language with a feature set suitable for
332programming in the large. As a multi-paradigm language, Logtalk includes support for
333both prototypes and classes, protocols (interfaces), categories (components and
334hot-patching), event-driven programming, coinduction, lambda expressions, and
335high-level multi-threading programming.")
336 ;; Most are under Apache License 2.0, some contributed libraries and ports are
337 ;; under other licenses.
338 (license (list license:asl2.0
339 license:artistic2.0
340 license:bsd-2
341 license:bsd-3
342 license:cc0
343 license:expat
344 license:gpl2+
345 license:osl2.1))))