Split headers from rest, must be installed before kernel build

This commit is contained in:
Alex D. 2021-08-01 15:40:06 +00:00
parent 82684bb769
commit 9e8c7a3c0d
Signed by: caskd
GPG Key ID: F92BA85F61F4C173
2 changed files with 71 additions and 25 deletions

View File

@ -0,0 +1,69 @@
# Contributor: Natanael Copa <ncopa@alpinelinux.org>
# Contributor: Alex Denes <caskd@redxen.eu>
# Maintainer: Alex Denes <caskd@redxen.eu>
pkgname=linux-headers
_kver=5.10
_kpatch=55
pkgver=$_kver.$_kpatch
pkgrel=0
source="
https://cdn.kernel.org/pub/linux/kernel/v${pkgver%%.*}.x/linux-$pkgver.tar.xz
"
_kabi= _klocalver= _kconfig= _kbdmain= _kbddev= _kflavor=
_kdir_src="$srcdir/linux-$pkgver"
arch="noarch"
_depends_dev="
perl
gmp-dev
elfutils-dev
bash
flex
bison
"
makedepends="
$_depends_dev
sed
installkernel
bc
openssl-dev
diffutils
findutils
"
pkgdesc="Linux Kernel - Headers"
url="https://www.kernel.org"
license="GPL-2.0"
options="!strip"
builddir="$_kdir_src"
_carch=${CARCH} # abuild to kernel arch mapping
case "$_carch" in
aarch64*) _carch="arm64" ;;
arm*) _carch="arm" ;;
mips*) _carch="mips" ;;
ppc*) _carch="powerpc" ;;
s390*) _carch="s390" ;;
esac
package() {
local _outdir="$pkgdir/usr"
mkdir -p "$_outdir"
cd "$_kdir_src"
make headers_install \
ARCH="$_carch" \
INSTALL_HDR_PATH="$_outdir"
rm -f **/.install **/install.cmd
rm -rf "$_outdir/include/drm" # provided by libdrm-dev
}
sha512sums="
53b80d1027c6df6a4f13237a21a3ea69bfe51ba12dd4bf4e984da29150e457fea6fdc493542e4b86a04a9ba1481ae0db866bd883767f7107c323b41fb9fe022c linux-5.10.55.tar.xz
"

View File

@ -34,9 +34,6 @@ _kabi= _klocalver= _kconfig= _kbdmain= _kbddev= _kflavor=
_kdir_src="$srcdir/linux-$pkgver"
arch="noarch"
subpackages="
$pkgname-$_ksupport-headers:_pkg_header:$CBUILD_ARCH
"
_depends_dev="
perl
gmp-dev
@ -48,10 +45,9 @@ _depends_dev="
makedepends="
$_depends_dev
sed
linux-headers
installkernel
bc
linux-headers
linux-firmware-any
openssl-dev
diffutils
findutils
@ -126,7 +122,7 @@ prepare() {
make -C "$_kdir_src" \
O="$_kbuilddir" \
ARCH="$_carch" \
listnewconfig oldconfig
olddefconfig
done
done
@ -242,25 +238,6 @@ _pkg_extmod() {
ln -sf "/usr/src/linux-headers-$_kabi" "$_builddir"/build
}
_pkg_header() {
provides="linux-headers=$pkgver-r$pkgrel"
_spvars
_bvars
local _outdir="$subpkgdir/usr"
mkdir -p "$_outdir"
cd "$_kdir_src"
make headers_install \
ARCH="$_carch" \
INSTALL_HDR_PATH="$_outdir"
rm -f **/.install **/install.cmd
rm -rf "$_outdir/include/drm" # provided by libdrm-dev
}
sha512sums="
53b80d1027c6df6a4f13237a21a3ea69bfe51ba12dd4bf4e984da29150e457fea6fdc493542e4b86a04a9ba1481ae0db866bd883767f7107c323b41fb9fe022c linux-5.10.55.tar.xz
7ae670f2dbbdec616becce3944fe190a797a19346b4fa266deae71d4c1ccd7b0e60e400bde47d32261cb15c1b2f1579a2848adace3397d82552c52bff1421f0a config-full.aarch64