From 5967c109c2b224b4aaf7e8480816814c421c01b3 Mon Sep 17 00:00:00 2001 Message-ID: <5967c109c2b224b4aaf7e8480816814c421c01b3.1693581197.git.adam.faiz@disroot.org> From: "Artyom V. Poptsov" Date: Thu, 31 Aug 2023 20:11:29 +0300 Subject: [PATCH v1] gnu: books: Add book-sparc. * gnu/packages/books.scm: New module. * gnu/local.mk (GNU_SYSTEM_MODULES): Add 'books.scm'. Co-authored-by: Adam Faiz --- gnu/local.mk | 1 + gnu/packages/books.scm | 120 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 121 insertions(+) create mode 100644 gnu/packages/books.scm diff --git a/gnu/local.mk b/gnu/local.mk index 1773ef6f61..0720bcfdd3 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -153,6 +153,7 @@ GNU_SYSTEM_MODULES = \ %D%/packages/bioinformatics.scm \ %D%/packages/bittorrent.scm \ %D%/packages/bison.scm \ + %D%/packages/books.scm \ %D%/packages/boost.scm \ %D%/packages/bootloaders.scm \ %D%/packages/bootstrap.scm \ diff --git a/gnu/packages/books.scm b/gnu/packages/books.scm new file mode 100644 index 0000000000..97a7e3b45c --- /dev/null +++ b/gnu/packages/books.scm @@ -0,0 +1,120 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2023 Artyom V. Poptsov +;;; Copyright © 2023 Adam Faiz +;;; +;;; 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 . + +(define-module (gnu packages books) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (guix utils) + #:use-module (guix gexp) + #:use-module (guix download) + #:use-module (guix git-download) + #:use-module (guix packages) + #:use-module (guix build-system gnu) + #:use-module (gnu packages) + #:use-module (gnu packages autotools) + #:use-module (gnu packages base) + #:use-module (gnu packages bash) + #:use-module (gnu packages music) + #:use-module (gnu packages inkscape) + #:use-module (gnu packages perl) + #:use-module (gnu packages python-xyz) + #:use-module (gnu packages tex) + #:use-module (gnu packages texlive) + #:use-module (gnu packages version-control) + #:use-module (gnu packages fonts) + #:use-module (gnu packages fontutils)) + +(define-public book-sparc + (package + (name "book-sparc") + (version "1.0.1") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/artyom-poptsov/SPARC") + (commit (string-append "v" version)))) + (sha256 + (base32 + "0dswwwkb3h88cl3mhiy79s8i7sa9lmw6fxaj782vxgif795lcpxs")) + (file-name (git-file-name name version)) + (modules '((guix build utils))) + (snippet + #~(begin + (delete-file "sparc.pdf") + (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"))))))) + (build-system gnu-build-system) + (native-inputs + (list bash-minimal + fontconfig + inkscape + lilypond + perl + python-pygments + which)) + (inputs + (list font-liberation + texlive-acronym + texlive-adjustbox + texlive-bibtex + texlive-bibtexperllibs + texlive-bigfoot + texlive-circuitikz + texlive-collection-langcyrillic + texlive-fontspec + texlive-glossaries + texlive-glossaries-extra + texlive-koma-script + texlive-lilyglyphs + texlive-minted + texlive-multirow + texlive-pgf + texlive-pgfplots + texlive-subfiles + texlive-svg + texlive-t1utils + texlive-textpos + texlive-transparent + texlive-trimspaces + 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)))))) + (home-page "https://github.com/artyom-poptsov/SPARC") + (synopsis "Book on combining art and technology") + (description + "Science, Programming, Art and Radioelectronics Club (SPARC) is a book that +explains how to combine the topics mentined in the title to build projects. The +book can be used to teach programming classes in colleges and to organize +workshops in hackerspaces or other community-driven spaces. Currently the book +is available only in Russian.") + (license license:cc-by-sa4.0))) base-commit: 4e531e55dcdc99c83bcfe3eec67c3fd95c7b6ca7 -- 2.41.0