1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2017 Arun Isaac <arunisaac@systemreboot.net>
4 ;;; This file is part of GNU Guix.
6 ;;; GNU Guix is free software; you can redistribute it and/or modify it
7 ;;; under the terms of the GNU General Public License as published by
8 ;;; the Free Software Foundation; either version 3 of the License, or (at
9 ;;; your option) any later version.
11 ;;; GNU Guix is distributed in the hope that it will be useful, but
12 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
13 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 ;;; GNU General Public License for more details.
16 ;;; You should have received a copy of the GNU General Public License
17 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
19 (define-module (guix build-system font)
20 #:use-module (guix utils)
21 #:use-module (guix packages)
22 #:use-module (guix derivations)
23 #:use-module (guix search-paths)
24 #:use-module (guix build-system)
25 #:use-module (guix build-system gnu)
26 #:use-module (ice-9 match)
27 #:export (%font-build-system-modules
33 ;; Standard build procedure for fonts. This is implemented as an extension of
34 ;; 'gnu-build-system'.
38 (define %font-build-system-modules
39 ;; Build-side modules imported by default.
40 `((guix build font-build-system)
41 ,@%gnu-build-system-modules))
44 #:key source inputs native-inputs outputs system target
47 "Return a bag for NAME."
48 (define private-keywords
49 '(#:target #:inputs #:native-inputs))
54 (host-inputs `(,@(if source
58 ,(list "tar" (module-ref (resolve-interface '(gnu packages base)) 'tar))
59 ,@(let ((compression (resolve-interface '(gnu packages compression))))
62 (list name (module-ref compression package))))
67 (build-inputs native-inputs)
70 (arguments (strip-keyword-arguments private-keywords arguments))))
72 (define* (font-build store name inputs
76 (configure-flags ''())
77 (phases '(@ (guix build font-build-system)
81 (system (%current-system))
83 (imported-modules %font-build-system-modules)
84 (modules '((guix build font-build-system)
86 "Build SOURCE with INPUTS."
89 (use-modules ,@modules)
90 (font-build #:name ,name
91 #:source ,(match (assoc-ref inputs "source")
92 (((? derivation? source))
93 (derivation->output-path source))
98 #:configure-flags ,configure-flags
100 #:test-target ,test-target
104 #:search-paths ',(map search-path-specification->sexp
106 #:inputs %build-inputs)))
108 (define guile-for-build
111 (package-derivation store guile system #:graft? #f))
113 (let* ((distro (resolve-interface '(gnu packages commencement)))
114 (guile (module-ref distro 'guile-final)))
115 (package-derivation store guile system #:graft? #f)))))
117 (build-expression->derivation store name builder
120 #:modules imported-modules
122 #:guile-for-build guile-for-build))
124 (define font-build-system
127 (description "The build system for font packages")
130 ;;; font.scm ends here