| 1 | defpkgbuild(linux-headers, |
| 2 | #:pkgname, "linux-headers", |
| 3 | #:pkgver, "6.6", |
| 4 | #:pkgrel, 1, |
| 5 | #:pkgdesc, "Linux userspace ABI headers for compiling Vinix programs", |
| 6 | #:arch, [#:x86-64, #:aarch64], |
| 7 | #:license, "GPL-2.0-only WITH Linux-syscall-note", |
| 8 | #:url, "https://kernel.org/", |
| 9 | #:source, ["https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-6.6.tar.xz", |
| 10 | "revert-broken-uapi.patch", "0003-remove-inclusion-of-sysinfo.h-in-kernel.h.patch"], |
| 11 | #:sha256sums, ["d926a06c63dd8ac7df3f86ee1ffc2ce2a3b81a2d168484e76b5b389aba8e56d0", |
| 12 | "b7a4fa8cb01645f1e96cd165d89e637de90594e39a5848003c386d6424b1def2", |
| 13 | "e9827c3f919866bb63b05b9eeacfc8e04f560f467c9456e7b283f432b5dc9a7e"], |
| 14 | #:prepare, fn() { |
| 15 | for-each(fn(patch) { |
| 16 | run("patch", "--batch", "--fuzz=0", "-d", "linux-6.6", "-p1", "-i", string-append("../", patch)) |
| 17 | }, list("revert-broken-uapi.patch", "0003-remove-inclusion-of-sysinfo.h-in-kernel.h.patch")) |
| 18 | }, |
| 19 | #:build, fn() { |
| 20 | run("make", "-C", "linux-6.6", "headers") |
| 21 | }, |
| 22 | #:package, fn() { |
| 23 | run("make", "-C", "linux-6.6", "headers_install", string-append("INSTALL_HDR_PATH=", pkgdir(), "/usr")) |
| 24 | ; libdrm supplies its own DRM interface headers in the graphics sysroot. |
| 25 | run("rm", "-rf", string-append(pkgdir(), "/usr/include/drm")) |
| 26 | run("test", "-s", string-append(pkgdir(), "/usr/include/asm/unistd.h")) |
| 27 | run("test", "-s", string-append(pkgdir(), "/usr/include/linux/vt.h")) |
| 28 | run("install", "-Dm644", "linux-6.6/LICENSES/exceptions/Linux-syscall-note", |
| 29 | string-append(pkgdir(), "/usr/share/licenses/linux-headers/Linux-syscall-note")) |
| 30 | run("install", "-Dm644", "linux-6.6/LICENSES/preferred/GPL-2.0", |
| 31 | string-append(pkgdir(), "/usr/share/licenses/linux-headers/GPL-2.0")) |
| 32 | }) |
| 33 | |