aboutsummaryrefslogtreecommitdiffstats
path: root/main/linux-headers/APKBUILD
blob: dd5ccc84a0970a7e19048691cb44f6d4bfedb973 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=linux-headers
pkgver=5.4.5
_kernver=${pkgver%.*}
pkgrel=0
pkgdesc="Linux system headers"
url="http://kernel.org"
arch="all"
license="GPL-2.0-only"
makedepends="perl rsync"
options="!check !dbg !strip !tracedeps"
source="https://kernel.org/pub/linux/kernel/v5.x/linux-$_kernver.tar.xz
	https://kernel.org/pub/linux/kernel/v5.x/patch-$pkgver.xz
	revert-broken-uapi.patch
	0003-remove-inclusion-of-sysinfo.h-in-kernel.h.patch
	"

prepare() {
	cd "$srcdir"/linux-$_kernver
	if [ "$_kernver" != "$pkgver" ]; then
		unxz -c < "$srcdir"/patch-$pkgver.xz | patch -p1 || return 1
	fi
	for i in $source; do
		case $i in
		*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
		esac
	done
}

build() {
	return 0
}

package() {
	local _carch=$CARCH

	case "$_carch" in
	aarch64*) _carch="arm64" ;;
	arm*) _carch="arm" ;;
	mips*) _carch="mips" ;;
	s390*) _carch="s390" ;;
	ppc*) _carch="powerpc" ;;
# not sure about this --	ppc64*) _carch="powerpc64" ;;
	esac

	cd "$srcdir"/linux-$_kernver
	mkdir -p "$pkgdir/usr"
	make headers_install ARCH="${_carch}" INSTALL_HDR_PATH="$pkgdir/usr" || return 1

	find "$pkgdir/usr" \( -name .install -o -name ..install.cmd \) -exec \
		rm -f {} \;

	# provided by libdrm
	rm -rf "$pkgdir"/usr/include/drm
}

sha512sums="9f60f77e8ab972b9438ac648bed17551c8491d6585a5e85f694b2eaa4c623fbc61eb18419b2656b6795eac5deec0edaa04547fc6723fbda52256bd7f3486898f  linux-5.4.tar.xz
5c33d5db4d6787d7841a82dd8dc5b38dd80c5706bdaf9bd331e82173302a4cf3bc9c5e1d00f489d3d78b54bc1f8f82f34df2fcd47b1ab4ffb0a01dc7bdc06cff  patch-5.4.5.xz
32597f2672d1ec365a936d15041a7cf219ef9353241d4a5c378244cf2fc155610443a19bbcd391c86099a0b08486c45e042ec7c90b0d04fe675c3ad0ffc36b53  revert-broken-uapi.patch
302283b1b5f560c850e24aad73febcf7f906ed62b4cad2d826bf140ffe59191631f3cd4ac29525c349cdfe61aba6a47886a0d76f1c6a4a16b744d59b94ea5df8  0003-remove-inclusion-of-sysinfo.h-in-kernel.h.patch"