-
Notifications
You must be signed in to change notification settings - Fork 0
/
chil-package.scm
133 lines (127 loc) · 4.51 KB
/
chil-package.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
;;; CHIL --- Constructing Hardware in Lisp
;;; Copyright © 2023 Karl Hallsby <karl@hallsby.com>
;;;
;;; This file is part of CHIL.
;;;
;;; CHIL 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.
;;;
;;; CHIL 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 CHIL. If not, see <http://www.gnu.org/licenses/>.
;;; Commentary:
;;
;; GNU Guix development package. To build and install, run:
;;
;; guix package -f guix.scm
;;
;; To use as the basis for a development environment, run:
;;
;; guix shell -D -f guix.scm
;;
;;; Code:
(define-module (chil-package)
#:use-module (ice-9 popen) ;; These first packages are needed to build guix.scm description
#:use-module (ice-9 rdelim)
#:use-module ((guix build utils) #:select (with-directory-excursion))
;; Stuff to build the package
#:use-module (guix packages)
#:use-module (guix licenses)
#:use-module (guix utils)
#:use-module (guix gexp)
#:use-module (guix git-download)
#:use-module (guix build-system asdf)
#:use-module (gnu packages)
#:use-module (gnu packages autotools)
#:use-module (gnu packages texinfo)
#:use-module (gnu packages lisp)
#:use-module (gnu packages lisp-xyz)
#:use-module (gnu packages lisp-check))
(define vcs-file?
;; Return true if the given file is under version control.
(or (git-predicate (string-append (current-source-directory) "/../.."))
(const #t)))
(define-public chil
(package
(name "chil")
(version "0.1")
(source (local-file "../.." "chil-checkout"
#:recursive? #t
#:select? vcs-file?))
(native-inputs
(list autoconf automake texinfo ;; Building the manual
cl-lisp-unit2
cl-log4cl
sbcl))
(inputs
(list cl-alexandria
cl-slime-swank
cl-slynk
cl-ppcre
cl-trivia
cl-check-it))
(build-system asdf-build-system/sbcl)
;; (build-system asdf-build-system/source) ;; Maybe use this?
(arguments
(list
#:phases
#~(modify-phases %standard-phases
(add-after 'check 'install-manual
(lambda* (#:key (configure-flags '()) (make-flags '()) outputs
#:allow-other-keys)
(let* ((out (assoc-ref outputs "out"))
(info (string-append out "/share/info")))
(invoke "./bootstrap")
(apply invoke "sh" "./configure" "SHELL=sh" configure-flags)
(apply invoke "make" "info" make-flags)
(install-file "doc/chil.info" info)))))))
(synopsis "Constructing Hardware in Lisp")
(description "CHIL (Constructing Hardware in Lisp)")
(home-page "http://github.com/KarlJoad/chil")
(license gpl3+)))
(define-public ecl-chil
(package
(name "ecl-chil")
(version "0.1")
(source (local-file "../.." "chil-checkout"
#:recursive? #t
#:select? vcs-file?))
(native-inputs
(list autoconf automake texinfo ;; Building the manual
cl-lisp-unit2
cl-log4cl
ecl))
(inputs
(list cl-alexandria
cl-slime-swank
cl-slynk
cl-ppcre
cl-trivia
cl-check-it))
(build-system asdf-build-system/ecl)
;; (build-system asdf-build-system/source) ;; Maybe use this?
(arguments
(list
#:phases
#~(modify-phases %standard-phases
(add-after 'check 'install-manual
;; FIXME: Replace bare ecl with actual ecl path in inputs
(lambda* (#:key (configure-flags '("--with-lisp=ecl")) (make-flags '()) outputs
#:allow-other-keys)
(let* ((out (assoc-ref outputs "out"))
(info (string-append out "/share/info")))
(invoke "./bootstrap")
(apply invoke "sh" "./configure" "SHELL=sh" configure-flags)
(apply invoke "make" "info" make-flags)
(install-file "doc/chil.info" info)))))))
(synopsis "Constructing Hardware in Lisp")
(description "CHIL (Constructing Hardware in Lisp)")
(home-page "http://github.com/KarlJoad/chil")
(license gpl3+)))
chil