pmaports/device/linux-asus-me176c/APKBUILD
Mis012 481bd4493b
asus-me176c: update kernel repository name (!251)
[ci:skip-build]: building takes longer than one hour
2019-03-25 09:50:30 +01:00

82 lines
2.7 KiB
Text

# Reference: <https://postmarketos.org/vendorkernel>
# Kernel config based on: https://github.com/me176c-dev/me176c-archlinux/blob/master/linux-me176c/config
pkgname="linux-asus-me176c"
pkgver=4.19.9
pkgrel=1
pkgdesc="Asus MeMo Pad 7 kernel fork"
arch="x86_64"
_carch="x86_64"
_flavor="asus-me176c"
url="https://kernel.org"
license="GPL-2.0-only"
options="!strip !check !tracedeps"
makedepends="perl sed installkernel bash gmp-dev bc linux-headers elfutils-dev devicepkg-dev bison flex libressl-dev iasl xz"
# Compiler: latest GCC from Alpine
HOSTCC="${CC:-gcc}"
HOSTCC="${HOSTCC#${CROSS_COMPILE}}"
# Source
_repository="linux-me176c"
_commit="961c8ea95f2febdaceb2d31940b48932aea0e782"
_dsdt_commit="18a1fe0c450375c16e17429b429955e068f83945"
_config="config-${_flavor}.${arch}"
source="
$pkgname-$_commit.tar.gz::https://github.com/me176c-dev/${_repository}/archive/${_commit}.tar.gz
https://raw.githubusercontent.com/me176c-dev/me176c-acpi/${_dsdt_commit}/dsdt.dsl
$_config
"
builddir="$srcdir/${_repository}-${_commit}"
prepare() {
default_prepare
iasl -tc $srcdir/dsdt.dsl
sed -i s/dsdt_aml_code/AmlCode/ $srcdir/dsdt.hex
cp $srcdir/dsdt.hex $builddir/include/
# Remove -Werror from all makefiles
makefiles="$(find "$builddir" -type f -name Makefile)
$(find "$builddir" -type f -name Kbuild)"
for i in $makefiles; do
sed -i 's/-Werror-/-W/g' "$i"
sed -i 's/-Werror//g' "$i"
done
# Prepare kernel config ('yes ""' for kernels lacking olddefconfig)
cp "$srcdir/$_config" "$builddir"/.config
yes "" | make -C "$builddir" ARCH="$_carch" HOSTCC="$HOSTCC" oldconfig
}
build() {
unset LDFLAGS
make ARCH="$_carch" CC="${CC:-gcc}"
}
package() {
# kernel.release
install -D "$builddir/include/config/kernel.release" \
"$pkgdir/usr/share/kernel/$_flavor/kernel.release"
make ARCH="$_carch" CC="${CC:-gcc}" \
INSTALL_MOD_PATH="$pkgdir/" INSTALL_MOD_STRIP=1 modules_install
# 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
}
sha512sums="ad0a15e74e2a322fd119dbd159140b97f46e1770d41b1fa8469f529b117e0334f5a9a8c948b54b8f8aeea3d2424c910e17be4068bf17a6d3d571b52134105277 linux-asus-me176c-961c8ea95f2febdaceb2d31940b48932aea0e782.tar.gz
9f3d8691252dbbc06e8c9ce1f26aaf1803b5fe5647bee7ee80ca89d8bac52ec91bffeb629f41f0babad1b27a33bff766754ed151f2886684b0c6022c190b0907 dsdt.dsl
c2f1b5be9b58779f03cd2f063d5749b15fe28eb638987eff186b21b818aac2807a26eaee9d82f9c4c19848e06495c9bd290e2700348eb7bf7cc36688c88384fc config-asus-me176c.x86_64"