pmaports/device/linux-chuwi-hi10plus/APKBUILD

84 lines
2.7 KiB
Text
Raw Normal View History

# Reference: <https://postmarketos.org/vendorkernel>
# Kernel config based on: <https://git.archlinux.org/svntogit/packages.git/plain/trunk/config?h=packages/linux>
pkgname="linux-chuwi-hi10plus"
pkgver=5.1.5
pkgrel=0
pkgdesc="Chuwi Hi10 Plus stable kernel"
arch="x86_64"
_carch="x86"
_flavor="chuwi-hi10plus"
url="https://kernel.org"
license="GPL-2.0-only"
options="!strip !check !tracedeps !pmb:kconfigcheck"
makedepends="perl sed installkernel bash gmp-dev bc linux-headers elfutils-dev
devicepkg-dev bison flex openssl-dev xz coreutils findutils"
subpackages="$pkgname-dev"
# Compiler: latest GCC from Alpine
HOSTCC="${CC:-gcc}"
HOSTCC="${HOSTCC#${CROSS_COMPILE}}"
# Source
_config="config-${_flavor}.${arch}"
source="
$pkgname-$pkgver.tar.gz::https://cdn.kernel.org/pub/linux/kernel/v${pkgver%%.*}.x/linux-$pkgver.tar.gz
$_config
input-silead-Add-MSSL0017-to-acpi_device_id.patch
platform-x86-touchscreen_dmi-Add-info-for-the-CHUWI-.patch
"
builddir="$srcdir/linux-$pkgver"
prepare() {
default_prepare
REPLACE_GCCH=0 \
downstreamkernel_prepare "$srcdir" "$builddir" "$_config" "$_carch" "$HOSTCC"
}
build() {
unset LDFLAGS
make ARCH="$_carch" CC="${CC:-gcc}" \
KBUILD_BUILD_VERSION="$((pkgrel + 1 ))-postmarketOS"
}
package() {
# kernel.release
install -D "$builddir/include/config/kernel.release" \
"$pkgdir/usr/share/kernel/$_flavor/kernel.release"
# zImage (find the right one)
cd "$builddir/arch/$_carch/boot"
_target="$pkgdir/boot/vmlinuz-$_flavor"
for _zimg in zImage-dtb Image.gz-dtb *zImage Image; do
[ -e "$_zimg" ] || continue
msg "zImage found: $_zimg"
install -Dm644 "$_zimg" "$_target"
break
done
if ! [ -e "$_target" ]; then
error "Could not find zImage in $PWD!"
return 1
fi
cd "$builddir"
make -j1 modules_install \
ARCH="$_carch" \
INSTALL_MOD_PATH="$pkgdir" \
INSTALL_DTBS_PATH="$pkgdir/usr/share/dtb"
}
dev() {
cd $builddir
# https://github.com/torvalds/linux/blob/master/Documentation/kbuild/headers_install.txt
make -j1 headers_install \
ARCH="$_carch" \
INSTALL_HDR_PATH="$subpkgdir"/usr
}
sha512sums="bd1e61520c88e66064aba04ec3e5dbbc7c3c5d2c8685a33715adca5b8989cf3cab76a705fbb913389a2ef00f70b00b602c24dfe6ffa1076c83e534d07d0723ff linux-chuwi-hi10plus-5.1.5.tar.gz
4378e9e6b087f354fc61a747c9f7be4ee0b40b29aac78351641b2548406f1f576d2bc8422ed17b33680fe590ad9cc33ca5603ad2d119610e4cbfe8707783be3b config-chuwi-hi10plus.x86_64
cffb4b1dc204a15697aa26749df49b3f450de808cb630cf53d4718d933031a42789b79e94d39a9fe44a75e385f609c70aa8ccfb2e91e4fe473e0ee5245146c66 input-silead-Add-MSSL0017-to-acpi_device_id.patch
b97509150d4061001e90e1a595723c479252647b5f94f50b7be0673d11556b28a90fa0afff9f0961a4512c3cbc8d4b02b827e75f75385cbb3ad63b378f3931e3 platform-x86-touchscreen_dmi-Add-info-for-the-CHUWI-.patch"