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