pmaports/device/community/linux-purism-librem5/APKBUILD

54 lines
1.8 KiB
Text

# Reference: <https://postmarketos.org/vendorkernel>
# Maintainer: Clayton Craft <clayton@craftyguy.net>
pkgname=linux-purism-librem5
# Note: _p#, where # is the purism version, e.g. the '2' in 'librem5.2'
pkgver=5.7.7_p1
pkgrel=0
_kernver=${pkgver%_p*}
_purismrel=${pkgver#*_p}
# <kernel ver>.<purism kernel release>
_purismver=${_kernver}+librem5.$_purismrel
pkgdesc="Purism Librem 5 phone kernel fork"
arch="aarch64"
_carch="arm64"
_flavor="purism-librem5"
url="https://source.puri.sm/Librem5/linux-next"
license="GPL-2.0-only"
options="!strip !check !tracedeps pmb:cross-native"
makedepends="perl sed installkernel bash gmp-dev bc linux-headers elfutils-dev
devicepkg-dev bison flex openssl-dev"
# Source
_repository="linux-next"
# kconfig generated with: ARCH=arm64 make defconfig KBUILD_DEFCONFIG=librem5_defconfig
_config="config-$_flavor.$arch"
source="
$pkgname-$_purismver.tar.gz::https://source.puri.sm/Librem5/$_repository/-/archive/pureos/$_purismver/$_repository-pureos-$_purismver.tar.gz
$_config
"
builddir="$srcdir/$_repository-pureos-$_purismver"
prepare() {
default_prepare
REPLACE_GCCH=0 \
. downstreamkernel_prepare
}
build() {
unset LDFLAGS
make ARCH="$_carch" CC="${CC:-gcc}" \
KBUILD_BUILD_VERSION="$((pkgrel + 1 ))-postmarketOS" \
LOCALVERSION=".$_purismrel"
}
package() {
downstreamkernel_package "$builddir" "$pkgdir" "$_carch" "$_flavor"
make modules_install dtbs_install \
ARCH="$_carch" \
INSTALL_MOD_PATH="$pkgdir" \
INSTALL_DTBS_PATH="$pkgdir/usr/share/dtb"
}
sha512sums="d28a731066c9fd76fdb13b194affc83f96c5a550481ba9288b612c133193e897b1ead5b4d54124caa65f6517bf4dcd2939b064e04eab30dfe462ba4b8dc06f4c linux-purism-librem5-5.7.7+librem5.1.tar.gz
052ae949b6f5a670d186bc04edcc687e01a4d32f2c7b05a59847405c608dbc48256a51512852e888a302dd40433d3c46719274e89a0dd85dec4ff8b8c414b168 config-purism-librem5.aarch64"