gnu: Use HTTPS for almost all gnu.org HOME-PAGEs.
[jackhill/guix/guix.git] / gnu / packages / hurd.scm
CommitLineData
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
0193c004
MR
42(define-public gnumach-headers
43 (package
44 (name "gnumach-headers")
d950f038 45 (version "1.8")
0193c004
MR
46 (source
47 (origin
48 (method url-fetch)
41bfcac3 49 (uri (gnumach-source-url version))
0193c004
MR
50 (sha256
51 (base32
d950f038 52 "02hygsfpd2dljl5lg1vjjg9pizi9jyxd4aiiqzjshz6jax62jm9f"))))
0193c004
MR
53 (build-system gnu-build-system)
54 (arguments
55 `(#:phases (alist-replace
56 'install
57 (lambda _
58 (zero?
59 (system* "make" "install-data")))
60 (alist-delete
61 'build
62 %standard-phases))
63
64 ;; GNU Mach supports only IA32 currently, so cheat so that we can at
65 ;; least install its headers.
26a28c8a
MR
66 ,@(if (%current-target-system)
67 '()
68 ;; See <http://lists.gnu.org/archive/html/bug-hurd/2015-06/msg00042.html>
69 ;; <http://lists.gnu.org/archive/html/guix-devel/2015-06/msg00716.html>
70 '(#:configure-flags '("--build=i586-pc-gnu")))
0193c004
MR
71
72 #:tests? #f))
73 (home-page "https://www.gnu.org/software/hurd/microkernel/mach/gnumach.html")
74 (synopsis "GNU Mach kernel headers")
75 (description
76 "Headers of the GNU Mach kernel.")
77 (license gpl2+)))
396b3c8b
MR
78
79(define-public mig
80 (package
81 (name "mig")
9c9402be 82 (version "1.8")
396b3c8b
MR
83 (source
84 (origin
85 (method url-fetch)
86 (uri (string-append "mirror://gnu/mig/mig-"
87 version ".tar.gz"))
88 (sha256
89 (base32
9c9402be 90 "1gyda8sq6b379nx01hkpbd85lz39irdvz2b9wbr63gicicx8i706"))))
396b3c8b 91 (build-system gnu-build-system)
a7ecc92d
MR
92 ;; Flex is needed both at build and run time.
93 (inputs `(("gnumach-headers" ,gnumach-headers)
94 ("flex" ,flex)))
396b3c8b
MR
95 (native-inputs
96 `(("flex" ,flex)
97 ("bison" ,bison)))
98 (arguments `(#:tests? #f))
6fd52309 99 (home-page "https://www.gnu.org/software/hurd/microkernel/mach/mig/gnu_mig.html")
396b3c8b
MR
100 (synopsis "Mach 3.0 interface generator for the Hurd")
101 (description
102 "GNU MIG is the GNU distribution of the Mach 3.0 interface generator
103MIG, as maintained by the GNU Hurd developers for the GNU project.
104You need this tool to compile the GNU Mach and GNU Hurd distributions,
35b9e423 105and to compile the GNU C library for the Hurd. Also, you will need it
396b3c8b
MR
106for other software in the GNU system that uses Mach-based inter-process
107communication.")
108 (license gpl2+)))
dc91c10f
MR
109
110(define-public hurd-headers
111 (package
112 (name "hurd-headers")
be6a70ed 113 (version "0.9")
dc91c10f
MR
114 (source (origin
115 (method url-fetch)
116 (uri (string-append "mirror://gnu/hurd/hurd-"
117 version ".tar.gz"))
118 (sha256
119 (base32
be6a70ed 120 "1nw9gly0n7pyv3cpfm4mmxy4yccrx4g0lyrvd3vk2vil26jpbggw"))))
dc91c10f
MR
121 (build-system gnu-build-system)
122 (native-inputs
90b5d00b 123 `(("mig" ,mig)))
dc91c10f
MR
124 (arguments
125 `(#:phases (alist-replace
126 'install
127 (lambda _
128 (zero? (system* "make" "install-headers" "no_deps=t")))
129 (alist-delete 'build %standard-phases))
130
131 #:configure-flags '(;; Pretend we're on GNU/Hurd; 'configure' wants
132 ;; that.
6648cf63
MR
133 ,@(if (%current-target-system)
134 '()
135 '("--host=i586-pc-gnu"))
dc91c10f
MR
136
137 ;; Reduce set of dependencies.
e1ecd50e
MR
138 "--without-parted"
139 "--disable-ncursesw"
140 "--disable-test"
141 "--without-libbz2"
142 "--without-libz"
143 ;; Skip the clnt_create check because it expects
144 ;; a working glibc causing a circular dependency.
145 "ac_cv_search_clnt_create=no")
dc91c10f
MR
146
147 #:tests? #f))
6fd52309 148 (home-page "https://www.gnu.org/software/hurd/hurd.html")
dc91c10f
MR
149 (synopsis "GNU Hurd headers")
150 (description
151 "This package provides C headers of the GNU Hurd, used to build the GNU C
152Library and other user programs.")
153 (license gpl2+)))
21a8fe1b
MR
154
155(define-public hurd-minimal
156 (package (inherit hurd-headers)
157 (name "hurd-minimal")
158 (inputs `(("glibc-hurd-headers" ,glibc/hurd-headers)))
159 (native-inputs
90b5d00b 160 `(("mig" ,mig)))
21a8fe1b 161 (arguments
e1ecd50e
MR
162 (substitute-keyword-arguments (package-arguments hurd-headers)
163 ((#:phases _)
164 '(alist-replace
165 'install
166 (lambda* (#:key outputs #:allow-other-keys)
167 (let ((out (assoc-ref outputs "out")))
168 ;; We need to copy libihash.a to the output directory manually,
169 ;; since there is no target for that in the makefile.
170 (mkdir-p (string-append out "/include"))
171 (copy-file "libihash/ihash.h"
172 (string-append out "/include/ihash.h"))
173 (mkdir-p (string-append out "/lib"))
174 (copy-file "libihash/libihash.a"
175 (string-append out "/lib/libihash.a"))
176 #t))
177 (alist-replace
178 'build
179 (lambda _
180 (zero? (system* "make" "-Clibihash" "libihash.a")))
181 %standard-phases)))))
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
186Library 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")
203 directories))))))
204 (inputs `(("gnumach-headers" ,gnumach-headers)
205 ("hurd-headers" ,hurd-headers)
206 ("hurd-minimal" ,hurd-minimal)))
207 (synopsis "Union of the Hurd headers and libraries")
208 (description
209 "This package contains the union of the Mach and Hurd headers and the
210Hurd-minimal package which are needed for both glibc and GCC.")
211 (home-page (package-home-page hurd-headers))
212 (license (package-license hurd-headers))))
8df672aa
MR
213
214(define-public gnumach
215 (package
216 (name "gnumach")
217 (version "1.8")
218 (source (origin
219 (method url-fetch)
220 (uri (gnumach-source-url version))
221 (sha256
222 (base32
223 "02hygsfpd2dljl5lg1vjjg9pizi9jyxd4aiiqzjshz6jax62jm9f"))))
224 (build-system gnu-build-system)
225 (arguments
226 `(#:phases (modify-phases %standard-phases
227 (add-after 'install 'produce-image
228 (lambda* (#:key outputs #:allow-other-keys)
229 (let* ((out (assoc-ref outputs "out"))
230 (boot (string-append out "/boot")))
231 (and (zero? (system* "make" "gnumach.gz"))
232 (begin
233 (install-file "gnumach.gz" boot)
234 #t))))))))
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+)))