39 lines
1.1 KiB
Python
39 lines
1.1 KiB
Python
version = "7.0.9"
|
|
revision = 2
|
|
description = "Linux kernel headers for userspace development"
|
|
license = "GPL-2.0-only"
|
|
source = tarball(
|
|
url=f"https://cdn.kernel.org/pub/linux/kernel/v7.x/linux-{version}.tar.xz",
|
|
sha256="ac07acdf76cf4621cc5187a2670270a1a699533c8a6b225e4878c416ad83f1c4",
|
|
)
|
|
|
|
linux_archs = {"aarch64": "arm64"}
|
|
|
|
|
|
def build(self):
|
|
# Stage the source into the (writable) build dir before invoking the kernel
|
|
# build system, which is not happy with a read-only source tree.
|
|
self.run("cp", "-rp", f"{self.source_dir}/.", self.build_dir)
|
|
arch = linux_archs.get(self.profile["arch"], self.profile["arch"])
|
|
self.run("make", "headers_install", f"ARCH={arch}")
|
|
self.run(
|
|
"find",
|
|
self.build_dir / "usr/include",
|
|
"-type",
|
|
"f",
|
|
"!",
|
|
"-name",
|
|
"*.h",
|
|
"-delete",
|
|
)
|
|
|
|
|
|
def install(self):
|
|
self.run("mkdir", "-p", self.dest_dir / self.profile["prefix"].lstrip("/"))
|
|
self.run(
|
|
"cp",
|
|
"-rp",
|
|
self.build_dir / "usr/include",
|
|
str(self.dest_dir) + self.profile["prefix"],
|
|
)
|