-
Notifications
You must be signed in to change notification settings - Fork 1
/
guix.scm
146 lines (136 loc) · 5 KB
/
guix.scm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
;; guix.scm --- GNU Guix package recipe -*- coding: utf-8 -*-
;;
;; Copyright (C) 2022-2024 Artyom V. Poptsov <poptsov.artyom@gmail.com>
;;
;; Author: Artyom V. Poptsov <poptsov.artyom@gmail.com>
;; Created: 17 November 2022
;;
;; This program 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.
;;
;; The program 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 the program. If not, see <http://www.gnu.org/licenses/>.
;;; Commentary:
;;
;; GNU Guix development package. To use as the basis for a development
;; environment, run:
;;
;; guix shell -D -f ./guix.scm
;;
;; In the new shell, run:
;;
;; make
;;
;;; Code:
(use-modules (guix gexp)
(guix packages)
(guix licenses)
(guix git-download)
(guix build-system gnu)
(gnu packages autotools)
(gnu packages base)
(gnu packages bash)
(gnu packages tex)
(gnu packages texlive)
(gnu packages inkscape)
(gnu packages fonts)
(gnu packages perl)
(gnu packages python-xyz)
(gnu packages version-control)
(gnu packages fontutils)
(gnu packages music))
(define %source-dir (dirname (current-filename)))
(define-public book-sparc
(package
(name "book-sparc")
(version "git")
(source (local-file %source-dir
#:recursive? #t
#:select? (git-predicate %source-dir)))
(build-system gnu-build-system)
(native-inputs
(list autoconf
automake
python-pygments
bash-minimal
perl
which
fontconfig))
(inputs
(list font-liberation
git
gnu-make
inkscape
lilypond
texlive-fancyvrb
texlive-fontspec
texlive-koma-script
texlive-trimspaces
texlive-acronym
texlive-adjustbox
texlive-bibtex
texlive-biblatex
texlive-bibtexperllibs
texlive-bigfoot
texlive-circuitikz
texlive-collection-langcyrillic
texlive-glossaries
texlive-glossaries-english
texlive-glossaries-extra
texlive-lilyglyphs
texlive-chngcntr
texlive-minted
texlive-multirow
texlive-pgf
texlive-pgfplots
texlive-subfiles
texlive-svg
texlive-t1utils
texlive-textpos
texlive-transparent
texlive-upquote
texlive-xetex))
(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/(.*)-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
"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 cc-by-sa4.0)))
book-sparc
;;; guix.scm ends here.