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