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