gnu: Add perl6-license-spdx.
[jackhill/guix/guix.git] / gnu / packages / perl6.scm
CommitLineData
abc12b0d
EF
1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2019 Efraim Flashner <efraim@flashner.co.il>
3;;;
4;;; This file is part of GNU Guix.
5;;;
6;;; GNU 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;;; GNU 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 GNU Guix. If not, see <http://www.gnu.org/licenses/>.
18
19(define-module (gnu packages perl6)
20 #:use-module ((guix licenses) #:prefix license:)
21 #:use-module (guix download)
d6170877 22 #:use-module (guix git-download)
abc12b0d
EF
23 #:use-module (guix packages)
24 #:use-module (guix build-system perl)
d6170877 25 #:use-module (guix build-system rakudo)
abc12b0d
EF
26 #:use-module (gnu packages bdw-gc)
27 #:use-module (gnu packages libevent)
28 #:use-module (gnu packages libffi)
29 #:use-module (gnu packages multiprecision)
f7f8e767
EF
30 #:use-module (gnu packages pkg-config)
31 #:use-module (gnu packages tls))
abc12b0d
EF
32
33(define-public moarvm
34 (package
35 (name "moarvm")
36 (version "2019.03")
37 (source
38 (origin
39 (method url-fetch)
40 (uri (string-append "https://moarvm.org/releases/MoarVM-"
41 version ".tar.gz"))
42 (sha256
43 (base32
44 "017w1zvr6yl0cgjfc1b3ddlc6vjw9q8p7alw1vvsckw95190xc14"))
45 (modules '((guix build utils)))
46 (snippet
47 '(begin
48 ;(delete-file-recursively "3rdparty/dynasm") ; JIT
49 (delete-file-recursively "3rdparty/dyncall")
50 (delete-file-recursively "3rdparty/freebsd")
51 (delete-file-recursively "3rdparty/libatomicops")
52 (delete-file-recursively "3rdparty/libuv")
53 (delete-file-recursively "3rdparty/libtommath")
54 (delete-file-recursively "3rdparty/msinttypes")
55 #t))))
56 (build-system perl-build-system)
57 (arguments
58 '(#:phases
59 (modify-phases %standard-phases
60 (replace 'configure
61 (lambda* (#:key inputs outputs #:allow-other-keys)
62 (let ((out (assoc-ref outputs "out"))
63 (pkg-config (assoc-ref inputs "pkg-config")))
64 (setenv "LDFLAGS" (string-append "-Wl,-rpath=" out "/lib"))
65 (invoke "perl" "Configure.pl"
66 "--prefix" out
67 "--pkgconfig" (string-append pkg-config "/bin/pkg-config")
68 "--has-libtommath"
69 "--has-libatomic_ops"
70 "--has-libffi"
71 "--has-libuv")))))))
72 (home-page "https://moarvm.org/")
73 ;; These should be inputs but moar.h can't find them when building rakudo
74 (propagated-inputs
75 `(("libatomic-ops" ,libatomic-ops)
76 ("libtommath" ,libtommath-1.0)
77 ("libuv" ,libuv)))
78 (inputs
79 `(("libffi" ,libffi)))
80 (native-inputs
81 `(("pkg-config" ,pkg-config)))
82 (synopsis "VM for NQP And Rakudo Perl 6")
83 (description
84 "Short for \"Metamodel On A Runtime\", MoarVM is a modern virtual machine
85built for the Rakudo Perl 6 compiler and the NQP Compiler Toolchain. Highlights
86include:
87
88@itemize
89@item Great Unicode support, with strings represented at grapheme level
90@item Dynamic analysis of running code to identify hot functions and loops, and
91perform a range of optimizations, including type specialization and inlining
92@item Support for threads, a range of concurrency control constructs, and
93asynchronous sockets, timers, processes, and more
94@item Generational, parallel, garbage collection
95@item Support for numerous language features, including first class functions,
96exceptions, continuations, runtime loading of code, big integers and interfacing
97with native libraries.
98@end itemize")
99 (license license:artistic2.0)))
af2dec5b
EF
100
101(define-public nqp
102 (package
103 (name "nqp")
104 (version "2019.03")
105 (source
106 (origin
107 (method url-fetch)
108 (uri (string-append "https://rakudo.perl6.org/downloads/nqp/nqp-"
109 version ".tar.gz"))
110 (sha256
111 (base32
112 "183zhll13fx416s3hkg4bkvib77kyr857h0nydgrl643fpacxp83"))
113 (modules '((guix build utils)))
114 (snippet
115 '(begin
116 (delete-file-recursively "3rdparty") #t))))
117 (build-system perl-build-system)
118 (arguments
119 '(#:phases
120 (modify-phases %standard-phases
121 (add-after 'patch-source-shebangs 'patch-more-shebangs
122 (lambda _
123 (substitute* '("tools/build/install-jvm-runner.pl.in"
124 "tools/build/gen-js-cross-runner.pl"
125 "tools/build/gen-js-runner.pl"
126 "tools/build/install-js-runner.pl"
127 "tools/build/install-moar-runner.pl"
128 "tools/build/gen-moar-runner.pl"
129 "t/nqp/111-spawnprocasync.t"
130 "t/nqp/113-run-command.t")
131 (("/bin/sh") (which "sh")))
132 #t))
133 (add-after 'unpack 'patch-source-date
134 (lambda _
135 (substitute* "tools/build/gen-version.pl"
136 (("gmtime") "gmtime(0)"))
137 #t))
138 (add-after 'unpack 'remove-failing-test
139 ;; One subtest fails for unknown reasons
140 (lambda _
141 (delete-file "t/nqp/019-file-ops.t")
142 #t))
143 (replace 'configure
144 (lambda* (#:key inputs outputs #:allow-other-keys)
145 (let ((out (assoc-ref outputs "out"))
146 (moar (assoc-ref inputs "moarvm")))
147 (invoke "perl" "Configure.pl"
148 "--backends=moar"
149 "--with-moar" (string-append moar "/bin/moar")
150 "--prefix" out)))))))
151 (inputs
152 `(("moarvm" ,moarvm)))
153 (home-page "https://github.com/perl6/nqp")
154 (synopsis "Not Quite Perl")
155 (description "This is \"Not Quite Perl\" -- a lightweight Perl 6-like
156environment for virtual machines. The key feature of NQP is that it's designed
157to be a very small environment (as compared with, say, perl6 or Rakudo) and is
158focused on being a high-level way to create compilers and libraries for virtual
159machines like MoarVM, the JVM, and others.
160
161Unlike a full-fledged implementation of Perl 6, NQP strives to have as small a
162runtime footprint as it can, while still providing a Perl 6 object model and
163regular expression engine for the virtual machine.")
164 (license license:artistic2.0)))
f7f8e767
EF
165
166(define-public rakudo
167 (package
168 (name "rakudo")
169 (version "2019.03.1")
170 (source
171 (origin
172 (method url-fetch)
173 (uri (string-append "https://rakudo.perl6.org/downloads/rakudo/rakudo-"
174 version ".tar.gz"))
175 (sha256
176 (base32
177 "1nllf69v8xr6v3kkj7pmryg11n5m3ajfkr7j72pvhrgnjy8lv3r1"))))
178 (build-system perl-build-system)
179 (arguments
180 '(#:phases
181 (modify-phases %standard-phases
182 (add-after 'unpack 'patch-source-date
183 (lambda _
184 (substitute* "tools/build/gen-version.pl"
185 (("gmtime") "gmtime(0)"))
186 #t))
187 (add-after 'patch-source-shebangs 'patch-more-shebangs
188 (lambda _
189 (substitute* '("tools/build/create-js-runner.pl"
190 "tools/build/create-moar-runner.p6"
191 "tools/build/create-jvm-runner.pl"
192 "src/core/Proc.pm6")
193 (("/bin/sh") (which "sh")))
194 #t))
195 (replace 'configure
196 (lambda* (#:key inputs outputs #:allow-other-keys)
197 (let ((out (assoc-ref outputs "out"))
198 (nqp (assoc-ref inputs "nqp")))
199 (invoke "perl" "./Configure.pl"
200 "--backend=moar"
201 "--with-nqp" (string-append nqp "/bin/nqp")
202 "--prefix" out))))
203 ;; This is the recommended tool for distro maintainers to install perl6
204 ;; modules systemwide. See: https://github.com/ugexe/zef/issues/117
205 (add-after 'install 'install-dist-tool
206 (lambda* (#:key outputs #:allow-other-keys)
207 (let* ((out (assoc-ref outputs "out"))
208 (dest (string-append out "/share/perl6/tools")))
209 (install-file "tools/install-dist.p6" dest)
210 (substitute* (string-append dest "/install-dist.p6")
211 (("/usr/bin/env perl6")
212 (string-append out "/bin/perl6"))))
213 #t)))))
214 (inputs
215 `(("moarvm" ,moarvm)
216 ("nqp" ,nqp)
217 ("openssl" ,openssl)))
218 (home-page "https://rakudo.org/")
219 (native-search-paths
220 (list (search-path-specification
221 (variable "PERL6LIB")
222 (separator ",")
223 (files '("share/perl6/lib"
224 "share/perl6/site/lib"
225 "share/perl6/vendor/lib")))))
226 (synopsis "Perl 6 Compiler")
227 (description "Rakudo Perl is a compiler that implements the Perl 6
228specification and runs on top of several virtual machines.")
229 (license license:artistic2.0)))
d6170877 230
ea856c08
EF
231(define-public perl6-json-class
232 (package
233 (name "perl6-json-class")
234 (version "0.0.12")
235 (source
236 (origin
237 (method git-fetch)
238 (uri (git-reference
239 (url "https://github.com/jonathanstowe/JSON-Class.git")
240 (commit (string-append "v" version))))
241 (file-name (git-file-name name version))
242 (sha256
243 (base32
244 "1zyzajc57j3m8q0nr72h9pw4w2nx92rafywlvysgphc5q9sb8np2"))))
245 (build-system rakudo-build-system)
246 (propagated-inputs
247 `(("perl6-json-marshal" ,perl6-json-marshal)
248 ("perl6-json-unmarshal" ,perl6-json-unmarshal)))
249 (native-inputs
250 `(("perl6-json-fast" ,perl6-json-fast)))
251 (home-page "https://github.com/jonathanstowe/JSON-Class")
252 (synopsis "Provide simple serialisation/deserialisation of objects to/from JSON")
253 (description "This is a simple role that provides methods to instantiate a
254class from a JSON string that (hopefully,) represents it, and to serialise an
255object of the class to a JSON string. The JSON created from an instance should
256round trip to a new instance with the same values for the @quot{public
257attributes}. @quot{Private} attributes (that is ones without accessors,) will
258be ignored for both serialisation and de-serialisation. The exact behaviour
259depends on that of @code{JSON::Marshal} and @code{JSON::Unmarshal} respectively.")
260 (license license:artistic2.0)))
261
61b43640
EF
262(define-public perl6-json-fast
263 (package
264 (name "perl6-json-fast")
265 (version "0.8")
266 (source
267 (origin
268 (method git-fetch)
269 (uri (git-reference
270 (url "https://github.com/timo/json_fast.git")
271 (commit version)))
272 (file-name (git-file-name name version))
273 (sha256
274 (base32
275 "1fif081gdxdnja14vkj523p9dyzdcdj81lmjv9fvfazvpagb6dg2"))))
276 (build-system rakudo-build-system)
277 (arguments '(#:with-zef? #f))
278 (home-page "https://github.com/timo/json_fast")
279 (synopsis "Perl6 json parser")
280 (description "A naive imperative json parser in pure perl6 (but with direct
281access to @code{nqp::} ops), to evaluate performance against @code{JSON::Tiny}.
282It is a drop-in replacement for @code{JSON::Tiny}'s from-json and to-json subs,
283but it offers a few extra features.")
284 (license license:artistic2.0)))
285
e1b3cf68
EF
286(define-public perl6-json-marshal
287 (package
288 (name "perl6-json-marshal")
289 (version "0.0.16")
290 (source
291 (origin
292 (method git-fetch)
293 (uri (git-reference
294 (url "https://github.com/jonathanstowe/JSON-Marshal.git")
295 (commit (string-append "v" version))))
296 (file-name (git-file-name name version))
297 (sha256
298 (base32
299 "0qy7j83h6gjzyyv74ncd92cd9h45rv8diaz3vldiv3b6fqwz4c6i"))))
300 (build-system rakudo-build-system)
301 (propagated-inputs
302 `(("perl6-json-fast" ,perl6-json-fast)
303 ("perl6-json-name" ,perl6-json-name)))
304 (native-inputs
305 `(("perl6-json-fast" ,perl6-json-fast)))
306 (home-page "https://github.com/jonathanstowe/JSON-Marshal")
307 (synopsis "Simple serialisation of objects to JSON")
308 (description "This library provides a single exported subroutine to create
309a JSON representation of an object. It should round trip back into an object
310of the same class using @code{JSON::Unmarshal}.")
311 (license license:artistic2.0)))
312
bc7c6efe
EF
313(define-public perl6-json-name
314 (package
315 (name "perl6-json-name")
316 (version "0.0.3")
317 (source
318 (origin
319 (method git-fetch)
320 (uri (git-reference
321 (url "https://github.com/jonathanstowe/JSON-Name.git")
322 (commit (string-append "v" version))))
323 (file-name (git-file-name name version))
324 (sha256
325 (base32
326 "130qwdpbj5qdlsdz05y0rksd79lzbq79scy47n6lnf21b0hz1qjc"))))
327 (build-system rakudo-build-system)
328 (arguments '(#:with-zef? #f))
329 (home-page "https://github.com/jonathanstowe/JSON-Name")
330 (synopsis "Provides a trait to store an alternative JSON Name")
331 (description "This is released as a dependency of @code{JSON::Marshal} and
332@code{JSON::Unmarshal} in order to save duplication, it is intended to store a
333separate JSON name for an attribute where the name of the JSON attribute might be
334changed, either for aesthetic reasons or the name is not a valid Perl identifier.
335It will of course also be needed in classes thar are going to use
336@code{JSON::Marshal} or @code{JSON::Unmarshal} for serialisation/de-serialisation.")
337 (license license:artistic2.0)))
338
56eea221
EF
339(define-public perl6-json-unmarshal
340 ;; Last commit was May 2017
341 (let ((commit "e1b6288c5f3165058f36c0f4e171cdf2dfd640da")
342 (revision "1"))
343 (package
344 (name "perl6-json-unmarshal")
345 (version (git-version "0.0.0" revision commit))
346 (source
347 (origin
348 (method git-fetch)
349 (uri (git-reference
350 (url "https://github.com/tadzik/JSON-Unmarshal.git")
351 (commit commit)))
352 (file-name (git-file-name name version))
353 (sha256
354 (base32
355 "14azsmzmwdn8k0gqcpvballharcvzylmlyrx2wmv4kpqfnz29fjc"))))
356 (build-system rakudo-build-system)
357 (propagated-inputs
358 `(("perl6-json-fast" ,perl6-json-fast)
359 ("perl6-json-name" ,perl6-json-name)))
360 (home-page "https://github.com/tadzik/JSON-Unmarshal")
361 (synopsis "Make JSON from an Object")
362 (description "This library provides a single exported subroutine to
363create an object from a JSON representation of an object.")
364 (license license:expat))))
365
489f4933
EF
366(define-public perl6-license-spdx
367 (package
368 (name "perl6-license-spdx")
369 (version "3.4.0")
370 (source
371 (origin
372 (method git-fetch)
373 (uri (git-reference
374 (url "https://github.com/jonathanstowe/License-SPDX")
375 (commit (string-append "v" version))))
376 (file-name (git-file-name name version))
377 (sha256
378 (base32
379 "0dl263c3fbxk001gm5fisrzqz1dx182ipaa0x2qva2gxvl075xm8"))))
380 (build-system rakudo-build-system)
381 (propagated-inputs
382 `(("perl6-json-class" ,perl6-json-class)))
383 (home-page "https://github.com/jonathanstowe/License-SPDX")
384 (synopsis "Abstraction over the SPDX License List")
385 (description "This provides an abstraction over the SPDX License List as
386provided in JSON format. Its primary raison d'être is to help the licence
387checking of @code{Test::META} and to allow for the warning about deprecated
388licences therein.")
389 (license license:artistic2.0)))
390
505b9792
EF
391(define-public perl6-meta6
392 (package
393 (name "perl6-meta6")
394 (version "0.0.23")
395 (source
396 (origin
397 (method git-fetch)
398 (uri (git-reference
399 (url "https://github.com/jonathanstowe/META6.git")
400 (commit (string-append "v" version))))
401 (file-name (git-file-name name version))
402 (sha256
403 (base32
404 "1xnlaamfbdlfb2zidim3bbc4mawsrg6qxhxi6gbld46z1cyry1cw"))))
405 (build-system rakudo-build-system)
406 (propagated-inputs
407 `(("perl6-json-class" ,perl6-json-class)))
408 (native-inputs
409 `(("perl6-json-fast" ,perl6-json-fast)))
410 (home-page "https://github.com/jonathanstowe/META6")
411 (synopsis "Do things with Perl 6 [META files]")
412 (description "This provides a representation of the Perl 6 META files
413specification - the META file data can be read, created, parsed and written in a
414manner that is conformant with the specification.
415
416Where they are known about it also makes allowance for @quot{customary} usage in
417existing software (such as installers and so forth.)
418
419The intent of this is allow the generation and testing of META files for module
420authors, so it can provide meta-information whether the attributes are mandatory
421as per the spec and where known the places that @quot{customary} attributes are
422used.")
423 (license license:artistic2.0)))
424
d6170877
EF
425(define-public perl6-tap-harness
426 (package
427 (name "perl6-tap-harness")
428 (version "0.0.7")
429 (source
430 (origin
431 (method git-fetch)
432 (uri (git-reference
433 (url "https://github.com/perl6/tap-harness6.git")
434 (commit (string-append "v" version))))
435 (file-name (git-file-name name version))
436 (sha256
437 (base32
438 "1lig8i0my3fgqvlay9532xslbf3iis2d7wz89gniwvwqffi2kh6r"))))
439 (build-system rakudo-build-system)
440 (arguments
441 '(#:with-zef? #f
442 #:with-prove6? #f
443 #:phases
444 (modify-phases %standard-phases
445 (replace 'check
446 (lambda _
447 (invoke "perl6" "-Ilib" "bin/prove6" "-l" "t"))))))
448 (home-page "https://github.com/perl6/tap-harness6/")
449 (synopsis "TAP harness for perl6")
450 (description "This module provides the @command{prove6} command which runs a
451TAP based test suite and prints a report. The @command{prove6} command is a
452minimal wrapper around an instance of this module.")
453 (license license:artistic2.0)))
74809e9e 454
60945c67
EF
455(define-public perl6-uri
456 (package
457 (name "perl6-uri")
458 (version "0.1.5")
459 (source
460 (origin
461 (method git-fetch)
462 (uri (git-reference
463 (url "https://github.com/perl6-community-modules/uri.git")
464 (commit version)))
465 (file-name (git-file-name name version))
466 (sha256
467 (base32
468 "0h318g75jqn2ckw051g35iqyfxz1mps0jyg5z6pd857y3kacbkpl"))))
469 (build-system rakudo-build-system)
470 (arguments '(#:with-zef? #f))
471 (home-page "https://github.com/perl6-community-modules/uri")
472 (synopsis "URI implementation using Perl 6")
473 (description "A URI implementation using Perl 6 grammars to implement RFC
4743986 BNF. Currently only implements parsing. Includes @code{URI::Escape} to
475(un?)escape characters that aren't otherwise allowed in a URI with % and a hex
476character numbering.")
477 (license license:artistic2.0)))
478
74809e9e
EF
479(define-public perl6-zef
480 (package
481 (name "perl6-zef")
482 (version "0.6.7")
483 (source
484 (origin
485 (method git-fetch)
486 (uri (git-reference
487 (url "https://github.com/ugexe/zef.git")
488 (commit (string-append "v" version))))
489 (file-name (git-file-name name version))
490 (sha256
491 (base32
492 "07n7g1xw2c4g860rs890gx85vyhdq0ysgwbrnzw6q905jph2bkv7"))))
493 (build-system rakudo-build-system)
494 (arguments
495 '(#:with-zef? #f
496 #:phases
497 (modify-phases %standard-phases
498 (replace 'check
499 (lambda _
500 (setenv "HOME" "/tmp")
501 (invoke "perl6" "-I." "bin/zef" "--debug"
502 "--tap-harness" "test" "."))))))
503 (home-page "https://github.com/ugexe/zef")
504 (synopsis "Perl6 Module Management")
505 (description "Zef is a Perl 6 package (module) manager. It can be used to
506download and install Perl 6 modules in your home directory or as a system-wide
507module.")
508 (license license:artistic2.0)))