projects/guix·blob javascript-team · refs

531 lines · 23.0 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2016 Jan Nieuwenhuizen <[email protected]>
3;;; Copyright © 2017 Clément Lassieur <[email protected]>
4;;; Copyright © 2017 Tobias Geerinckx-Rice <[email protected]>
5;;; Copyright © 2018 Mark H Weaver <[email protected]>
6;;; Copyright © 2020 Ludovic Courtès <[email protected]>
7;;; Copyright © 2020 Marius Bakke <[email protected]>
8;;; Copyright © 2022 jgart <[email protected]>
9;;; Copyright © 2023 Adam Faiz <[email protected]>
10;;; Copyright © 2023 Maxim Cournoyer <[email protected]>
11;;; Copyright © 2023 宋文武 <[email protected]>
12;;; Copyright © 2023-2026 Artyom V. Poptsov <[email protected]>
13;;; Copyright © 2025 Gabriel Santos <[email protected]>
14;;; Copyright © 2025 Sharlatan Hellseher <[email protected]>
15;;;
16;;; This file is part of GNU Guix.
17;;;
18;;; GNU Guix is free software; you can redistribute it and/or modify it
19;;; under the terms of the GNU General Public License as published by
20;;; the Free Software Foundation; either version 3 of the License, or (at
21;;; your option) any later version.
22;;;
23;;; GNU Guix is distributed in the hope that it will be useful, but
24;;; WITHOUT ANY WARRANTY; without even the implied warranty of
25;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26;;; GNU General Public License for more details.
27;;;
28;;; You should have received a copy of the GNU General Public License
29;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
30
31(define-module (gnu packages books)
32 #:use-module ((guix licenses) #:prefix license:)
33 #:use-module (guix build-system asdf)
34 #:use-module (guix build-system cmake)
35 #:use-module (guix build-system copy)
36 #:use-module (guix build-system emacs)
37 #:use-module (guix build-system gnu)
38 #:use-module (guix deprecation)
39 #:use-module (guix download)
40 #:use-module (guix gexp)
41 #:use-module (guix git-download)
42 #:use-module (guix packages)
43 #:use-module (guix utils)
44 #:use-module (gnu packages)
45 #:use-module (gnu packages autotools)
46 #:use-module (gnu packages base)
47 #:use-module (gnu packages bash)
48 #:use-module (gnu packages cpp)
49 #:use-module (gnu packages compression)
50 #:use-module (gnu packages curl)
51 #:use-module (gnu packages emacs)
52 #:use-module (gnu packages fonts)
53 #:use-module (gnu packages fontutils)
54 #:use-module (gnu packages freedesktop)
55 #:use-module (gnu packages gettext)
56 #:use-module (gnu packages glib)
57 #:use-module (gnu packages gtk)
58 #:use-module (gnu packages gnome)
59 #:use-module (gnu packages inkscape)
60 #:use-module (gnu packages icu4c)
61 #:use-module (gnu packages linux)
62 #:use-module (gnu packages lisp-xyz)
63 #:use-module (gnu packages music)
64 #:use-module (gnu packages perl)
65 #:use-module (gnu packages pkg-config)
66 #:use-module (gnu packages python)
67 #:use-module (gnu packages python-build)
68 #:use-module (gnu packages speech)
69 #:use-module (gnu packages tex)
70 #:use-module (gnu packages texinfo)
71 #:use-module (gnu packages version-control)
72 #:use-module (gnu packages webkit)
73 #:use-module (gnu packages xml))
74
75(define-public book-faif
76 (package
77 (name "book-faif")
78 (version "2.0")
79 (source (origin
80 (method url-fetch)
81 (uri (string-append "https://www.fsf.org/faif/faif-" version
82 ".tar.bz2"))
83 (sha256
84 (base32
85 "0qf14d0n6k1dn9z0fdnx9qkhn4iq685xd443w7l7w54bm931p7dw"))))
86 (build-system copy-build-system)
87 (native-inputs
88 (list (texlive-local-tree
89 (list texlive-caption
90 texlive-endnotes
91 texlive-etoolbox
92 texlive-fncychap
93 texlive-helvetic
94 texlive-times
95 texlive-ucs))))
96 (arguments
97 (list
98 #:install-plan #~'(("faif-2.0.pdf" "share/doc/faif/"))
99 #:phases
100 #~(modify-phases %standard-phases
101 (add-after 'unpack 'writable-texmfvar
102 ;; Generating font shapes require a writable TEXMFVAR directory.
103 (lambda _ (setenv "TEXMFVAR" "/tmp")))
104 (add-before 'install 'build
105 (lambda _
106 (invoke "pdflatex" "faif-2.0.tex"))))))
107 (home-page "https://www.fsf.org/faif")
108 (synopsis "Free as in Freedom (2.0)")
109 (description
110 "In 2002, Sam Williams wrote Free as in Freedom, a biography of Richard
111M. Stallman. In its epilogue, Williams expressed hope that choosing to
112distribute his book under the GNU Free Documentation License would enable and
113encourage others to share corrections and their own perspectives through
114modifications to his work. Free as in Freedom (2.0) is Stallman's revision of
115the original biography. While preserving Williams's viewpoint, it includes
116factual corrections and extensive new commentary by Stallman, as well as new
117prefaces by both authors written for the occasion. It is a rare kind of
118biography, where the reader has the benefit of both the biographer's original
119words and the subject's response.")
120 (license license:fdl1.3+)))
121
122(define-public book-metaspec
123 ;; No release tag
124 (let ((commit "108544f2e5f483571522f9aa52e6097f47d0c0f1")
125 (revision "0"))
126 (package
127 (name "book-metaspec")
128 (version (git-version "1.0.0" revision commit))
129 (source
130 (origin
131 (method git-fetch)
132 (uri (git-reference
133 (url "https://codeberg.org/dlowe/metaspectre")
134 (commit commit)))
135 (file-name (git-file-name name version))
136 (sha256
137 (base32 "131445qrxwfn7057p9jjg2lnpwyfj0n49cbcfws6jsd2lhv9fvbg"))))
138 (build-system asdf-build-system/sbcl)
139 (arguments
140 (list
141 #:tests? #f ;no tests
142 ;; Docs are named metaspec, system name is metaspectre
143 #:asd-systems ''("metaspectre")
144 #:modules `((guix build emacs-utils)
145 ,@%asdf-build-modules)
146 #:imported-modules `((guix build emacs-utils)
147 ,@%asdf-build-system-modules)
148 #:phases
149 #~(modify-phases %standard-phases
150 ;; metaspectre has internal version & origin variables that are
151 ;; overridden by a config file in the source root. The variables
152 ;; as specified as a plist and show up in the rendered docs.
153 (add-after 'unpack 'set-version
154 (lambda _
155 (with-output-to-file "config.lisp-expr"
156 (lambda _
157 (format #t "~s"
158 '(:version #$version
159 ;; URL of origin repository
160 :origin "https://codeberg.org/dlowe/metaspectre"
161 ;; Enforce reproducibility
162 :built "1970-01-01T00:00:00Z"))))))
163 (add-after 'set-version 'fix-render-times
164 (lambda _
165 ;; Ensure that HTML rendering of SDOC uses epoch. There is no
166 ;; control of this via the config.lisp-expr plist.
167 (substitute* "src/render.lisp"
168 (("\\(\\*render-built\\*\\s+(\\(?[a-zA-Z0-9\\-]+\\)?)\\)")
169 "(*render-built* \"1970-01-01T00:00:00Z\")"))
170 ;; parser.lisp attempts to output UTC current time (during
171 ;; build) despite the :built entry in the config.lisp-expr
172 ;; plist.
173 (substitute* "src/parser.lisp"
174 ((":built \\(iso8601-utc\\)")
175 ":built \"1970-01-01T00:00:00Z\""))))
176 ;; metaspectre is a "non-standard" ASDF system. The system is
177 ;; essentially a library of functions. You manually drive the
178 ;; conversion of the ANSI spec to sdoc and render the sdoc.
179 (add-after 'build 'convert-to-sdoc
180 (lambda _
181 (lisp-eval-program
182 `((require :asdf)
183 (asdf:initialize-source-registry
184 ;; We tell asdf that the system root is the unpacked source
185 ;; tree. metaspectre builds everything relative to the
186 ;; system directory, into an out/ directory.
187 (list :source-registry
188 (list :tree (uiop:ensure-pathname ,(getcwd)
189 :truenamize t
190 :ensure-directory t))
191 :inherit-configuration))
192 (require :metaspectre)
193 ;; The metaspectre functions are not exported/made public
194 ;; from their packages. They are intended to be run by you
195 ;; entering those packages from the REPL.
196 (metaspectre::convert-whole-spec)))))
197 (add-after 'convert-to-sdoc 'render-html
198 (lambda _
199 (lisp-eval-program
200 `((require :asdf)
201 (asdf:initialize-source-registry
202 (list
203 :source-registry
204 (list :tree (uiop:ensure-pathname ,(getcwd)
205 :truenamize t
206 :ensure-directory t))
207 :inherit-configuration))
208 (require :metaspectre)
209 (metaspectre::render-whole-spec)))))
210 ;; XXX: render-texinfo only depends on convert-to-sdoc phase.
211 ;; However, we need to impose an ordering so that the install phase
212 ;; has all the files it expects to install.
213 (add-after 'render-html 'render-texinfo
214 (lambda _
215 (lisp-eval-program
216 `((require :asdf)
217 (asdf:initialize-source-registry
218 (list
219 :source-registry
220 (list :tree (uiop:ensure-pathname ,(getcwd)
221 :truenamize t
222 :ensure-directory t))
223 :inherit-configuration))
224 (require :metaspectre)
225 (metaspectre/texinfo::render-whole-spec)))
226 (with-directory-excursion "out/texi"
227 (invoke "makeinfo" "--no-split" "metaspec.texi"))))
228 ;; XXX: Like the render-texinfo phase, we have imposed an ordering
229 ;; on the install phase. It must happen after ALL rendering, but
230 ;; our imposed SDOC->HTML->Texinfo ordering means install must come
231 ;; after Texinfo generation.
232 (add-after 'render-texinfo 'install
233 (lambda* (#:key name outputs #:allow-other-keys)
234 (let* ((out (assoc-ref outputs "out"))
235 (html (string-append out "/share/doc/" name))
236 (info (string-append out "/share/info")))
237 ;; NOTE: Copying from unpacked out/ directory that metaspectre
238 ;; creates.
239 (copy-recursively "out/html" html)
240 (install-file "out/texi/metaspec.info" info))))
241 (add-after 'install 'install-emacs-files
242 (lambda _
243 (let ((lisp-dir
244 (string-append #$output "/share/emacs/site-lisp")))
245 (install-file "assets/metaspec.el" lisp-dir)
246 (emacs-generate-autoloads #$name lisp-dir))))
247 ;; The metaspectre package/system is only intended for building the
248 ;; metaspec documentation. It should never really be consumed by
249 ;; anything downstream. So we remove all of the files that various
250 ;; phases in asdf-build-system/sbcl produce/install.
251 (add-after 'cleanup 'remove-sbcl-files
252 (lambda* (#:key outputs #:allow-other-keys)
253 (let ((out (assoc-ref outputs "out")))
254 (with-directory-excursion out
255 (delete-file-recursively "etc")
256 (delete-file-recursively "lib")
257 (delete-file-recursively "share/common-lisp"))))))))
258 (native-inputs
259 (list cl-alexandria
260 cl-ppcre
261 cl-stencl
262 emacs-minimal
263 texinfo))
264 (home-page "https://metaspec.dev/")
265 (synopsis "Produce ANSI Common Lisp standard")
266 (description
267 "A parsed and rendered version of the draft ANSI standard for Common Lisp
268(dpANS3). Produces an HTML rendering with search features, an Info manual, and
269an Emacs package. The default HTML rendering is similar to the Common Lisp
270Hyperspec.")
271 (license (list
272 ;; metaspec itself
273 license:expat
274 ;; Potential outputs
275 license:cc0
276 ;; ANSI draft text
277 license:public-domain)))))
278
279(define-public book-sicp
280 (let ((commit "bda03f79d6e2e8899ac2b5ca6a3732210e290a79")
281 (revision "3"))
282 (package
283 (name "book-sicp")
284 (version (git-version "20180718" revision commit))
285 (source (origin
286 (method git-fetch)
287 (uri (git-reference
288 (url "https://github.com/sarabander/sicp")
289 (commit commit)))
290 (sha256
291 (base32
292 "0mng7qrj2dvssyffr9ycnf4a5k0kadp4dslq7mc5bhzq1qxyjs2w"))
293 (file-name (git-file-name name version))))
294 (build-system copy-build-system)
295 (native-inputs (list gzip texinfo))
296 (arguments
297 (list #:install-plan ''(("html" "share/doc/sicp/")
298 ("sicp.info" "share/info/"))
299 #:phases #~(modify-phases %standard-phases
300 (add-after 'unpack 'remove-obsolete-commands
301 (lambda _
302 ;; Reported upstream:
303 ;; https://github.com/sarabander/sicp/issues/46.
304 (substitute* "sicp-pocket.texi"
305 (("@setshortcontentsaftertitlepage")
306 ""))))
307 (add-before 'install 'build
308 (lambda _
309 (invoke "makeinfo" "--no-split"
310 "--output=sicp.info"
311 "sicp-pocket.texi"))))))
312 (home-page "https://sarabander.github.io/sicp")
313 (synopsis "Structure and Interpretation of Computer Programs")
314 (description "Structure and Interpretation of Computer Programs (SICP) is
315a textbook aiming to teach the principles of computer programming.
316
317Using Scheme, a dialect of the Lisp programming language, the book explains
318core computer science concepts such as abstraction in programming,
319metalinguistic abstraction, recursion, interpreters, and modular programming.")
320 (license license:cc-by-sa4.0))))
321
322(define-public book-sparc
323 (package
324 (name "book-sparc")
325 (version "6.0.0")
326 (source (origin
327 (method git-fetch)
328 (uri (git-reference
329 (url "https://github.com/artyom-poptsov/SPARC")
330 (commit (string-append "v" version))))
331 (sha256
332 (base32
333 "1lvaa4265ddbasf8kzk0s6m3ylsjm4ckgg0hk86fapvk2dfzdvgp"))
334 (file-name (git-file-name name version))
335 (modules '((guix build utils)))))
336 (build-system gnu-build-system)
337 (native-inputs
338 (list autoconf
339 automake
340 bash-minimal
341 fontconfig
342 inkscape
343 lilypond
344 perl
345 python-pygments
346 (texlive-local-tree
347 (list texlive-acronym
348 texlive-adjustbox
349 texlive-biblatex
350 texlive-bibtex
351 texlive-bibtexperllibs
352 texlive-bigfoot
353 texlive-chngcntr
354 texlive-circuitikz
355 texlive-collection-langcyrillic
356 texlive-csquotes
357 texlive-fancyvrb
358 texlive-fontspec
359 texlive-framed
360 texlive-glossaries
361 texlive-glossaries-english
362 texlive-glossaries-extra
363 texlive-imakeidx
364 texlive-koma-script
365 texlive-libkpathsea
366 texlive-lilyglyphs
367 texlive-lineno
368 texlive-minted
369 texlive-multirow
370 texlive-pgf
371 texlive-pgfplots
372 texlive-subfiles
373 texlive-svg
374 texlive-t1utils
375 texlive-textpos
376 texlive-tikz-timing
377 texlive-transparent
378 texlive-trimspaces
379 texlive-upquote
380 texlive-xetex
381 texlive-xstring))
382 which))
383 (inputs (list font-liberation git))
384 (arguments
385 (list #:tests? #f ; no tests
386 #:modules (append %default-gnu-imported-modules
387 '((ice-9 regex)
388 (srfi srfi-1)))
389 #:phases #~(modify-phases %standard-phases
390 (add-before 'build 'configure-environment
391 (lambda* (#:key inputs make-flags parallel-build?
392 #:allow-other-keys)
393 (let* ((src (assoc-ref inputs "source"))
394 (rx (make-regexp "/gnu/store/(.*)-book-sparc-.*"))
395 (src-hash (match:substring (regexp-exec rx src) 1))
396 (random-seed
397 (fold (lambda (ch prev)
398 (+ (char->integer ch)
399 prev))
400 0
401 (string->list src-hash))))
402 (setenv "RANDOMSEED" (number->string random-seed))
403 (setenv "REPRODUCIBILITY" "yes"))))
404 (replace 'install
405 (lambda _
406 (let ((doc-dir (string-append #$output
407 "/share/doc/sparc/")))
408 (mkdir-p doc-dir)
409 (copy-file "sparc.ru.pdf"
410 (string-append doc-dir
411 "sparc.ru.pdf"))
412 (copy-file "sparc.en.pdf"
413 (string-append doc-dir
414 "sparc.en.pdf"))))))))
415 (home-page "https://github.com/artyom-poptsov/SPARC")
416 (synopsis "Book on combining art and technology")
417 (description
418 "Science, Programming, Art and Radioelectronics Club (SPARC) is a book that
419explains how to combine the topics mentioned in the title to build projects. The
420book can be used to teach programming classes in colleges and to organize
421workshops in hackerspaces or other community-driven spaces. Currently the book
422is available in Russian and English.")
423 (license license:cc-by-sa4.0)))
424
425(define-public sword
426 (package
427 (name "sword")
428 (version "1.9.0")
429 (source
430 (origin
431 (method url-fetch)
432 (uri (string-append
433 "https://www.crosswire.org/ftpmirror/pub/sword/source/v"
434 (version-major+minor version) "/sword-" version ".tar.gz"))
435 (sha256
436 (base32 "12kb881w7p79is3ysy2w5bnzj8axfk05lb1ya8413brgvvrrqh22"))))
437 (build-system cmake-build-system)
438 (native-inputs (list curl icu4c-73 zlib))
439 (arguments
440 (list
441 #:configure-flags
442 #~(list "-DSWORD_BUILD_TESTS=Yes"
443 "-DSWORD_USE_INTERNAL_ZLIB=No")))
444 (home-page "https://www.crosswire.org/sword/")
445 (synopsis "Cross-platform open source tools for writing Bible software")
446 (description
447 "The SWORD Project is a free Bible software project used to create Bible
448software, with support for multiple texts and languages.")
449 (license license:gpl2+)))
450
451(define-public xiphos
452 (package
453 (name "xiphos")
454 (version "4.4.0")
455 (source
456 (origin
457 (method git-fetch)
458 (uri (git-reference
459 (url "https://github.com/crosswire/xiphos")
460 (commit version)))
461 (sha256
462 (base32 "1xcbf5w09hiz50a981dsmnlyg0ag15w1isazcmqk3zd7hjay3ikj"))
463 (file-name (git-file-name name version))))
464 (build-system cmake-build-system)
465 (native-inputs (list appstream
466 appstream-glib
467 at-spi2-core
468 biblesync
469 desktop-file-utils ;for 'desktop-file-validate'
470 (list glib "bin")
471 gettext-minimal
472 gsettings-desktop-schemas
473 gtk+
474 libgsf
475 minizip
476 pkg-config
477 sword
478 util-linux ;for 'uuidgen'
479 (list util-linux "lib") ;for 'libuuid'
480 webkitgtk-for-gtk3
481 yelp-tools
482 zip))
483 (inputs (list dbus dbus-glib libxml2 python python-lxml speech-dispatcher))
484 (arguments
485 (list
486 #:tests? #f)) ;No tests
487 (home-page "https://xiphos.org/")
488 (synopsis "Open Source Bible Study Software")
489 (description
490 "Xiphos is a Bible study tool using GTK. It uses Sword to
491display bibles, commentaries, dictionaries, and other texts and images.
492Xiphos includes features such as searching, biblesync, bookmarks,
493parallel study, and original language study.")
494 (license license:gpl2+)))
495
496(define-public book-emacs-lisp-elements
497 (package
498 (name "book-emacs-lisp-elements")
499 (version "2.0.4")
500 (source
501 (origin
502 (method git-fetch)
503 (uri (git-reference
504 (url "https://github.com/protesilaos/emacs-lisp-elements")
505 (commit version)))
506 (file-name (git-file-name name version))
507 (sha256
508 (base32 "06mhrb16h93n3s3srcfgmzsyh2lxx4ffj1di6qvczfg4039pi3c8"))))
509 (build-system emacs-build-system)
510 (arguments
511 (list
512 #:tests? #f ;No code —no tests
513 #:phases
514 #~(modify-phases %standard-phases
515 (add-before 'install 'makeinfo
516 (lambda _
517 (emacs-makeinfo "elispelem.org"))))))
518 (native-inputs (list texinfo))
519 (home-page "https://protesilaos.com/emacs/emacs-lisp-elements")
520 (synopsis "Overview of the Emacs Lisp programming language")
521 (description
522 "Emacs Lisp Elements is a book written by Protesilaos Stavrou, providing
523a big picture view of the @acronym{Elisp, Emacs Lisp} programming language by
524combining prose with code. This book aims to provide an idea of how Elisp
525works by showing some of the main concepts and patterns encountered in
526everyday Elisp code.
527
528This book is not intended as a replacement for the built-in Emacs Lisp
529Reference Manual, but instead to give readers enough information to reason
530about Elisp code.")
531 (license license:fdl1.3+)))