[PATCH] gnu: Add book-r5rs.

  • Open
  • quality assurance status badge
Details
2 participants
  • Antero Mejr
  • ???
Owner
unassigned
Submitted by
Antero Mejr
Severity
normal
A
A
Antero Mejr wrote on 31 Mar 2023 05:28
(address . guix-patches@gnu.org)
20230331032841.27505-1-antero@mailbox.org
* gnu/packages/book-software.scm (book-r5rs): New variable.
---
Please apply this patch last.
This patch is for the R5RS spec document, in PDF and Info formats.
Not sure what conventions would work best, but here I used:
1. package definitions for books/documents go into the file
"book-[type].scm".
2. package definition names are formatted "book-[shortname]".
3. PDF is installed into share/doc/shortname.
4. other formats go into the appropriate path for their file type,
or share/doc/shortname.

I think distributing books and documentation through Guix, especially
technical or FOSS-related, is an interesting idea.
Maybe these packages could go in the same .scm file as iyzsong's package for
the book "Free as in Freedom":

I would be interested to hear what others think about books in Guix.
Would we want to limit to technical books? What about translations?
Has this already been proposed somewhere?

gnu/packages/book-software.scm | 38 ++++++++++++++++++++++++++++++++++
1 file changed, 38 insertions(+)

Toggle diff (48 lines)
diff --git a/gnu/packages/book-software.scm b/gnu/packages/book-software.scm
index ca4e47b89e..35ad76399e 100644
--- a/gnu/packages/book-software.scm
+++ b/gnu/packages/book-software.scm
@@ -48,3 +48,41 @@ (define-public rrrs2txi
translates the LaTeX r3rs, r4rs, and r5rs to texinfo format (r3rs.txi,
r4rs.txi, and r5rs.txi).")
(license license:bsd-3)))
+
+(define-public book-r5rs
+ (package
+ (name "book-r5rs")
+ (version "5")
+ (source (origin
+ (method url-fetch)
+ (uri
+ "https://groups.csail.mit.edu/mac/ftpdir/scheme-reports/r5rs.tar.gz")
+ (sha256
+ (base32
+ "12c6087zdffigmdl9bx1xv71si9jfpffsbpimivx3j80j8hvxrci"))))
+ (build-system copy-build-system)
+ (arguments
+ (list #:phases #~(modify-phases %standard-phases
+ (add-before 'install 'build
+ (lambda _
+ (invoke "pdflatex" "r5rs.tex")
+ (invoke "pdflatex" "r5rs.tex")
+ (system* "scm" "-f" ;expected to fail
+ (string-append
+ #$(this-package-native-input "rrrs2txi")
+ "/lib/rrrs2txi.scm")
+ "-e" "(go)")
+ ;; forcing because the online txi is broken too
+ (invoke "makeinfo" "--force" "r5rs.txi"))))
+ #:install-plan #~'(("r5rs.pdf" "share/doc/r5rs/")
+ ("r5rs.info" "share/info/"))))
+ (native-inputs (list rrrs2txi scm texinfo
+ (texlive-updmap.cfg (list texlive-fonts-ec))))
+ (home-page "https://people.csail.mit.edu/jaffer/Scheme.html")
+ (synopsis "Specification for the R5RS implementation of Scheme")
+ (description
+ "The report gives a defining description of the programming language
+Scheme. Scheme is a statically scoped and properly tail-recursive dialect of
+the Lisp programming language.")
+ (license (license:non-copyleft
+ "https://people.csail.mit.edu/jaffer/Scheme_TERMS.html"))))
--
2.38.1
A
A
Antero Mejr wrote on 31 Mar 2023 05:36
[PATCH 1/3] gnu: Add rrrs2txi.
(address . 62554@debbugs.gnu.org)
20230331033621.28190-1-antero@mailbox.org
* gnu/packages/book-software.scm (rrrs2txi): New package.
* gnu/local.mk (book-software.scm): Add file.
---
gnu/local.mk | 1 +
gnu/packages/book-software.scm | 50 ++++++++++++++++++++++++++++++++++
2 files changed, 51 insertions(+)
create mode 100644 gnu/packages/book-software.scm

