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