1{ lib
2, fetchurl
3, bash
4, gnutar
5, xz
6}:
7let
8 # WARNING: You probably don't want to use this package outside minimal-bootstrap
9 #
10 # We need some set of Linux kernel headers to build our bootstrap packages
11 # (gcc/binutils/glibc etc.) against. As long as it compiles it is "good enough".
12 # Therefore the requirement for correctness, completeness, platform-specific
13 # features, and being up-to-date, are very loose.
14 #
15 # Rebuilding the Linux headers from source correctly is something we can defer
16 # till we have access to gcc/binutils/perl. For now we can use Guix's assembled
17 # kernel header distribution and assume it's good enough.
18 pname = "linux-headers";
19 version = "4.14.67";
20
21 src = fetchurl {
22 url = "mirror://gnu/gnu/guix/bootstrap/i686-linux/20190815/linux-libre-headers-stripped-4.14.67-i686-linux.tar.xz";
23 sha256 = "0sm2z9x4wk45bh6qfs94p0w1d6hsy6dqx9sw38qsqbvxwa1qzk8s";
24 };
25in
26bash.runCommand "${pname}-${version}" {
27 inherit pname version;
28
29 nativeBuildInputs = [
30 gnutar
31 xz
32 ];
33
34 meta = with lib; {
35 description = "Header files and scripts for Linux kernel";
36 license = licenses.gpl2;
37 maintainers = teams.minimal-bootstrap.members;
38 platforms = platforms.linux;
39 };
40} ''
41 # Unpack
42 cp ${src} linux-headers.tar.xz
43 unxz linux-headers.tar.xz
44 tar xf linux-headers.tar
45
46 # Install
47 mkdir $out
48 cp -r include $out
49''