# Maintainer: Natanael Copa pkgname=linux-headers pkgver=6.4 # Follow the latest Linux stable case $pkgver in *.*.*) _kernver=${pkgver%.*};; *.*) _kernver=$pkgver;; esac pkgrel=0 pkgdesc="Linux system headers" url="https://kernel.org/" arch="noarch" license="GPL-2.0-only" makedepends="perl" options="!check !dbg !strip !tracedeps" source="https://kernel.org/pub/linux/kernel/v6.x/linux-$_kernver.tar.xz revert-broken-uapi.patch 0003-remove-inclusion-of-sysinfo.h-in-kernel.h.patch " if [ "${pkgver%.0}" = "$pkgver" ]; then source=" $source https://cdn.kernel.org/pub/linux/kernel/v${pkgver%%.*}.x/patch-$pkgver.xz " fi builddir="$srcdir/linux-$_kernver" _carch="$CARCH" case "$_carch" in aarch64*) _carch="arm64" ;; arm*) _carch="arm" ;; mips*) _carch="mips" ;; s390*) _carch="s390" ;; ppc*) _carch="powerpc" ;; riscv*) _carch="riscv" ;; # not sure about this -- ppc64*) _carch="powerpc64" ;; esac prepare() { if [ "$_kernver" != "$pkgver" ]; then unxz -c < "$srcdir"/patch-$pkgver.xz | patch -p1 fi default_prepare } build() { make headers ARCH="$_carch" } package() { mkdir -p "$pkgdir"/usr/ cp -a usr/include/ "$pkgdir"/usr/include/ msg "purging non header files.." find "$pkgdir"/usr/include/ ! -iname "*.h" -type f -exec rm -v {} \+ # provided by libdrm rm -rf "$pkgdir"/usr/include/drm } sha512sums=" 11a48b25e0b513782d3b89101c2ec8dd9cefd6ce08dc63a91137903b66392aa72ca1fe32816710673af84dd47de3ab8738056a6af93dc0d5e60ef4b869b49928 linux-6.4.tar.xz 32597f2672d1ec365a936d15041a7cf219ef9353241d4a5c378244cf2fc155610443a19bbcd391c86099a0b08486c45e042ec7c90b0d04fe675c3ad0ffc36b53 revert-broken-uapi.patch 607c074d72aca88fea9ecdbd62198d8f7857daca75e5d027966e0a9997338d6ac8ce0a1e9114b19232b390751d05acca09e28b0cfad2a12d5942f5575a9f4684 0003-remove-inclusion-of-sysinfo.h-in-kernel.h.patch 961c4ca0d73c6199ba4fa8c53e3cc25e0fae5c80973507e1eca6709f860bf241ef5005b68bc64b313a5be2b0bf8901dae66de7b119b207a253c23fb8f5f72be1 patch-6.4.xz "