aboutsummaryrefslogtreecommitdiff
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2023, 2024 Artyom V. Poptsov <poptsov.artyom@gmail.com>
;;; Copyright © 2023 Adam Faiz <adam.faiz@disroot.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 books)
  #:use-module ((guix licenses) #:prefix license:)
  #:use-module (guix build-system gnu)
  #:use-module (guix download)
  #:use-module (guix gexp)
  #:use-module (guix git-download)
  #:use-module (guix packages)
  #:use-module (guix utils)
  #:use-module (gnu packages)
  #:use-module (gnu packages autotools)
  #:use-module (gnu packages base)
  #:use-module (gnu packages bash)
  #:use-module (gnu packages fonts)
  #:use-module (gnu packages fontutils)
  #:use-module (gnu packages inkscape)
  #:use-module (gnu packages music)
  #: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))

(define-public book-sparc
  (package
    (name "book-sparc")
    (version "2.3.0")
    (source (origin
              (method git-fetch)
              (uri (git-reference
                    (url "https://github.com/artyom-poptsov/SPARC")
                    (commit (string-append "v" version))))
              (sha256
               (base32
                "1kvspfp3z4z5laghrjr7my6nr8877myjiafbra2jrg3f42c5a4fl"))
              (file-name (git-file-name name version))
              (modules '((guix build utils)))))
    (build-system gnu-build-system)
    (native-inputs
     (list autoconf
           automake
           bash-minimal
           fontconfig
           inkscape
           lilypond
           perl
           python-pygments
           which))
    (inputs
     (list font-liberation
           git
           texlive-acronym
           texlive-adjustbox
           texlive-biblatex
           texlive-bibtex
           texlive-bibtexperllibs
           texlive-bigfoot
           texlive-chngcntr
           texlive-circuitikz
           texlive-collection-langcyrillic
           texlive-fancyvrb
           texlive-fontspec
           texlive-glossaries
           texlive-glossaries-english
           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-upquote
           texlive-xetex))
   (arguments
    (list #:tests? #f                   ; no tests
          #:modules (append %default-gnu-imported-modules
                            '((ice-9 regex)
                              (srfi srfi-1)))
          #:phases #~(modify-phases %standard-phases
                       (add-before 'build 'configure-environment
                         (lambda* (#:key inputs make-flags parallel-build?
                                   #:allow-other-keys)
                           (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/")))
                             (install-file "sparc.pdf" doc-dir)))))))
    (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 mentioned 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)))
pe]: Add case for using unformatted partition uuid. 2022-12-26image: Enhance compatibility of the root ext4 partition.Maxim Cournoyer Generating a raw-with-offset image would previously not be bootable with U-Boot. * gnu/system/image.scm (root-partition) [file-system-options]: New field. 2022-12-06image: Clarify comment.Ludovic Courtès * gnu/system/image.scm: Adjust comment. 2022-11-04system: image: Define correct docker image arch when cross buildingThiago Jung Bauermann Cross-building a docker image with: $ guix system image --image-type=docker --target=aarch64-linux-gnu os.scm results in an image where the architecture declared in its config.json is the host architecture rather than the target one. The binaries are correctly cross-compiled, so the image can be loaded and used despite the warning message shown by docker: $ docker load -i vcal7bvsqcijchifhqdvprpd1niqh8sk-docker-image.tar.gz Loaded image: guix:latest $ docker create guix:latest WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested 40f06aa869ed690489c4a3824a7f7721bd4bf453b85f25ac7199266939fe2fba $ echo $? 0 This is fixed by passing the correct triplet to the build-docker-image function. * gnu/system/image.scm (system-docker-image) Add ‘image-target’ variable. [builder]: Pass ‘#:system’ argument to ‘build-docker-image’. Signed-off-by: Mathieu Othacehe <othacehe@gnu.org> 2022-09-25system: images: Add a TODO comment.Mathieu Othacehe * gnu/system/image.scm (system-tarball-image): Add it. 2022-09-24system: image: Add wsl2 support.Alex Griffin * gnu/image.scm (<image>)[format]: Add wsl2 support. * gnu/system/image.scm (wsl2-image, wsl2-image-type): New variables. (image->root-file-system): Add wsl2 image support. (system-image): Ditto. 2022-09-24system: image: Add tarball support.Alex Griffin * gnu/image.scm (<image>)[fields]: Add tarball to the supported formats. * gnu/system/image.scm (tarball-image, tarball-image-type): New variables. (system-tarball-image): New procedure. (image->root-file-system): Add tarball image support. (system-image): Ditto. * doc/guix.texi ("System Images"): Document it. Signed-off-by: Mathieu Othacehe <othacehe@gnu.org> 2022-09-24image: Make the operating-system field mandatory.Mathieu Othacehe Make the operating-system field mandatory as creating an image without it makes no sense. Introduce a new macro, image-without-os for the specific cases where the image is only created to be inherited from afterwards. * gnu/image.scm (<image>)[operating-system]: Make it mandatory. * gnu/system/image.scm (image-without-os): New macro. (efi-disk-image, efi32-disk-image, iso9660-image, docker-image, raw-with-offset-disk-image): Use it. * gnu/system/images/hurd.scm (hurd-disk-image): Ditto. 2022-09-07system: image: Update my copyright.Mathieu Othacehe * gnu/system/image.scm: Update it. 2022-09-07system: image: Remove an unused variable.Mathieu Othacehe * gnu/system/image.scm (sytem-image): Remove it. 2022-07-01image: Raise an error when an image lacks a bootable partition.Ludovic Courtès * gnu/system/image.scm (find-root-partition): Raise an error when 'find' returns #f. 2022-07-01image: Avoid use of the deprecated 'gpt' option of genimage.Ludovic Courtès * gnu/system/image.scm (system-disk-image)[genimage-type-options]: Use 'partition-table-type' instead of the deprecated 'gpt' option. 2022-07-01image: Add default value for partition initializer.Ludovic Courtès Previously, the default value would lead to a wrong-type-to-apply crash. * gnu/system/image.scm (system-disk-image)[image-builder]: When 'partition-initializer' returns #f, fall back to INITIALIZE-ROOT-PARTITION. * gnu/tests/base.scm (run-root-unmount-test)[test-image]: Remove 'initializer' field of partition. * gnu/image.scm (<partition>)[initializer]: Add comment. 2022-07-01image: 'system-image' throws when given an incorrect image format.Ludovic Courtès Previously 'system-image' would return *unspecified* in that case, leading to a wrong-type-arg error crash down the road. * gnu/system/image.scm (system-image): Add 'else' clause. 2022-06-24image: Add support for 32bit UEFI.Denis 'GNUtoo' Carikli * gnu/bootloader/grub.scm (grub-efi32-bootloader): New variable. (install-grub-efi32): New variable. * gnu/build/bootloader.scm (install-efi): Add a 'targets' keyword argument. (install-efi-loader): Likewise. * gnu/build/image.scm (initialize-efi32-partition): New procedure. * gnu/packages/bootloaders.scm (grub-efi32): New variable. * gnu/system/image.scm (esp32-partition): New variable (efi32-disk-image): New variable. (efi32-raw-image-type): New variable. (system-disk-image)[partition-image]: Set '#:grub-efi32' when calling the partition initializer. Signed-off-by: Mathieu Othacehe <othacehe@gnu.org> 2022-05-31image: Add fat32 support.Pavel Shlyak * gnu/build/image.scm (make-vfat-image): Pass fs-bits as an argument and force 1kb logical sector size only if "ESP" flag is set. (make-partition-image): Add "fat32" partition type, support explicit "fat16" type with vfat alias. * gnu/system/image.scm (partition->dos-type partition): Return file system IDs for "fat16" and "fat32" partitions. (partition->gpt-type partition): Ditto. Signed-off-by: Mathieu Othacehe <othacehe@gnu.org> 2022-05-25Move (gnu platform) and (gnu platforms ...) to guix/.Josselin Poiret * gnu/platform.scm: * gnu/platforms/arm.scm: * gnu/platforms/hurd.scm: * gnu/platforms/mips.scm: * gnu/platforms/powerpc.scm: * gnu/platforms/riscv.scm: * gnu/platforms/s390.scm: * gnu/platforms/x86.scm: Move to guix/. * Makefile.am: * doc/guix.texi (Porting to a New Platform): * etc/release-manifest.scm: * gnu/ci.scm: * gnu/image.scm: * gnu/local.mk: * gnu/packages/bioinformatics.scm: * gnu/packages/bootstrap.scm: * gnu/packages/cross-base.scm: * gnu/packages/instrumentation.scm: * gnu/packages/linux.scm: * gnu/system/image.scm: * gnu/system/images/hurd.scm: * gnu/system/images/novena.scm: * gnu/system/images/pine64.scm: * gnu/system/images/pinebook-pro.scm: * gnu/system/images/rock64.scm: * guix/scripts/build.scm: * guix/scripts/system.scm: * guix/self.scm: Update (gnu platform...) to (guix platform...). Signed-off-by: Mathieu Othacehe <othacehe@gnu.org> 2022-05-23image: Add bootable flag support.Pavel Shlyak * gnu/build/image.scm (sexp->partition): Add flags support. * gnu/system/image.scm (partition->gexp): Ditto. (system-disk-image): Set the genimage bootable flag if it is part of the partition flags. Signed-off-by: Mathieu Othacehe <othacehe@gnu.org> 2022-05-23system: image: Support GPT vfat partitions.Pavel Shlyak * gnu/system/image.scm (system-disk-image): Support them. Signed-off-by: Mathieu Othacehe <othacehe@gnu.org> 2022-05-23system: image: Support MBR vfat partitions.Pavel Shlyak * gnu/system/image.scm (system-disk-image): Support them. Signed-off-by: Mathieu Othacehe <othacehe@gnu.org> 2022-05-23system: image: Tweak error message.Mathieu Othacehe * gnu/system/image.scm (system-disk-image): Tweak it. 2022-05-23system: image: Fix indentation.Mathieu Othacehe * gnu/system/image.scm: Fix it. 2021-12-23system: image: Add docker support.Mathieu Othacehe * gnu/system/image.scm (docker-image, docker-image-type): New variables. (system-docker-image): New procedure. (image->root-file-system): Add docker image support. (system-image): Ditto. 2021-11-12image: Support generating GPT images via `partition-table-type`.Ryan Sundberg * gnu/image.scm (<image>)[partition-table-type]: New field. * gnu/system/image.scm: Implement partition-table-type logic for genimage. Signed-off-by: Mathieu Othacehe <othacehe@gnu.org> 2021-10-11gnu: Add platform support.Mathieu Othacehe * gnu/platform.scm: New file. * gnu/platforms/arm.scm: Ditto. * gnu/platforms/hurd.scm: Ditto. * gnu/local.mk (GNU_SYSTEM_MODULES): Add them. Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>