pmaports/device/linux-htc-bravo/APKBUILD

110 lines
3 KiB
Text
Raw Normal View History

# APKBUILD based on linux-vanilla aport. Changes:
# - disabled module installation
# - add !check !tracedeps
# - add xz package (necessary to build)
#
# Kernel config based on: arch/arm/configs/bravo_defconfig
# Changes:
# - apply patches to compile with gcc6
# - enable devtmpfs (needed for udev -> touch support in weston)
# - enable udev required options (https://wiki.gentoo.org/wiki/Udev#Kernel)
_vendor=htc
_flavor=htc-bravo
_config="config-${_flavor}.armhf"
_hash="4bc19919f805777947c243e6c2ed41ece530488b"
pkgname=linux-${_flavor}
pkgver=3.0.16
case $pkgver in
*.*.*) _kernver=${pkgver%.*};;
*.*) _kernver=$pkgver;;
esac
pkgrel=2
arch="armhf"
pkgdesc="HTC Desire kernel from spezi77"
url="https://github.com/spezi77/android_kernel_htc_qsd8k_3.0"
depends="postmarketos-mkinitfs"
makedepends="perl sed installkernel bash gmp-dev bc linux-headers elfutils-dev xz"
options="!strip !check !tracedeps"
install=
source="
$pkgname-$_hash.tar.gz::https://github.com/spezi77/android_kernel_htc_qsd8k_3.0/archive/${_hash}.tar.gz
$_config
compiler-gcc6.h
"
subpackages=""
license="GPL2"
_abi_release=${pkgver}
_carch="arm"
HOSTCC="${CC:-gcc}"
HOSTCC="${HOSTCC#${CROSS_COMPILE}}"
ksrcdir="$srcdir/android_kernel_htc_qsd8k_3.0-${_hash}"
prepare() {
local _patch_failed=
cd "$ksrcdir"
# first apply patches in specified order
for i in $source; do
case $i in
*.patch)
msg "Applying $i..."
if ! patch -s -p1 -N -i "$srcdir"/$i; then
echo $i >>failed
_patch_failed=1
fi
;;
esac
done
if ! [ -z "$_patch_failed" ]; then
error "The following patches failed:"
cat failed
return 1
fi
# gcc6 support
cp -v "$srcdir/compiler-gcc6.h" "$ksrcdir/include/linux/" || return 1
mkdir -p "$srcdir"/build
cp "$srcdir"/$_config "$srcdir"/build/.config || return 1
yes "" | make -C "$ksrcdir" O="$srcdir"/build ARCH="$_carch" HOSTCC="$HOSTCC" \
oldconfig
}
# this is so we can do: 'abuild menuconfig' to reconfigure kernel
menuconfig() {
cd "$srcdir"/build || return 1
echo "--[ menuconfig ]--"
make ARCH="$_carch" menuconfig
cp .config "$startdir"/$_config
}
build() {
cd "$srcdir"/build
unset LDFLAGS
echo "--[ Build kernel + modules ]--"
make ARCH="$_carch" CC="${CC:-gcc}" \
KBUILD_BUILD_VERSION="$((pkgrel + 1 ))-Alpine" \
|| return 1
}
package() {
echo "--[ Installing kernel ]--"
install -Dm644 "$srcdir/build/arch/arm/boot/zImage" \
"$pkgdir/boot/vmlinuz-$_flavor"
install -D "$srcdir/build/include/config/kernel.release" \
"$pkgdir/usr/share/kernel/$_flavor/kernel.release"
}
sha512sums="4abb6444181ac280a095f226e7789f16ec2060b6b5050c00a28c025a570edecf44a9f25c86775db6d21c572bded00b2fe14461666a8fb06a2672e09195b9e40a linux-htc-bravo-4bc19919f805777947c243e6c2ed41ece530488b.tar.gz
27ec53afdd9898495ae296b8e98b05401aae3a0bf390ba276f6a878d6bf1ccf3f59da78a5ee50ba4ee0744e4768f71aab53b782511c4f8ad22fefc821a2c815c config-htc-bravo.armhf
d80980e9474c82ba0ef1a6903b434d8bd1b092c40367ba543e72d2c119301c8b2d05265740e4104ca1ac5d15f6c4aa49e8776cb44264a9a28dc551e0d1850dcc compiler-gcc6.h"