Commit | Line | Data |
---|---|---|
0193c004 | 1 | ;;; GNU Guix --- Functional package management for GNU |
8df672aa | 2 | ;;; Copyright © 2014, 2015, 2016, 2017 Manolis Fragkiskos Ragkousis <manolis837@gmail.com> |
0193c004 MR |
3 | ;;; |
4 | ;;; This file is part of GNU Guix. | |
5 | ;;; | |
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. | |
10 | ;;; | |
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. | |
15 | ;;; | |
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/>. | |
18 | ||
19 | (define-module (gnu packages hurd) | |
20 | #:use-module (guix licenses) | |
21 | #:use-module (guix download) | |
22 | #:use-module (guix packages) | |
21a8fe1b | 23 | #:use-module (gnu packages) |
e1ecd50e | 24 | #:use-module (guix utils) |
396b3c8b | 25 | #:use-module (guix build-system gnu) |
38efbcbb | 26 | #:use-module (guix build-system trivial) |
396b3c8b | 27 | #:use-module (gnu packages flex) |
dc91c10f MR |
28 | #:use-module (gnu packages bison) |
29 | #:use-module (gnu packages perl) | |
21a8fe1b | 30 | #:use-module (gnu packages base) |
62596a15 MR |
31 | #:use-module (guix git-download) |
32 | #:export (hurd-triplet?)) | |
33 | ||
34 | (define (hurd-triplet? triplet) | |
35 | (and (string-suffix? "-gnu" triplet) | |
36 | (not (string-contains triplet "linux")))) | |
0193c004 | 37 | |
41bfcac3 MR |
38 | (define (gnumach-source-url version) |
39 | (string-append "mirror://gnu/gnumach/gnumach-" | |
40 | version ".tar.gz")) | |
41 | ||
b005a37a MR |
42 | (define (hurd-source-url version) |
43 | (string-append "mirror://gnu/hurd/hurd-" | |
44 | version ".tar.gz")) | |
45 | ||
0193c004 MR |
46 | (define-public gnumach-headers |
47 | (package | |
48 | (name "gnumach-headers") | |
d950f038 | 49 | (version "1.8") |
0193c004 MR |
50 | (source |
51 | (origin | |
52 | (method url-fetch) | |
41bfcac3 | 53 | (uri (gnumach-source-url version)) |
0193c004 MR |
54 | (sha256 |
55 | (base32 | |
d950f038 | 56 | "02hygsfpd2dljl5lg1vjjg9pizi9jyxd4aiiqzjshz6jax62jm9f")))) |
0193c004 MR |
57 | (build-system gnu-build-system) |
58 | (arguments | |
dc1d3cde KK |
59 | `(#:phases |
60 | (modify-phases %standard-phases | |
61 | (replace 'install | |
62 | (lambda _ | |
2057ea68 | 63 | (invoke "make" "install-data"))) |
dc1d3cde | 64 | (delete 'build)) |
0193c004 MR |
65 | |
66 | ;; GNU Mach supports only IA32 currently, so cheat so that we can at | |
67 | ;; least install its headers. | |
26a28c8a MR |
68 | ,@(if (%current-target-system) |
69 | '() | |
70 | ;; See <http://lists.gnu.org/archive/html/bug-hurd/2015-06/msg00042.html> | |
71 | ;; <http://lists.gnu.org/archive/html/guix-devel/2015-06/msg00716.html> | |
72 | '(#:configure-flags '("--build=i586-pc-gnu"))) | |
0193c004 MR |
73 | |
74 | #:tests? #f)) | |
75 | (home-page "https://www.gnu.org/software/hurd/microkernel/mach/gnumach.html") | |
76 | (synopsis "GNU Mach kernel headers") | |
77 | (description | |
78 | "Headers of the GNU Mach kernel.") | |
79 | (license gpl2+))) | |
396b3c8b MR |
80 | |
81 | (define-public mig | |
82 | (package | |
83 | (name "mig") | |
9c9402be | 84 | (version "1.8") |
396b3c8b MR |
85 | (source |
86 | (origin | |
87 | (method url-fetch) | |
88 | (uri (string-append "mirror://gnu/mig/mig-" | |
89 | version ".tar.gz")) | |
90 | (sha256 | |
91 | (base32 | |
9c9402be | 92 | "1gyda8sq6b379nx01hkpbd85lz39irdvz2b9wbr63gicicx8i706")))) |
396b3c8b | 93 | (build-system gnu-build-system) |
a7ecc92d MR |
94 | ;; Flex is needed both at build and run time. |
95 | (inputs `(("gnumach-headers" ,gnumach-headers) | |
96 | ("flex" ,flex))) | |
396b3c8b MR |
97 | (native-inputs |
98 | `(("flex" ,flex) | |
99 | ("bison" ,bison))) | |
100 | (arguments `(#:tests? #f)) | |
6fd52309 | 101 | (home-page "https://www.gnu.org/software/hurd/microkernel/mach/mig/gnu_mig.html") |
396b3c8b MR |
102 | (synopsis "Mach 3.0 interface generator for the Hurd") |
103 | (description | |
104 | "GNU MIG is the GNU distribution of the Mach 3.0 interface generator | |
105 | MIG, as maintained by the GNU Hurd developers for the GNU project. | |
106 | You need this tool to compile the GNU Mach and GNU Hurd distributions, | |
35b9e423 | 107 | and to compile the GNU C library for the Hurd. Also, you will need it |
396b3c8b MR |
108 | for other software in the GNU system that uses Mach-based inter-process |
109 | communication.") | |
110 | (license gpl2+))) | |
dc91c10f MR |
111 | |
112 | (define-public hurd-headers | |
113 | (package | |
114 | (name "hurd-headers") | |
be6a70ed | 115 | (version "0.9") |
dc91c10f MR |
116 | (source (origin |
117 | (method url-fetch) | |
b005a37a | 118 | (uri (hurd-source-url version)) |
dc91c10f MR |
119 | (sha256 |
120 | (base32 | |
be6a70ed | 121 | "1nw9gly0n7pyv3cpfm4mmxy4yccrx4g0lyrvd3vk2vil26jpbggw")))) |
dc91c10f MR |
122 | (build-system gnu-build-system) |
123 | (native-inputs | |
90b5d00b | 124 | `(("mig" ,mig))) |
dc91c10f | 125 | (arguments |
dc1d3cde KK |
126 | `(#:phases |
127 | (modify-phases %standard-phases | |
128 | (replace 'install | |
129 | (lambda _ | |
fe921521 | 130 | (invoke "make" "install-headers" "no_deps=t"))) |
dc1d3cde | 131 | (delete 'build)) |
dc91c10f MR |
132 | |
133 | #:configure-flags '(;; Pretend we're on GNU/Hurd; 'configure' wants | |
134 | ;; that. | |
6648cf63 MR |
135 | ,@(if (%current-target-system) |
136 | '() | |
137 | '("--host=i586-pc-gnu")) | |
dc91c10f MR |
138 | |
139 | ;; Reduce set of dependencies. | |
e1ecd50e MR |
140 | "--without-parted" |
141 | "--disable-ncursesw" | |
142 | "--disable-test" | |
143 | "--without-libbz2" | |
144 | "--without-libz" | |
145 | ;; Skip the clnt_create check because it expects | |
146 | ;; a working glibc causing a circular dependency. | |
147 | "ac_cv_search_clnt_create=no") | |
dc91c10f MR |
148 | |
149 | #:tests? #f)) | |
6fd52309 | 150 | (home-page "https://www.gnu.org/software/hurd/hurd.html") |
dc91c10f MR |
151 | (synopsis "GNU Hurd headers") |
152 | (description | |
153 | "This package provides C headers of the GNU Hurd, used to build the GNU C | |
154 | Library and other user programs.") | |
155 | (license gpl2+))) | |
21a8fe1b MR |
156 | |
157 | (define-public hurd-minimal | |
158 | (package (inherit hurd-headers) | |
159 | (name "hurd-minimal") | |
160 | (inputs `(("glibc-hurd-headers" ,glibc/hurd-headers))) | |
161 | (native-inputs | |
90b5d00b | 162 | `(("mig" ,mig))) |
21a8fe1b | 163 | (arguments |
e1ecd50e MR |
164 | (substitute-keyword-arguments (package-arguments hurd-headers) |
165 | ((#:phases _) | |
dc1d3cde KK |
166 | '(modify-phases %standard-phases |
167 | (replace 'install | |
168 | (lambda* (#:key outputs #:allow-other-keys) | |
169 | (let ((out (assoc-ref outputs "out"))) | |
170 | ;; We need to copy libihash.a to the output directory manually, | |
171 | ;; since there is no target for that in the makefile. | |
172 | (mkdir-p (string-append out "/include")) | |
173 | (copy-file "libihash/ihash.h" | |
174 | (string-append out "/include/ihash.h")) | |
175 | (mkdir-p (string-append out "/lib")) | |
176 | (copy-file "libihash/libihash.a" | |
177 | (string-append out "/lib/libihash.a")) | |
178 | #t))) | |
179 | (replace 'build | |
180 | (lambda _ | |
a48d22d6 | 181 | (invoke "make" "-Clibihash" "libihash.a"))))))) |
6fd52309 | 182 | (home-page "https://www.gnu.org/software/hurd/hurd.html") |
21a8fe1b MR |
183 | (synopsis "GNU Hurd libraries") |
184 | (description | |
a124bbd2 | 185 | "This package provides libihash, needed to build the GNU C |
21a8fe1b MR |
186 | Library for GNU/Hurd.") |
187 | (license gpl2+))) | |
38efbcbb MR |
188 | |
189 | (define-public hurd-core-headers | |
190 | (package | |
191 | (name "hurd-core-headers") | |
192 | (version (package-version hurd-headers)) | |
193 | (source #f) | |
194 | (build-system trivial-build-system) | |
195 | (arguments | |
196 | '(#:modules ((guix build union)) | |
197 | #:builder (begin | |
198 | (use-modules (ice-9 match) | |
199 | (guix build union)) | |
200 | (match %build-inputs | |
201 | (((names . directories) ...) | |
202 | (union-build (assoc-ref %outputs "out") | |
e3cfef22 MW |
203 | directories) |
204 | #t))))) | |
38efbcbb MR |
205 | (inputs `(("gnumach-headers" ,gnumach-headers) |
206 | ("hurd-headers" ,hurd-headers) | |
207 | ("hurd-minimal" ,hurd-minimal))) | |
208 | (synopsis "Union of the Hurd headers and libraries") | |
209 | (description | |
210 | "This package contains the union of the Mach and Hurd headers and the | |
211 | Hurd-minimal package which are needed for both glibc and GCC.") | |
212 | (home-page (package-home-page hurd-headers)) | |
213 | (license (package-license hurd-headers)))) | |
8df672aa MR |
214 | |
215 | (define-public gnumach | |
216 | (package | |
217 | (name "gnumach") | |
218 | (version "1.8") | |
219 | (source (origin | |
220 | (method url-fetch) | |
221 | (uri (gnumach-source-url version)) | |
222 | (sha256 | |
223 | (base32 | |
224 | "02hygsfpd2dljl5lg1vjjg9pizi9jyxd4aiiqzjshz6jax62jm9f")))) | |
225 | (build-system gnu-build-system) | |
226 | (arguments | |
227 | `(#:phases (modify-phases %standard-phases | |
228 | (add-after 'install 'produce-image | |
229 | (lambda* (#:key outputs #:allow-other-keys) | |
230 | (let* ((out (assoc-ref outputs "out")) | |
231 | (boot (string-append out "/boot"))) | |
a53ced66 MW |
232 | (invoke "make" "gnumach.gz") |
233 | (install-file "gnumach.gz" boot) | |
234 | #t)))))) | |
8df672aa MR |
235 | (native-inputs |
236 | `(("mig" ,mig) | |
237 | ("perl" ,perl))) | |
238 | (supported-systems (cons "i686-linux" %hurd-systems)) | |
239 | (home-page | |
240 | "https://www.gnu.org/software/hurd/microkernel/mach/gnumach.html") | |
241 | (synopsis "Microkernel of the GNU system") | |
242 | (description | |
243 | "GNU Mach is the microkernel upon which a GNU Hurd system is based.") | |
244 | (license gpl2+))) | |
cc4faa35 MR |
245 | |
246 | (define-public hurd | |
247 | (package | |
248 | (name "hurd") | |
249 | (version "0.9") | |
250 | (source (origin | |
251 | (method url-fetch) | |
252 | (uri (hurd-source-url version)) | |
253 | (sha256 | |
254 | (base32 | |
255 | "1nw9gly0n7pyv3cpfm4mmxy4yccrx4g0lyrvd3vk2vil26jpbggw")) | |
256 | (patches (search-patches "hurd-fix-eth-multiplexer-dependency.patch")))) | |
257 | (arguments | |
258 | `(#:phases | |
259 | (modify-phases %standard-phases | |
260 | (add-before 'build 'pre-build | |
261 | (lambda _ | |
262 | ;; Don't change the ownership of any file at this time. | |
263 | (substitute* '("daemons/Makefile" "utils/Makefile") | |
264 | (("-o root -m 4755") "")) | |
265 | #t))) | |
266 | #:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath=" | |
267 | %output "/lib") | |
268 | "--disable-ncursesw" | |
269 | "--without-libbz2" | |
270 | "--without-libz" | |
271 | "--without-parted"))) | |
272 | (build-system gnu-build-system) | |
273 | (inputs `(("glibc-hurd-headers" ,glibc/hurd-headers))) | |
274 | (native-inputs | |
275 | `(("mig" ,mig) | |
276 | ("perl" ,perl))) | |
277 | (supported-systems %hurd-systems) | |
278 | (home-page "https://www.gnu.org/software/hurd/hurd.html") | |
279 | (synopsis "The kernel servers for the GNU operating system") | |
280 | (description | |
281 | "The Hurd is the kernel for the GNU system, a replacement and | |
282 | augmentation of standard Unix kernels. It is a collection of protocols for | |
283 | system interaction (file systems, networks, authentication), and servers | |
284 | implementing them.") | |
285 | (license gpl2+))) |