Toggle diff (70 lines)
diff --git a/gnu/local.mk b/gnu/local.mk
index aee0b8a645..10070db09a 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -147,6 +147,7 @@ GNU_SYSTEM_MODULES = \
%D%/packages/bioinformatics.scm \
%D%/packages/bittorrent.scm \
%D%/packages/bison.scm \
+ %D%/packages/book-software.scm \
%D%/packages/boost.scm \
%D%/packages/bootloaders.scm \
%D%/packages/bootstrap.scm \
diff --git a/gnu/packages/book-software.scm b/gnu/packages/book-software.scm
new file mode 100644
index 0000000000..ca4e47b89e
--- /dev/null
+++ b/gnu/packages/book-software.scm
@@ -0,0 +1,50 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2023 Antero Mejr <antero@mailbox.org>
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
+
+(define-module (gnu packages book-software)
+ #:use-module (gnu packages)
+ #:use-module (gnu packages scheme)
+ #:use-module (gnu packages tex)
+ #:use-module (gnu packages texinfo)
+ #:use-module (guix build-system copy)
+ #:use-module (guix download)
+ #:use-module (guix gexp)
+ #:use-module (guix packages)
+ #:use-module (guix utils)
+ #:use-module ((guix licenses) #:prefix license:))
+
+(define-public rrrs2txi
+ (package
+ (name "rrrs2txi")
+ (version "2001-03-28")
+ (source (origin
+ (method url-fetch)
+ (uri "https://people.csail.mit.edu/jaffer/rrrs2txi.scm")
+ (sha256
+ (base32
+ "11bmm0c2plri0mf3jjabjpbs342h4983s8jdlsvhxr384j2nlyai"))))
+ (build-system copy-build-system)
+ (arguments
+ (list #:install-plan #~'(("rrrs2txi.scm" "lib/"))))
+ (home-page "https://people.csail.mit.edu/jaffer/Scheme.html")
+ (synopsis "Translate LaTeX sources r3rs, r4rs, and r5rs to texinfo")
+ (description
+ "This package provides @code{rrrs2txi.scm}, which
+translates the LaTeX r3rs, r4rs, and r5rs to texinfo format (r3rs.txi,
+r4rs.txi, and r5rs.txi).")
+ (license license:bsd-3)))
--
2.38.1
A
A
Antero Mejr wrote on 31 Mar 2023 05:36
[PATCH 2/3] teams: Add book team.
(address . 62554@debbugs.gnu.org)
20230331033621.28190-2-antero@mailbox.org
* etc/teams.scm.in (book): New team.
---
etc/teams.scm.in | 6 ++++++
1 file changed, 6 insertions(+)

Toggle diff (19 lines)
diff --git a/etc/teams.scm.in b/etc/teams.scm.in
index 4c95c48543..cce6293dc7 100644
--- a/etc/teams.scm.in
+++ b/etc/teams.scm.in
@@ -463,6 +463,12 @@ (define-team lxqt
#:description "LXQt desktop environment."
#:scope (list "gnu/packages/lxqt.scm")))
+(define-team book
+ (team 'book
+ #:name "Book team"
+ #:description "Books and documentation."
+ #:scope (list (make-regexp "^gnu/packages/book(-.+|)\\.scm$"))))
+
(define-member (person "Eric Bavier"
"bavier@posteo.net")
--
2.38.1
A
A
Antero Mejr wrote on 31 Mar 2023 05:36
[PATCH 3/3] teams: Add Antero Mejr.
(address . 62554@debbugs.gnu.org)
20230331033621.28190-3-antero@mailbox.org
* etc/teams.scm.in: Add Antero Mejr.
---
etc/teams.scm.in | 4 ++++
1 file changed, 4 insertions(+)

Toggle diff (17 lines)
diff --git a/etc/teams.scm.in b/etc/teams.scm.in
index cce6293dc7..f7cf20067f 100644
--- a/etc/teams.scm.in
+++ b/etc/teams.scm.in
@@ -578,6 +578,10 @@ (define-member (person "Zhu Zihao"
"all_but_last@163.com")
localization xfce)
+(define-member (person "Antero Mejr"
+ "antero@mailbox.org")
+ book)
+
(define (find-team name)
(or (hash-ref %teams (string->symbol name))
--
2.38.1
?
Re: bug#62554: [PATCH] gnu: Add book-r5rs.
(name . Antero Mejr)(address . antero@mailbox.org)(address . 62554@debbugs.gnu.org)
878rf1k3yl.fsf@envs.net
Antero Mejr <antero@mailbox.org> writes:

Toggle quote (9 lines)
> * gnu/packages/book-software.scm (book-r5rs): New variable.
> ---
> Please apply this patch last.
> This patch is for the R5RS spec document, in PDF and Info formats.
> Not sure what conventions would work best, but here I used:
> 1. package definitions for books/documents go into the file
> "book-[type].scm".
> 2. package definition names are formatted "book-[shortname]".

Good idea, I'll rename 'faif' to 'book-faif' later.

Toggle quote (4 lines)
> I would be interested to hear what others think about books in Guix.
> Would we want to limit to technical books? What about translations?
> Has this already been proposed somewhere?

I don't know any former proposed/discussion. Well I'd like to also
include translations, eg:



For non-technical books, maybe math books? eg:


I'm not sure though, due to lack of confidence to make a judge...
A
A
Antero Mejr wrote on 18 Apr 2023 03:30
(name . ???)(address . iyzsong@envs.net)(address . 62554@debbugs.gnu.org)
87r0sigenk.fsf@mailbox.org
??? <iyzsong@envs.net> writes:

Toggle quote (8 lines)
>> This patch is for the R5RS spec document, in PDF and Info formats.
>> Not sure what conventions would work best, but here I used:
>> 1. package definitions for books/documents go into the file
>> "book-[type].scm".
>> 2. package definition names are formatted "book-[shortname]".
>
> Good idea, I'll rename 'faif' to 'book-faif' later.

Do you think it would be a good idea to install the files to
/share/doc/[shortname]/, or just /share/doc/? I used the first one to
avoid cluttering /share/doc/, or maybe for organization purposes if a
book is split into multiple files. But I can update this patch to use
/share/doc/ if you disagree.

Toggle quote (10 lines)
>> I would be interested to hear what others think about books in Guix.
>> Would we want to limit to technical books? What about translations?
>> Has this already been proposed somewhere?
>
> I don't know any former proposed/discussion. Well I'd like to also
> include translations, eg:
>
> https://github.com/lifanxi/free-as-in-freedom-zh-cn
> https://github.com/beijinglug/fsfs-zh

Sounds good to me.

Toggle quote (6 lines)
> For non-technical books, maybe math books? eg:
>
> https://discrete.openmathbooks.org/dmoi3.html
>
> I'm not sure though, due to lack of confidence to make a judge...

I would definitely want math books. I would be OK with any non-fiction
work so long as it can be typeset from source and is freely licensed,
but then there might be a lot of book packages.
?
Your comment

Commenting via the web interface is currently disabled.

To comment on this conversation send an email to 62554@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 62554
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch