summaryrefslogtreecommitdiff
path: root/system/linux-headers/APKBUILD
blob: 7beaa22726913780ca9dd025fc37edd160d5f259 (plain) (blame)
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
# Maintainer: Adelie Platform Group <adelie-devel@lists.adelielinux.org>
pkgname=linux-headers
pkgver=4.14.48
pkgrel=8
pkgdesc="Linux system headers"
url="https://kernel.org"
arch="all"
options="!check !dbg !strip !tracedeps"  # Headers only
license="GPL-2.0-only"
makedepends="perl"
source="https://kernel.org/pub/linux/kernel/v4.x/linux-4.14.tar.xz
	https://distfiles.adelielinux.org/source/linux-4.14-mc$pkgrel.patch.xz
	revert-broken-uapi.patch
	"
builddir="$srcdir/linux-4.14"

prepare() {
	cd "$srcdir"
	cat linux-4.14-mc$pkgrel.patch.xz | unxz -> linux-4.14-mc$pkgrel.patch
	cd "$builddir"
	patch -Np1 <../linux-4.14-mc$pkgrel.patch
	for i in $source; do
		case $i in
		*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
		esac
	done
}

package() {
	local _carch=$CARCH

	case "$_carch" in
	aarch64*) _carch="arm64" ;;
	arm*) _carch="arm" ;;
	mips*) _carch="mips" ;;
	s390*) _carch="s390" ;;
	ppc*) _carch="powerpc" ;;
	pmmx) _carch="x86" ;;
	esac

	cd "$builddir"
	mkdir -p "$pkgdir/usr"
	make headers_install ARCH="${_carch}" INSTALL_HDR_PATH="$pkgdir/usr"

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

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

sha512sums="77e43a02d766c3d73b7e25c4aafb2e931d6b16e870510c22cef0cdb05c3acb7952b8908ebad12b10ef982c6efbe286364b1544586e715cf38390e483927904d8  linux-4.14.tar.xz
3fe2da1714cc83d909ba43d27c7f22ef4f2a6ecfd91ff81e0e141a0dd742ec78ad11392186871762f410615ae7c7f33dd814e0f194c7f7aed1dee2d9fca0252d  linux-4.14-mc8.patch.xz
32597f2672d1ec365a936d15041a7cf219ef9353241d4a5c378244cf2fc155610443a19bbcd391c86099a0b08486c45e042ec7c90b0d04fe675c3ad0ffc36b53  revert-broken-uapi.patch"