pmaports/device/community/linux-purism-librem5/APKBUILD
Stefan Hansson 7260bf9963
*/*: update my name and email
Let's finally be consistent about this.

[ci:skip-count]: Deliberately changing a lot of packages.
[ci:skip-vercheck]: Updating co-maintainer does not need a pkgrel bump.

Signed-off-by: Stefan Hansson <newbyte@postmarketos.org>
Part-of: <https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/8688>
2026-06-06 21:14:12 +02:00

96 lines
3 KiB
Text

# Reference: <https://postmarketos.org/vendorkernel>
# Co-Maintainer: Stefan Hansson <newbyte@postmarketos.org>
# Contributor: Clayton Craft <clayton@craftyguy.net>
maintainer="Alistair Francis <alistair@alistair23.me>"
pkgname=linux-purism-librem5
pkgver=6.6.118
pkgrel=1
# NOTE: Don't forget to rebase the config! See prepare() for instructions.
_purismrel=1
_pureosrel=cri1
# <kernel ver> + <purism kernel release> + <PureOS release>
_purismver=${pkgver}pureos${_purismrel}_$_pureosrel
pkgdesc="Purism Librem 5 phone kernel fork"
arch="aarch64"
_carch="arm64"
_flavor="purism-librem5"
url="https://source.puri.sm/Librem5/linux"
license="GPL-2.0-only"
options="!strip !check !tracedeps
pmb:cross-native
pmb:kconfigcheck-community
pmb:kconfigcheck-librem5
"
makedepends="
bash
bison
devicepkg-dev
findutils
flex
installkernel
openssl-dev
perl
rsync
xz
"
install="$pkgname.post-upgrade"
# Source
_repository="linux"
# 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/linux/-/archive/pureos/$_purismver/linux-pureos-$_purismver.tar.gz
$_config
"
builddir="$srcdir/$_repository-pureos-$_purismver"
prepare() {
default_prepare
REPLACE_GCCH=0 \
. downstreamkernel_prepare
####### Rebase config
# The kernel config needs to be periodically rebased to enable new
# modules/features that Purism has enabled in their defconfig. This is done
# by: 1) generate .config using librem5_defconfig, 2) diff that .config
# with the config in this package, 3) carefully going over the diff and
# selecting new things enabled in their config.
#
# This can be uncommented to help generate the defconfig using "pmbootstrap
# build linux-purism-librem5". The build will fail (exit 1) to let you grab
# the config before it starts building the kernel:
# make ARCH="$_carch" CC="${CC:-gcc}" \
# defconfig KBUILD_DEFCONFIG=librem5_defconfig
# exit 1
#
# After that run the following
# cp <chroot_native/home/pmos/build/src/linux-pureos-6.6.83pureos2_cri1/.config> \
# device/community/linux-purism-librem5/config-purism-librem5.aarch64
# pmbootstrap kconfig edit linux-purism-librem5
# pmbootstrap kconfig check linux-purism-librem5
}
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"/usr \
INSTALL_DTBS_PATH="$pkgdir/boot/dtbs"
}
sha512sums="
f1d75865ff15793e6e70414a356209bd27fdb4c084d773698589f2e376ddcf037f2ac60a131a72ad3986b51b88c0c738deb65169bb30fd472f25cb06327ed1a8 linux-purism-librem5-6.6.118pureos1_cri1.tar.gz
323e1d4760857c62efa67362b36b098f7fd2d6f49970236965cfab4bb8ae43ddbafa76f2fcd0deb8faa53e4b87bf202ab3507dc10f2364234af4c10453768337 config-purism-librem5.aarch64
"