clang
unvendor
This commit is contained in:
parent
9a4b261179
commit
404aa8ebbb
139 changed files with 8091 additions and 1178 deletions
39
06/using-nix/2a6-linux-headers.nix
Normal file
39
06/using-nix/2a6-linux-headers.nix
Normal file
|
@ -0,0 +1,39 @@
|
|||
{ fetchurl, mkDerivationStage2, stage1, static-gnumake, static-binutils, gnugcc10 }:
|
||||
|
||||
let
|
||||
source-tarball-linux = fetchurl {
|
||||
# local = /downloads/linux-6.4.12.tar.xz;
|
||||
url = "https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-6.4.12.tar.xz";
|
||||
sha256 = "cca91be956fe081f8f6da72034cded96fe35a50be4bfb7e103e354aa2159a674";
|
||||
};
|
||||
in
|
||||
mkDerivationStage2 {
|
||||
name = "bootstrap-2a6-linux-headers";
|
||||
buildInputPaths = [
|
||||
"${stage1.protobusybox}/bin"
|
||||
"${static-gnumake}/bin"
|
||||
"${static-binutils}/bin"
|
||||
"${gnugcc10}/bin"
|
||||
];
|
||||
script = ''
|
||||
# unpack:
|
||||
mkdir build-dir; cd build-dir
|
||||
unpack ${source-tarball-linux} \
|
||||
linux-6.4.12/Makefile \
|
||||
linux-6.4.12/arch/x86 \
|
||||
linux-6.4.12/include \
|
||||
linux-6.4.12/scripts \
|
||||
linux-6.4.12/tools
|
||||
# build:
|
||||
make -j $NPROC \
|
||||
CONFIG_SHELL=${stage1.protobusybox}/bin/ash \
|
||||
CC=gcc HOSTCC=gcc ARCH=x86_64 \
|
||||
headers
|
||||
# install:
|
||||
find usr/include -name '.*' | xargs rm
|
||||
mkdir -p $out
|
||||
cp -rv usr/include $out/
|
||||
# check for build path leaks:
|
||||
( ! grep -rF $(pwd) $out )
|
||||
'';
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue