pmaports/device/testing/linux-sony-nicki-mainline/APKBUILD
Luca Weiss 81f8ca8e77
device/testing/linux-*: get building again (MR 1684)
Mostly the GCC10 yylloc failure was seen but several others have been
observed:

* wireguard script was silently failing
* several gcc10 x86 errors
* a checksum from kernel.org has changed

Now we have 3 different gcc10 yylloc patches:

gcc10-extern_YYLOC_global_declaration.patch:
    Linux < 4.2

linux4.2-gcc10-extern_YYLOC_global_declaration.patch:
    Linux 4.2+

linux4.17-gcc10-extern_YYLOC_global_declaration.patch:
    Linux 4.17+

[ci:skip-build]
[ci:ignore-count]
[ci:skip-vercheck]
2020-11-05 09:55:11 +01:00

111 lines
3 KiB
Text

# Kernel config based on: arch/arm/configs/qcom_defconfig
# APKBUILD based on linux-postmarketos-mainline
# See: https://gitlab.com/postmarketOS/pmaports/issues/184
_flavor=sony-nicki-mainline
_config="config-$_flavor.$CARCH"
pkgname=linux-$_flavor
pkgver=5.3
_pkgver=${pkgver/_/-}
_kernver=${pkgver%_rc*}
_mainver=${_kernver%.*}
_patchlevel=${_kernver/$_mainver./}
_basever=$_mainver.$((_patchlevel-1))
pkgrel=3
arch="armv7"
pkgdesc="Sony Xperia M kernel fork, close to mainline"
url="https://kernel.org/"
makedepends="perl sed installkernel bash gmp-dev bc linux-headers elfutils-dev openssl-dev file bison flex"
options="!strip !check !tracedeps pmb:cross-native"
_repository="linux"
_commit="ad6ab7f8c57896cb3829e6a80408e0912d6096c2"
source="
$pkgname-$_commit.tar.gz::https://github.com/konradybcio/$_repository/archive/$_commit.tar.gz
config-$_flavor.armv7
linux4.17-gcc10-extern_YYLOC_global_declaration.patch
"
license="GPL2"
_abi_release=$_pkgver
_carch=$CARCH
case "$_carch" in
aarch64*) _carch="arm64" ;;
arm*) _carch="arm" ;;
ppc*) _carch="powerpc" ;;
s390*) _carch="s390" ;;
esac
builddir="$srcdir/linux-$_commit"
prepare() {
local _patch_failed=
# first apply patches in specified order
for i in $source; do
case $i in
*.patch|*.patch::*)
_patch=${i%::*}
msg "Applying $_patch..."
if ! patch -s -p1 -N -i "$srcdir"/$_patch; then
echo $_patch >>failed
_patch_failed=1
fi
;;
esac
done
if ! [ -z "$_patch_failed" ]; then
error "The following patches failed:"
cat failed
return 1
fi
mkdir -p "$srcdir"/build
cp -v "$srcdir"/$_config "$srcdir"/build/.config
make -C "$builddir" O="$srcdir"/build ARCH="$_carch" \
olddefconfig
}
build() {
cd "$srcdir"/build
unset LDFLAGS
make ARCH="$_carch" CC="${CC:-gcc}" \
KBUILD_BUILD_VERSION="$((pkgrel + 1 ))-$_flavor" \
CFLAGS_MODULE=-fno-pic
}
package() {
cd "$srcdir/build/arch/$_carch/boot"
if [ "$CARCH" == "aarch64" ]; then
install -Dm644 "$srcdir/build/arch/$_carch/boot/Image.gz" \
"$pkgdir/boot/vmlinuz-$_flavor"
else
install -Dm644 "$srcdir/build/arch/$_carch/boot/"*zImage \
"$pkgdir/boot/vmlinuz-$_flavor"
fi
install -D "$srcdir/build/include/config/kernel.release" \
"$pkgdir/usr/share/kernel/$_flavor/kernel.release"
cd "$srcdir"/build
local _install
case "$CARCH" in
aarch64*|arm*) _install="modules_install dtbs_install" ;;
*) _install="modules_install" ;;
esac
make -j1 $_install \
ARCH="$_carch" \
INSTALL_MOD_PATH="$pkgdir" \
INSTALL_DTBS_PATH="$pkgdir/usr/share/dtb"
}
sha512sums="31e9ef9b3e956df38824865c291530fa5dda067bfea8b0169a3871d7876cfe192a42ae631e51a8a02f7c64319269c8af2688d8ae180805173bf2c1c84c390a59 linux-sony-nicki-mainline-ad6ab7f8c57896cb3829e6a80408e0912d6096c2.tar.gz
8d13767d289c02ebe60fa0a1699599544450c181d256f8bca5d5e4a71b4aa88f93ae47f801f7c4df9c922b51cc1d3a43814c973bee22cce810e77c3b6bf5f600 config-sony-nicki-mainline.armv7
27827877040007fc1c4c719f7e2e19e5c272d44972415cfc53feba0313d87e4074f8204bdb13cbc5fe21ea61bf595314b68f10c081e7b7bac3c888b60f008acf linux4.17-gcc10-extern_YYLOC_global_declaration.patch"