unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: "Artyom V. Poptsov" <poptsov.artyom@gmail.com>
To: 73841@debbugs.gnu.org
Cc: "Artyom V. Poptsov" <poptsov.artyom@gmail.com>
Subject: [bug#73841] [PATCH] gnu: book-sparc: Update to 2.2.0.
Date: Wed, 16 Oct 2024 23:35:23 +0300	[thread overview]
Message-ID: <328a2d40fa5843b6e5d2dda1a2bfa78576e603e2.1729110923.git.poptsov.artyom@gmail.com> (raw)

* gnu/packages/books.scm (book-sparc): Update to 2.2.0.
[inputs]: Add git, gnu-make, texlive-fancyvrb, and texlive-upquote.
[native-inputs]: Add autoconf and automake.

Change-Id: Icd19f295b8572428aea39f46c27e22f87d5dc7e1
---
 gnu/packages/books.scm | 62 +++++++++++++++++++++++++-----------------
 1 file changed, 37 insertions(+), 25 deletions(-)

diff --git a/gnu/packages/books.scm b/gnu/packages/books.scm
index 5a6157d557..9f680b51e2 100644
--- a/gnu/packages/books.scm
+++ b/gnu/packages/books.scm
@@ -42,7 +42,7 @@ (define-module (gnu packages books)
 (define-public book-sparc
   (package
     (name "book-sparc")
-    (version "2.1.0")
+    (version "2.2.0")
     (source (origin
               (method git-fetch)
               (uri (git-reference
@@ -50,24 +50,14 @@ (define-public book-sparc
                     (commit (string-append "v" version))))
               (sha256
                (base32
-                "1ns2vs5yb9z1hj9gq5y55qz7c9azzhr866b665s8fq50q5m4yhbc"))
+                "08aswb6cb02c0yqpkyj4vmfjvdjsffxqcqabivgv2gcgn8mhi4wm"))
               (file-name (git-file-name name version))
-              (modules '((guix build utils)))
-              (snippet
-               #~(begin
-                   (substitute* "version.tex.in"
-                     (("@COMMIT@") ""))
-                   (substitute* "Makefile"
-                     (("all: sparc.pdf") "all: install")
-                     (("^sparc.pdf:") "install:")
-                     (("(cp out/sparc.pdf) sparc.pdf" all cp)
-                      (string-append
-                       "mkdir -p $(DESTDIR)$(PREFIX)/share/doc/book-sparc"
-                       " && " cp
-                       " $(DESTDIR)$(PREFIX)/share/doc/book-sparc/sparc.pdf")))))))
+              (modules '((guix build utils)))))
     (build-system gnu-build-system)
     (native-inputs
-     (list bash-minimal
+     (list autoconf
+           automake
+           bash-minimal
            fontconfig
            inkscape
            lilypond
@@ -76,6 +66,8 @@ (define-public book-sparc
            which))
     (inputs
      (list font-liberation
+           git
+           gnu-make
            texlive-acronym
            texlive-adjustbox
            texlive-biblatex
@@ -85,6 +77,7 @@ (define-public book-sparc
            texlive-chngcntr
            texlive-circuitikz
            texlive-collection-langcyrillic
+           texlive-fancyvrb
            texlive-fontspec
            texlive-glossaries
            texlive-glossaries-english
@@ -101,16 +94,35 @@ (define-public book-sparc
            texlive-textpos
            texlive-transparent
            texlive-trimspaces
+           texlive-upquote
            texlive-xetex))
-    (arguments
-     (list #:phases
-           #~(modify-phases %standard-phases
-               (delete 'check)
-               (delete 'configure)
-               (add-before 'build 'set-envs
-                 (lambda _
-                   (setenv "REPRODUCIBILITY" "yes")
-                   (setenv "PREFIX" #$output))))))
+   (arguments
+    (list #:tests? #f                   ; no tests
+          #:phases #~(modify-phases %standard-phases
+                       (add-before 'build 'configure-environment
+                         (lambda* (#:key inputs make-flags parallel-build?
+                                   #:allow-other-keys)
+                           (use-modules (ice-9 regex)
+                                        (srfi srfi-1))
+                           (let* ((src (assoc-ref inputs "source"))
+                                  (rx  (make-regexp "/gnu/store/(.*)-book-sparc-.*"))
+                                  (src-hash (match:substring (regexp-exec rx src) 1))
+                                  (random-seed
+                                   (fold (lambda (ch prev)
+                                           (+ (char->integer ch)
+                                              prev))
+                                         0
+                                         (string->list src-hash))))
+                             (setenv "RANDOMSEED" (number->string random-seed))
+                             (setenv "REPRODUCIBILITY" "yes"))))
+                       (replace 'install
+                         (lambda _
+                           (let ((doc-dir (string-append #$output
+                                                         "/share/doc/sparc/")))
+                             (mkdir-p doc-dir)
+                             (copy-file "sparc.pdf"
+                                        (string-append doc-dir
+                                                       "sparc.pdf"))))))))
     (home-page "https://github.com/artyom-poptsov/SPARC")
     (synopsis "Book on combining art and technology")
     (description

base-commit: d95588242c605fbb72e25fe36a0903a1538e9018
-- 
2.46.0





                 reply	other threads:[~2024-10-16 20:36 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=328a2d40fa5843b6e5d2dda1a2bfa78576e603e2.1729110923.git.poptsov.artyom@gmail.com \
    --to=poptsov.artyom@gmail.com \
    --cc=73841@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).