gnu: sequoia: Update to 0.17.0.
[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>
e62f6f77 3;;; Copyright © 2018, 2020 Ludovic Courtès <ludo@gnu.org>
fb9d6f0f 4;;; Copyright © 2020 Efraim Flashner <efraim@flashner.co.il>
f379c665 5;;; Copyright © 2020 Marius Bakke <mbakke@fastmail.com>
9b943db3 6;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
706b91ea 7;;; Copyright © 2020 Ricardo Wurmus <rekado@elephly.net>
2676579d 8;;; Copyright © 2020 Rene Saavedra <pacoon@protonmail.com>
0193c004
MR
9;;;
10;;; This file is part of GNU Guix.
11;;;
12;;; GNU Guix is free software; you can redistribute it and/or modify it
13;;; under the terms of the GNU General Public License as published by
14;;; the Free Software Foundation; either version 3 of the License, or (at
15;;; your option) any later version.
16;;;
17;;; GNU Guix is distributed in the hope that it will be useful, but
18;;; WITHOUT ANY WARRANTY; without even the implied warranty of
19;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20;;; GNU General Public License for more details.
21;;;
22;;; You should have received a copy of the GNU General Public License
23;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
24
25(define-module (gnu packages hurd)
d30d3e3f 26 #:use-module ((guix licenses) #:hide (zlib))
0193c004
MR
27 #:use-module (guix download)
28 #:use-module (guix packages)
21a8fe1b 29 #:use-module (gnu packages)
f46cf8ef 30 #:use-module (guix gexp)
e1ecd50e 31 #:use-module (guix utils)
396b3c8b 32 #:use-module (guix build-system gnu)
38efbcbb 33 #:use-module (guix build-system trivial)
b37c5441 34 #:use-module (gnu build hurd-boot)
2d546858 35 #:use-module (gnu packages autotools)
d30d3e3f 36 #:use-module (gnu packages compression)
396b3c8b 37 #:use-module (gnu packages flex)
d30d3e3f 38 #:use-module (gnu packages gawk)
abbeaf54 39 #:use-module (gnu packages gnupg)
dc91c10f 40 #:use-module (gnu packages bison)
1d5fc9f7 41 #:use-module (gnu packages libdaemon)
29505c7d 42 #:use-module (gnu packages linux)
dc91c10f 43 #:use-module (gnu packages perl)
1d5fc9f7 44 #:use-module (gnu packages pkg-config)
21a8fe1b 45 #:use-module (gnu packages base)
29505c7d 46 #:use-module (gnu packages bash)
fb9d6f0f 47 #:use-module (gnu packages texinfo)
2e463d6e 48 #:use-module (gnu packages onc-rpc)
706b91ea 49 #:use-module (gnu packages xorg) ; libpciaccess
62596a15 50 #:use-module (guix git-download)
9b943db3
JN
51 #:export (hurd-system?
52 hurd-target?
53 hurd-triplet?))
62596a15
MR
54
55(define (hurd-triplet? triplet)
56 (and (string-suffix? "-gnu" triplet)
57 (not (string-contains triplet "linux"))))
0193c004 58
2d546858
LC
59(define (hurd-target?)
60 "Return true if the cross-compilation target or the current system is
61GNU/Hurd."
62 (or (and=> (%current-target-system) hurd-triplet?)
9b943db3
JN
63 (and (not (%current-target-system))
64 (and=> (%current-system) hurd-triplet?))))
65
66(define (hurd-system?)
67 "Return true if the current system is the Hurd."
68 (and=> (%current-system) hurd-triplet?))
2d546858 69
b005a37a
MR
70(define (hurd-source-url version)
71 (string-append "mirror://gnu/hurd/hurd-"
72 version ".tar.gz"))
73
0193c004 74(define-public gnumach-headers
fb9d6f0f
EF
75 (let ((commit "097f9cf735ffa1212b828682ad92f0f6c5f1c552")
76 (revision "1"))
77 (package
78 (name "gnumach-headers")
79 (version (git-version "1.8" revision commit))
80 (source
81 (origin
82 (method git-fetch)
83 (uri (git-reference
84 (url "https://git.savannah.gnu.org/git/hurd/gnumach.git")
85 (commit commit)))
86 (file-name (git-file-name "gnumach" version))
87 (sha256
88 (base32
89 "0q36z7k02bykrld90zaxbhyzxlmwlqqs4divgir6ix38zsp6icqk"))))
90 (build-system gnu-build-system)
91 (arguments
92 `(#:phases
93 (modify-phases %standard-phases
94 (replace 'install
95 (lambda _
96 (invoke "make" "install-data")))
97 (delete 'build))
0193c004 98
fb9d6f0f
EF
99 ;; GNU Mach supports only IA32 currently, so cheat so that we can at
100 ;; least install its headers.
101 ,@(if (%current-target-system)
102 '()
103 ;; See <http://lists.gnu.org/archive/html/bug-hurd/2015-06/msg00042.html>
104 ;; <http://lists.gnu.org/archive/html/guix-devel/2015-06/msg00716.html>
105 '(#:configure-flags '("--build=i586-pc-gnu"
106 "--host=i686-linux-gnu")))
0193c004 107
fb9d6f0f
EF
108 #:tests? #f))
109 (native-inputs
110 `(("autoconf" ,autoconf)
111 ("automake" ,automake)
112 ("texinfo" ,texinfo-4)))
113 (home-page "https://www.gnu.org/software/hurd/microkernel/mach/gnumach.html")
114 (synopsis "GNU Mach kernel headers")
115 (description
116 "Headers of the GNU Mach kernel.")
117 (license gpl2+))))
396b3c8b
MR
118
119(define-public mig
120 (package
121 (name "mig")
9c9402be 122 (version "1.8")
396b3c8b
MR
123 (source
124 (origin
125 (method url-fetch)
126 (uri (string-append "mirror://gnu/mig/mig-"
127 version ".tar.gz"))
128 (sha256
129 (base32
9c9402be 130 "1gyda8sq6b379nx01hkpbd85lz39irdvz2b9wbr63gicicx8i706"))))
396b3c8b 131 (build-system gnu-build-system)
a7ecc92d
MR
132 ;; Flex is needed both at build and run time.
133 (inputs `(("gnumach-headers" ,gnumach-headers)
134 ("flex" ,flex)))
396b3c8b
MR
135 (native-inputs
136 `(("flex" ,flex)
137 ("bison" ,bison)))
138 (arguments `(#:tests? #f))
6fd52309 139 (home-page "https://www.gnu.org/software/hurd/microkernel/mach/mig/gnu_mig.html")
396b3c8b
MR
140 (synopsis "Mach 3.0 interface generator for the Hurd")
141 (description
142 "GNU MIG is the GNU distribution of the Mach 3.0 interface generator
143MIG, as maintained by the GNU Hurd developers for the GNU project.
144You need this tool to compile the GNU Mach and GNU Hurd distributions,
35b9e423 145and to compile the GNU C library for the Hurd. Also, you will need it
396b3c8b
MR
146for other software in the GNU system that uses Mach-based inter-process
147communication.")
148 (license gpl2+)))
dc91c10f
MR
149
150(define-public hurd-headers
2d546858
LC
151 ;; Resort to a post-0.9 snapshot that provides the 'file_utimens' and
152 ;; 'file_exec_paths' RPCs that glibc 2.28 expects.
f379c665
MB
153 (let ((revision "1")
154 (commit "91a51672ff4cfe1f1a0712b4c542ded3081c825b"))
2d546858
LC
155 (package
156 (name "hurd-headers")
f379c665 157 (version (git-version "0.9" revision commit))
2d546858
LC
158 (source (origin
159 (method git-fetch)
160 (uri (git-reference
161 (url "https://git.savannah.gnu.org/git/hurd/hurd.git")
162 (commit commit)))
163 (sha256
164 (base32
f379c665 165 "16k9wkahz9wasviijz53n6i13nmiwa9fs64ikf1jqh8rl60hw7cz"))
2d546858
LC
166 (file-name (git-file-name name version))))
167 (build-system gnu-build-system)
168 (native-inputs
169 `(("mig" ,mig)
170 ("autoconf" ,autoconf)
171 ("automake" ,automake)))
172 (arguments
173 `(#:phases
174 (modify-phases %standard-phases
175 (replace 'install
176 (lambda _
177 (invoke "make" "install-headers" "no_deps=t")))
178 (delete 'build))
dc91c10f 179
2d546858
LC
180 #:configure-flags '( ;; Pretend we're on GNU/Hurd; 'configure' wants
181 ;; that.
182 ,@(if (%current-target-system)
183 '()
184 '("--host=i586-pc-gnu"))
185
186 ;; Reduce set of dependencies.
187 "--without-parted"
188 "--disable-ncursesw"
189 "--disable-test"
190 "--without-libbz2"
f379c665 191 "--without-libcrypt"
2d546858
LC
192 "--without-libz"
193 ;; Skip the clnt_create check because it expects
194 ;; a working glibc causing a circular dependency.
195 "ac_cv_search_clnt_create=no"
196
197 ;; Annihilate the checks for the 'file_exec_paths'
198 ;; & co. libc functions to avoid "link tests are
199 ;; not allowed after AC_NO_EXECUTABLES" error.
200 "ac_cv_func_file_exec_paths=no"
201 "ac_cv_func_exec_exec_paths=no"
202 "ac_cv_func__hurd_exec_paths=no"
203 "ac_cv_func_file_futimens=no")
204
205 #:tests? #f))
206 (home-page "https://www.gnu.org/software/hurd/hurd.html")
207 (synopsis "GNU Hurd headers")
208 (description
209 "This package provides C headers of the GNU Hurd, used to build the GNU C
dc91c10f 210Library and other user programs.")
2d546858 211 (license gpl2+))))
21a8fe1b
MR
212
213(define-public hurd-minimal
214 (package (inherit hurd-headers)
215 (name "hurd-minimal")
216 (inputs `(("glibc-hurd-headers" ,glibc/hurd-headers)))
21a8fe1b 217 (arguments
e1ecd50e
MR
218 (substitute-keyword-arguments (package-arguments hurd-headers)
219 ((#:phases _)
dc1d3cde
KK
220 '(modify-phases %standard-phases
221 (replace 'install
222 (lambda* (#:key outputs #:allow-other-keys)
223 (let ((out (assoc-ref outputs "out")))
224 ;; We need to copy libihash.a to the output directory manually,
225 ;; since there is no target for that in the makefile.
226 (mkdir-p (string-append out "/include"))
227 (copy-file "libihash/ihash.h"
228 (string-append out "/include/ihash.h"))
229 (mkdir-p (string-append out "/lib"))
230 (copy-file "libihash/libihash.a"
231 (string-append out "/lib/libihash.a"))
232 #t)))
233 (replace 'build
234 (lambda _
2d546858
LC
235 ;; Install <assert-backtrace.h> & co.
236 (invoke "make" "-Clibshouldbeinlibc"
237 "../include/assert-backtrace.h")
238
239 ;; Build libihash.
a48d22d6 240 (invoke "make" "-Clibihash" "libihash.a")))))))
6fd52309 241 (home-page "https://www.gnu.org/software/hurd/hurd.html")
21a8fe1b
MR
242 (synopsis "GNU Hurd libraries")
243 (description
a124bbd2 244 "This package provides libihash, needed to build the GNU C
21a8fe1b
MR
245Library for GNU/Hurd.")
246 (license gpl2+)))
38efbcbb
MR
247
248(define-public hurd-core-headers
249 (package
250 (name "hurd-core-headers")
251 (version (package-version hurd-headers))
252 (source #f)
253 (build-system trivial-build-system)
254 (arguments
255 '(#:modules ((guix build union))
256 #:builder (begin
257 (use-modules (ice-9 match)
258 (guix build union))
259 (match %build-inputs
260 (((names . directories) ...)
261 (union-build (assoc-ref %outputs "out")
e3cfef22
MW
262 directories)
263 #t)))))
38efbcbb
MR
264 (inputs `(("gnumach-headers" ,gnumach-headers)
265 ("hurd-headers" ,hurd-headers)
266 ("hurd-minimal" ,hurd-minimal)))
267 (synopsis "Union of the Hurd headers and libraries")
268 (description
269 "This package contains the union of the Mach and Hurd headers and the
270Hurd-minimal package which are needed for both glibc and GCC.")
271 (home-page (package-home-page hurd-headers))
272 (license (package-license hurd-headers))))
8df672aa
MR
273
274(define-public gnumach
275 (package
fb9d6f0f 276 (inherit gnumach-headers)
8df672aa 277 (name "gnumach")
8df672aa 278 (arguments
e62f6f77 279 (substitute-keyword-arguments (package-arguments gnumach-headers)
29814639
LC
280 ((#:configure-flags flags ''())
281 `(cons "--enable-kdb" ,flags)) ;enable kernel debugger
e62f6f77
LC
282 ((#:phases phases '%standard-phases)
283 `(modify-phases %standard-phases
284 (add-after 'install 'produce-image
285 (lambda* (#:key outputs #:allow-other-keys)
286 (let* ((out (assoc-ref outputs "out"))
287 (boot (string-append out "/boot")))
288 (invoke "make" "gnumach.gz")
289 (install-file "gnumach.gz" boot)
290 #t)))))))
8df672aa
MR
291 (native-inputs
292 `(("mig" ,mig)
e62f6f77
LC
293 ("perl" ,perl)
294 ("autoconf" ,autoconf)
295 ("automake" ,automake)
296 ("texinfo" ,texinfo-4)))
8df672aa 297 (supported-systems (cons "i686-linux" %hurd-systems))
8df672aa
MR
298 (synopsis "Microkernel of the GNU system")
299 (description
fb9d6f0f 300 "GNU Mach is the microkernel upon which a GNU Hurd system is based.")))
cc4faa35 301
ad3bbead
LC
302(define unifont
303 ;; GNU Unifont, <http://gnu.org/s/unifont>.
304 ;; Used the the VGA driver of the Hurd's console client.
305 (origin
306 (method url-fetch)
307 (uri
308 "http://unifoundry.com/pub/unifont-7.0.06/font-builds/unifont-7.0.06.bdf.gz")
309 (sha256
310 (base32
311 "0p2vhnc18cnbmb39vq4m7hzv4mhnm2l0a2s7gx3ar277fwng3hys"))))
312
71b92e1a
RW
313(define dde-sources
314 ;; This is the current tip of the dde branch
315 (let ((commit "ac1c7eb7a8b24b7469bed5365be38a968d59a136"))
316 (origin
317 (method git-fetch)
318 (uri (git-reference
319 (url "https://git.savannah.gnu.org/git/hurd/incubator.git")
320 (commit commit)))
321 (sha256
322 (base32
323 "1vryinbg75xpydfrv9dbgfnds6knlh8l8bk2rxp32y9dc58z0692"))
324 (file-name (git-file-name "dde" commit)))))
325
cc4faa35
MR
326(define-public hurd
327 (package
328 (name "hurd")
496d607d
JN
329 (version (package-version hurd-headers))
330 (source (origin (inherit (package-source hurd-headers))
4c26229c
JN
331 (patches (search-patches "hurd-cross.patch"
332 "hurd-xattr.patch"))))
cc4faa35
MR
333 (arguments
334 `(#:phases
335 (modify-phases %standard-phases
706b91ea
RW
336 (add-after 'unpack 'prepare-dde
337 (lambda* (#:key native-inputs inputs #:allow-other-keys)
338 (substitute* "Makefile"
339 (("libbpf ")
340 "libbpf libmachdev libmachdevdde libddekit"))
341 (for-each make-file-writable (find-files "."))
342 (let ((dde (or (assoc-ref inputs "dde-sources")
343 (assoc-ref native-inputs "dde-sources"))))
344 (for-each (lambda (dir)
345 (copy-recursively
346 (string-append dde "/" dir ) dir))
347 '("libmachdev" "libmachdevdde" "libddekit")))
348 #t))
2e463d6e
RW
349 (add-after 'unpack 'find-tirpc
350 (lambda* (#:key inputs #:allow-other-keys)
351 (for-each (lambda (var)
352 (setenv var
353 (string-append (assoc-ref inputs "libtirpc")
354 "/include/tirpc:"
355 (or (getenv var) ""))))
356 '("CROSS_C_INCLUDE_PATH" "C_INCLUDE_PATH"
357 "CROSS_CPATH" "CPATH"))
358 #t))
359 (add-after 'unpack 'fix-rpc-headers
360 (lambda _
361 (substitute* "nfs/mount.c"
362 (("#undef (TRUE|FALSE)") "")
363 (("#include <rpc/pmap_prot.h>" m)
364 (string-append "#include <rpc/xdr.h>\n" m)))
365 (substitute* '("nfsd/cache.c")
366 (("#undef (TRUE|FALSE)") ""))
367 (substitute* '("nfsd/loop.c"
368 "nfsd/main.c"
369 "nfsd/ops.c")
370 (("#include <rpc/pmap_prot.h>" m)
371 (string-append "#include <rpc/types.h>\n#include <rpc/xdr.h>\n" m)))
372 #t))
cc4faa35 373 (add-before 'build 'pre-build
f46cf8ef
LC
374 (lambda _
375 ;; Don't change the ownership of any file at this time.
376 (substitute* '("daemons/Makefile" "utils/Makefile")
377 (("-o root -m 4755") ""))
378 #t))
97c94fc2
JN
379 (add-after 'unpack 'create-runsystem
380 (lambda _
381 ;; XXX Work towards having startup.c invoke the Guile rc
382 (delete-file "daemons/runsystem.sh")
383 (with-output-to-file "daemons/runsystem.sh"
384 (lambda _
385 (display "#! /bin/bash
386
387# XXX Guile needs pipe support for its finalizer thread, to start.
388# Remove this script when Linux and the Hurd have xattr patches.
389PATH=@PATH@
390
391fsck --yes --force /
392fsysopts / --writable
393
394# Note: this /hurd/ gets substituted
395settrans --create /servers/socket/1 /hurd/pflocal
97c94fc2 396
68d8c094
JN
397# parse multiboot arguments
398for i in \"$@\"; do
399 case $i in
400 (--system=*)
401 system=${i#--system=}
402 ;;
403 esac
404done
405
406echo Starting ${system}/rc...
407exec ${system}/rc \"$@\"
408")))))
b7e23a92
LC
409 (add-before 'build 'set-file-names
410 (lambda* (#:key inputs outputs #:allow-other-keys)
29505c7d
LC
411 (let* ((out (assoc-ref outputs "out"))
412 (bash (assoc-ref inputs "bash-minimal"))
413 (coreutils (assoc-ref inputs "coreutils"))
414 (sed (assoc-ref inputs "sed"))
415 (grep (assoc-ref inputs "grep"))
416 (util-linux (assoc-ref inputs "util-linux")))
417 (substitute* '("daemons/runttys.c" "daemons/getty.c" "utils/login.c")
b7e23a92 418 (("/bin/login")
29505c7d
LC
419 (string-append out "/bin/login"))
420 (("/bin/bash") (string-append bash "/bin/bash")))
97c94fc2 421 (substitute* '("startup/startup.c" "config/ttys")
29505c7d
LC
422 (("/libexec/")
423 (string-append out "/libexec/")))
2676579d
RS
424 (substitute* '("utils/uptime.sh")
425 (("/bin/w")
426 (string-append out "/bin/w")))
97c94fc2
JN
427 ;; Upon first boot the /hurd symlink does not exist; it is
428 ;; created during activation: Hard-code the .../hurd store file
429 ;; name.
430 (substitute* '("boot/boot.c"
431 "daemons/console-run.c"
432 "startup/startup.c")
29505c7d
LC
433 (("/hurd/")
434 (string-append out "/hurd/")))
97c94fc2
JN
435 (substitute* '("libdiskfs/boot-start.c"
436 "libdiskfs/opts-std-startup.c")
437 (("_HURD_STARTUP")
438 (string-append "\"" out "/hurd/startup\"")))
29505c7d 439 (substitute* '("daemons/runsystem.sh"
97c94fc2
JN
440 "utils/fakeroot.sh"
441 "utils/remap.sh"
442 "sutils/MAKEDEV.sh"
443 "sutils/losetup.sh")
29505c7d 444 (("^PATH=.*")
97c94fc2
JN
445 (string-append "PATH=" out "/bin"
446 ":" out "/sbin"
447 ":" coreutils "/bin"
448 ":" grep "/bin"
449 ":" sed "/bin"
450 ":" util-linux "/sbin\n"))
29505c7d
LC
451 (("/sbin/") (string-append out "/sbin/"))
452 (("/libexec/") (string-append out "/libexec/"))
453 (("/hurd/") (string-append out "/hurd/")))
29505c7d
LC
454 #t)))
455 (add-after 'patch-shebangs 'patch-libexec-shebangs
456 (lambda* (#:key inputs outputs #:allow-other-keys)
457 ;; XXX: Since the 'patch-shebangs' phase doesn't traverse
458 ;; /libexec, do it here.
459 (let* ((out (assoc-ref outputs "out"))
460 (bash (assoc-ref inputs "bash-minimal"))
461 (path (list (string-append bash "/bin"))))
462 (for-each (lambda (file)
463 (patch-shebang file path))
464 (find-files (string-append out "/libexec")))
b7e23a92 465 #t)))
62a3bbfd 466 (add-after 'install 'install-goodies
ad3bbead 467 (lambda* (#:key inputs outputs #:allow-other-keys)
62a3bbfd
LC
468 ;; Install additional goodies.
469 ;; TODO: Build & install *.msgids for rpctrace.
ad3bbead
LC
470 (let* ((out (assoc-ref outputs "out"))
471 (datadir (string-append out "/share/hurd")))
62a3bbfd
LC
472 ;; Install the fancy UTF-8 motd.
473 (mkdir-p (string-append out "/etc"))
474 (copy-file "console/motd.UTF8"
475 (string-append out "/etc/motd"))
ad3bbead
LC
476
477 ;; Install the BDF font for use by the console client.
478 (copy-file (assoc-ref inputs "unifont")
479 "unifont.gz")
480 (invoke "gunzip" "unifont.gz")
481 (mkdir-p datadir)
482 (copy-file "unifont"
483 (string-append datadir "/vga-system.bdf"))
f46cf8ef 484 #t))))
cc4faa35
MR
485 #:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
486 %output "/lib")
487 "--disable-ncursesw"
488 "--without-libbz2"
489 "--without-libz"
2e463d6e
RW
490 "--without-parted"
491 ;; This is needed to pass the configure check for
492 ;; clnt_create
493 "ac_func_search_save_LIBS=-ltirpc"
494 "ac_cv_search_clnt_create=false")))
cc4faa35 495 (build-system gnu-build-system)
f46cf8ef
LC
496 (inputs
497 `(("glibc-hurd-headers" ,glibc/hurd-headers)
29505c7d 498
abbeaf54 499 ("libgcrypt" ,libgcrypt) ;for /hurd/random
1d5fc9f7 500 ("libdaemon" ,libdaemon) ;for /bin/console --daemonize
ad3bbead 501 ("unifont" ,unifont)
706b91ea 502 ("libpciaccess" ,libpciaccess)
1d5fc9f7 503
2e463d6e
RW
504 ;; For NFS support
505 ("libtirpc" ,libtirpc/hurd)
506
29505c7d
LC
507 ;; Tools for the /libexec/* scripts.
508 ("bash-minimal" ,bash-minimal)
509 ("coreutils" ,coreutils)
510 ("sed" ,sed)
511 ("grep" ,grep)
512 ("util-linux" ,util-linux)))
cc4faa35 513 (native-inputs
496d607d
JN
514 `(("autoconf" ,autoconf)
515 ("automake" ,automake)
abbeaf54 516 ("libgcrypt" ,libgcrypt) ;for 'libgcrypt-config'
1d5fc9f7 517 ("pkg-config" ,pkg-config)
09ac892a
LC
518 ("mig" ,(if (%current-target-system)
519 ;; XXX: When targeting i586-pc-gnu, we need a 32-bit MiG,
520 ;; hence this hack.
521 (package
522 (inherit mig)
523 (arguments `(#:system "i686-linux")))
524 mig))
496d607d 525 ("perl" ,perl)
706b91ea 526 ("texinfo" ,texinfo-4)
71b92e1a 527 ("dde-sources" ,dde-sources)))
cc4faa35
MR
528 (supported-systems %hurd-systems)
529 (home-page "https://www.gnu.org/software/hurd/hurd.html")
530 (synopsis "The kernel servers for the GNU operating system")
531 (description
532 "The Hurd is the kernel for the GNU system, a replacement and
533augmentation of standard Unix kernels. It is a collection of protocols for
534system interaction (file systems, networks, authentication), and servers
535implementing them.")
536 (license gpl2+)))
d30d3e3f
RW
537
538(define-public netdde
539 (let ((commit "4a1016f130b6f2065d3f088325e5fb0b2997ae12")
540 (revision "1"))
541 (package
542 (name "netdde")
543 ;; The version prefix corresponds to the version of Linux from which the
544 ;; drivers were taken.
545 (version (git-version "2.6.32.65" revision commit))
546 (source (origin
547 (method git-fetch)
548 (uri (git-reference
549 (url "https://git.savannah.gnu.org/git/hurd/incubator.git")
550 (commit commit)))
551 (sha256
552 (base32
553 "1njv9dszq4lj05yq4v9j5v247hfghpzvvz4hzy0khjjr35mw7hr8"))
554 (file-name (git-file-name name commit))))
555 (build-system gnu-build-system)
556 (arguments
557 `(#:make-flags
558 (list (string-append "SHELL=" (assoc-ref %build-inputs "bash")
559 "/bin/bash")
560 "PKGDIR=libdde_linux26"
561 ,@(if (%current-target-system)
562 (list "CC=i586-pc-gnu-gcc"
563 "LINK_PROGRAM=i586-pc-gnu-gcc")
564 (list "CC=gcc")))
565 #:configure-flags
566 (list (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
567 #:phases
568 (modify-phases %standard-phases
569 (delete 'configure)
570 (add-after 'unpack 'prepare-dde
571 (lambda* (#:key native-inputs inputs #:allow-other-keys)
572 (for-each make-file-writable (find-files "."))
573 (let ((dde (or (assoc-ref inputs "dde-sources")
574 (assoc-ref native-inputs "dde-sources"))))
575 (for-each (lambda (dir)
576 (copy-recursively
577 (string-append dde "/" dir ) dir))
578 '("libdde_linux26" "libddekit")))
579 (substitute* "libdde_linux26/mk/rel2abs.sh"
580 (("/bin/bash") (which "bash")))
581 #t))
582 (add-after 'patch-generated-file-shebangs 'build-libdde-linux26
583 (lambda* (#:key make-flags #:allow-other-keys)
584 (with-directory-excursion "libdde_linux26"
585 (apply invoke "make"
586 (delete "PKGDIR=libdde_linux26" make-flags)))))
587 (add-after 'build-libdde-linux26 'convert
588 (lambda* (#:key make-flags #:allow-other-keys)
589 (apply invoke "make" "convert" make-flags)))
590 (replace 'build
591 (lambda* (#:key make-flags #:allow-other-keys)
592 ;; no-common can be dropped with GCC 10+ where this is the
593 ;; default.
594 (apply invoke "make" "CFLAGS=-fno-common" make-flags)))
595 (replace 'install
596 (lambda* (#:key outputs #:allow-other-keys)
597 (install-file "netdde"
598 (string-append (assoc-ref outputs "out")
599 "/bin"))
600 #t)))))
601 (inputs
602 `(("hurd" ,hurd)
603 ("libpciaccess" ,libpciaccess)
604 ("zlib" ,zlib)))
605 (native-inputs
606 `(("coreutils" ,coreutils)
607 ("gawk" ,gawk)
608 ("grep" ,grep)
609 ("perl" ,perl)
610 ("sed" ,sed)
611 ("dde-sources" ,dde-sources)))
612 (supported-systems %hurd-systems)
613 (home-page "https://www.gnu.org/software/hurd/hurd.html")
614 (synopsis "Linux network drivers glued by the DDE layer")
615 (description
616 "This package provides Linux 2.6 network drivers that can be embedded
617in userland processes thanks to the DDE layer.")
618 ;; Some drivers are dually licensed with the options being GPLv2 or one
619 ;; of MPL/Expat/BSD-3 (dependent on the driver).
620 (license gpl2))))