projects/guix·blob java-team · refs

320 lines · 13.2 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2016 Nikita <[email protected]>
3;;; Copyright © 2019-2020 Tobias Geerinckx-Rice <[email protected]>
4;;; Copyright © 2020 Hendursaga <[email protected]>
5;;; Copyright © 2020 Jesse Gibbons <[email protected]>
6;;; Copyright © 2020 Liliana Marie Prikler <[email protected]>
7;;; Copyright © 2022 jgart <[email protected]>
8;;; Copyright © 2023 Zheng Junjie <[email protected]>
9;;; Copyright © 2025 Nicolas Graves <[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 esolangs)
27 #:use-module (gnu packages)
28 #:use-module (gnu packages bash)
29 #:use-module (gnu packages bison)
30 #:use-module (gnu packages compiler-tools)
31 #:use-module (gnu packages gd)
32 #:use-module (gnu packages groff)
33 #:use-module (gnu packages image)
34 #:use-module (gnu packages ncurses)
35 #:use-module (gnu packages netpbm)
36 #:use-module (gnu packages perl)
37 #:use-module (gnu packages python)
38 #:use-module (gnu packages python-build)
39 #:use-module (gnu packages readline)
40 #:use-module (gnu packages tcl)
41 #:use-module (guix build-system cmake)
42 #:use-module (guix build-system copy)
43 #:use-module (guix build-system gnu)
44 #:use-module (guix build-system pyproject)
45 #:use-module (guix download)
46 #:use-module (guix gexp)
47 #:use-module (guix git-download)
48 #:use-module (guix packages)
49 #:use-module (guix git-download)
50 #:use-module ((guix licenses) #:prefix license:)
51 #:use-module (guix packages)
52 #:use-module (guix utils))
53
54(define-public cfunge
55 (package
56 (name "cfunge")
57 (version "0.9.0")
58 (source (origin
59 (method git-fetch)
60 (uri (git-reference
61 (url "https://github.com/VorpalBlade/cfunge")
62 (commit version)))
63 (file-name (git-file-name name version))
64 (sha256
65 (base32
66 "18ir0h10vxdb5jb57w5hjbgi8spjxg9x2148agadhhmbhsja02m7"))))
67 (build-system cmake-build-system)
68 (arguments
69 ;; The tests are not designed to be run and evaluated automatically.
70 '(#:tests? #f))
71 (inputs
72 (list ncurses))
73 (home-page "https://github.com/VorpalBlade/cfunge")
74 (synopsis "Fast conforming Befunge93/98/109 interpreter in C")
75 (description "@command{cfunge} is a fast conforming Befunge93/98/109 interpreter
76written in C. It supports several @dfn{fingerprints} (opt-in language extensions
77identified by unique ID codes).")
78 (license license:gpl3)))
79
80(define-public lolcode-lci
81 ;; Use the latest commit as the last release is from 2014 with Python 2.
82 (let ((commit "6762b724361a4fb471345961b4750657783aeb3b")
83 (revision "0"))
84 (package
85 (name "lolcode-lci")
86 (version (git-version "0.11.2" revision commit))
87 (source
88 (origin
89 (method git-fetch)
90 (uri (git-reference
91 (url "https://github.com/justinmeza/lci")
92 (commit commit)))
93 (file-name (git-file-name name version))
94 (sha256
95 (base32 "0phqnqp7qvkn0kxkk5qsc76b9gxs932w4dy3jm96pmknh1q7h6kk"))))
96 (build-system cmake-build-system)
97 ;; The test suite is currently failing with Python 3 (see:
98 ;; https://github.com/justinmeza/lci/issues/75).
99 (arguments (list #:tests? #f))
100 (inputs
101 (list readline))
102 (native-inputs
103 (list python-wrapper)) ; for the tests
104 (synopsis "LOLCODE interpreter written in C")
105 (description
106 "@code{lci} is a LOLCODE interpreter written in C and is designed to be
107correct, portable, fast, and precisely documented.
108@enumerate
109@item correct: Every effort has been made to test lci's conformance to the
110LOLCODE language specification. Unit tests come packaged with the lci source code.
111@item portable: lci follows the widely ported ANSI C specification allowing it
112to compile on a broad range of systems.
113@item fast: Much effort has gone into producing simple and efficient code
114whenever possible to the extent that the above points are not compromised.
115@end enumerate")
116 (home-page "http://lolcode.org/")
117 (license license:gpl3+))))
118
119(define-public folders
120 (package
121 (name "folders")
122 (version "0.0.8")
123 (source
124 (origin
125 (method git-fetch)
126 (uri (git-reference
127 (url "https://github.com/SinaKhalili/Folders.py")
128 (commit (string-append "v" version))))
129 (file-name (git-file-name name version))
130 (sha256
131 (base32 "14fs8c7ilvsw6xbskr688s1dp3nd8vnwv7bg23ab1l6vj6fpzwmw"))))
132 (build-system pyproject-build-system)
133 (arguments
134 (list
135 #:phases
136 #~(modify-phases %standard-phases
137 (replace 'check
138 (lambda* (#:key tests? #:allow-other-keys)
139 (if tests?
140 (invoke "Folders" "sample_programs/HelloWorld")
141 (format #t "test suite not run~%")))))))
142 (native-inputs (list python-setuptools))
143 (home-page "https://github.com/SinaKhalili/Folders.py")
144 (synopsis "Structural programming language")
145 (description
146 "Folders is a programming language, in which programs are encoded as
147(nested) directories. Note that the switches you pass to @command{du} may
148affect your score when code golfing.")
149 (properties `((lint-hidden-cpe-vendors "premio" "jenkins")))
150 (license license:expat)))
151
152(define-public npiet
153 (package
154 (name "npiet")
155 (version "1.3f")
156 (source (origin
157 (method url-fetch)
158 (uri (string-append "https://www.bertnase.de/npiet/npiet-"
159 version ".tar.gz"))
160 (sha256
161 (base32
162 "0nl59fhdqqr7nslxdirdn8nvlq5wws67c7jyx2ckbmxbc9h8bv9d"))))
163 (build-system gnu-build-system)
164 (arguments
165 (list #:phases
166 #~(modify-phases %standard-phases
167 (add-after 'install 'wrap-binaries
168 (lambda* (#:key inputs outputs #:allow-other-keys)
169 (let ((out (assoc-ref outputs "out")))
170 (wrap-program (string-append out
171 "/bin/npietedit")
172 `("PATH" ":" prefix
173 (,(dirname
174 (search-input-file
175 inputs "bin/wish")))))))))))
176 (inputs (list bash-minimal gd giflib libpng tk))
177 (native-inputs (list groff))
178 (synopsis "Piet interpreter")
179 (description
180 "Npiet is an interpreter for the Piet programming language. Instead of
181text, Piet programs are pictures. Commands are determined based on changes in
182color.
183
184This package includes:
185@enumerate
186@item @command{npiet}, a Piet interpreter with debugging capabilities
187@item @command{npiet-foogol}, a program that builds a Piet program from Foogol,
188an Algol-like language
189@item @command{npietedit}, an editor for Piet programs.
190@end enumerate\n")
191 (home-page "https://www.bertnase.de/npiet/")
192 (license license:gpl2+)))
193
194(define-public piet-toolchain
195 (let ((commit "f002ff6a924a6bbace5eef94f3be06f425e7f590")
196 (revision "0"))
197 (package
198 (name "piet-toolchain")
199 (version (git-version "0.0.0" revision commit))
200 (source
201 (origin
202 (method git-fetch)
203 (uri (git-reference
204 (url "https://github.com/sl236/Piet")
205 (commit commit)))
206 (file-name (git-file-name name version))
207 (sha256
208 (base32 "0xwbhwizfbn080fmrgavaz3b939brycmlar3m5px9avl2b68c816"))
209 (modules '((guix build utils)))
210 (snippet
211 '(begin
212 ;; Remove a bundled fork of Marc Majcher's Piet interpreter.
213 (delete-file-recursively "interpreter")))))
214 (build-system gnu-build-system)
215 (arguments
216 `(#:modules ((guix build gnu-build-system)
217 (guix build utils)
218 (srfi srfi-26))
219 #:phases
220 (modify-phases %standard-phases
221 (delete 'configure) ; no configure script
222 (delete 'build) ; nothing to build
223 (delete 'check) ; run our own tests below
224 (replace 'install
225 (lambda* (#:key outputs #:allow-other-keys)
226 (let* ((out (assoc-ref outputs "out"))
227 (bin (string-append out "/bin"))
228 (doc (string-append out "/share/doc/"
229 ,name "-" ,version)))
230 (for-each (lambda (script)
231 (install-file script bin)
232 (wrap-program (string-append bin "/" script)
233 `("PERL5LIB" ":" = (,(getenv "PERL5LIB")))))
234 (list "piet-assembler"
235 "piet-compiler"))
236
237 ;; Fix an odd mode.
238 (chmod "compiler-samples/test-binary-ops.script" #o644)
239 (for-each (lambda (file) ; INSTALL-FILE is not recursive
240 (copy-recursively file
241 (string-append doc "/" file)))
242 (list "assembler-samples"
243 "compiler-samples"
244 "README.md"))))) ;includes the licence grant
245 (add-after 'install 'check
246 (lambda* (#:key outputs tests? #:allow-other-keys)
247 (let* ((out (assoc-ref outputs "out"))
248 (bin (string-append out "/bin")))
249 (when tests?
250 (unsetenv "PERL5LIB") ; test the wrapping
251 ;; Compile all scripts assemble all Piets.
252 (for-each (lambda (file)
253 (system (string-append bin "/piet-compiler "
254 file ">"
255 file ".piet")))
256 (find-files "." "\\.script$"))
257 (for-each (lambda (file)
258 (system (string-append bin "/piet-assembler "
259 file "|pnmtopng>"
260 file ".png")))
261 (find-files "." "\\.piet$"))
262
263 ;; Don't run the interactive one.
264 (delete-file "assembler-samples/quest.piet.png")
265 (for-each (cut invoke "npiet" <>)
266 (find-files "." "\\.png$")))))))))
267 (native-inputs (list netpbm npiet)) ;for tests
268 (inputs (list bash-minimal perl perl-parse-recdescent))
269 (home-page "https://www.toothycat.net/wiki/wiki.pl?MoonShadow/Piet")
270 (synopsis "Piet compiler and assembler")
271 (description
272 "This package provides a compiler and assembler that target the Piet
273graphical programming language.
274
275@command{piet-assembler} converts Piet assembler instructions (e.g.,
276@code{push}, @code{add}, @code{switch}, @code{outn}) and directives into an
277executable @code{netpbm} image of the corresponding Piet program.
278
279@command{piet-compiler} compiles a C-like high-level language into assembly
280source understood by @command{piet-assembler}. It supports common arithmetic
281and boolean logic operators (though not bitwise manipulation), flow control
282(@code{if}, @code{for}, @code{while}), recursive functions, in-line assembler,
283and input/output intrinsics. The only supported data type is the integer.
284
285The language is documented only by the compiler's Perl source code and the
286included samples.")
287 (license license:cc-by-sa4.0))))
288
289(define-public unlambda
290 (package
291 (name "unlambda")
292 (version "2.0.0")
293 (source
294 (origin
295 (method url-fetch)
296 (uri (string-append "http://www.eleves.ens.fr:8080/home/madore/unlambda-"
297 version ".tar.gz"))
298 (sha256
299 (base32 "1a8h1i2a3pk66nfsg5jc9r4ylg1q9r81x9zmvj6272wjkaiy1nx9"))))
300 (build-system copy-build-system)
301 (arguments
302 (list
303 #:install-plan
304 #~'(("unlambda" "bin/")
305 ("doc/" "share/doc/unlambda/html/")
306 ("README" "share/doc/unlambda/"))
307 #:phases
308 #~(modify-phases %standard-phases
309 (add-before 'install 'build
310 (lambda _
311 (invoke #$(cc-for-target)
312 "-g" "-O2"
313 "-o" "unlambda" "c-refcnt/unlambda.c"))))))
314 (home-page "http://www.madore.org/~david/programs/unlambda/")
315 (synopsis "Interpreter for an obfuscated functional programming language")
316 (description "Unlambda is an obfuscated programming language in which the
317only form of objects manipulated by it are functions.")
318 (license license:gpl2)))
319
320;;; esolangs.scm ends here