pmaports/main/linux-postmarketos-qcom-sdm845/APKBUILD

61 lines
2 KiB
Text

# Maintainer: Caleb Connolly <caleb@connolly.tech>
# Co-Maintainer: Joel Selvaraj <jo@jsfamily.in>
# Stable Linux kernel with patches for SDM845 devices
# Kernel config based on: arch/arm64/configs/defconfig and sdm845.config
_flavor="postmarketos-qcom-sdm845"
pkgname=linux-$_flavor
pkgver=5.12
pkgrel=0
pkgdesc="Mainline Kernel fork for SDM845 devices"
arch="aarch64"
_carch="arm64"
url="https://gitlab.com/sdm845-mainline/sdm845-linux"
license="GPL-2.0-only"
options="!strip !check !tracedeps pmb:cross-native"
makedepends="bison findutils flex installkernel openssl-dev perl"
_repo="sdm845-linux"
_config="config-$_flavor.$arch"
_commit="b7a1e57f78d690d02aff902114bf2f6ca978ecfe"
# Source
source="
$_repo-$_commit.tar.gz::https://gitlab.com/sdm845-mainline/$_repo/-/archive/$_commit/$_repo-$_commit.tar.gz
$_config
"
builddir="$srcdir/$_repo-$_commit"
prepare() {
default_prepare
cp "$srcdir/config-$_flavor.$arch" .config
}
build() {
unset LDFLAGS
make ARCH="$_carch" CC="${CC:-gcc}" \
KBUILD_BUILD_VERSION="$((pkgrel + 1 ))-$_flavor" \
# Workaround wrong LOCALVERSION causing weird errors
# if it doesn't match this, having to ensure it's
# correct in the kconfig doesn't make sense
LOCALVERSION="-$_flavor"
}
package() {
mkdir -p "$pkgdir"/boot
make zinstall modules_install dtbs_install \
ARCH="$_carch" \
INSTALL_PATH="$pkgdir"/boot/ \
INSTALL_MOD_PATH="$pkgdir" \
INSTALL_MOD_STRIP=1 \
INSTALL_DTBS_PATH="$pkgdir"/usr/share/dtb
rm -f "$pkgdir"/lib/modules/*/build "$pkgdir"/lib/modules/*/source
install -D "$builddir"/include/config/kernel.release \
"$pkgdir"/usr/share/kernel/$_flavor/kernel.release
}
sha512sums="
befc0ed82a30ee56360951a0983a45d8e09fe616aaf1948794ff8cdd7292bb88045a2a2c16d81251d18c49fb5a38e4cabca5d8caa6981f34b866fac921fb7623 sdm845-linux-b7a1e57f78d690d02aff902114bf2f6ca978ecfe.tar.gz
b223828ff0ba1610b231acc285db86626cb132a36da31c7a9f3ad4e1b7f113f4be5f58b1dbd1e4453a0d9a35d82d9086649b190fb528f83cc68a6484f636ca0c config-postmarketos-qcom-sdm845.aarch64
"