pmaports/hybris/android-headers-7.1/APKBUILD
NotKit c9b6e30e76 Package libhybris (#1402)
As discussed in #1039, I want to split feature/hybris branch into
smaller sensible pull requests.

This is the first one that simply adds android-headers and libhybris
packaging. libhybris allows apps compiled with glibc (musl in our case)
to load Android libraries that utilize bionic libc, which is used to
load proprietary userspace drivers.

The package isn't very useful on its own and requires core (non-UI/Java)
Android services to be running in some way - either in Halium-style LXC
container or in same root as main OS with modified init (Mer/Sailfish do
it this way). Both ways are tested to work in postmarketOS.

libhybris also includes some tests, not all of them are known to be
representative, but test_vibrator and test_egl_configs are usually good
indicators if system is set up correctly.
2018-04-10 21:13:42 +00:00

39 lines
1.5 KiB
Text

pkgname=android-headers-7.1
_pkgname=android-headers
pkgver=7.1_git20170630
_pkgver=7.1
pkgrel=0
arch="noarch"
url="https://github.com/Halium/android-headers"
license="Apache"
makedepends=""
depends=""
_rev=1f6591ba7d42b91c32acf5a65a2a4fae983d6865
source="$pkgname-$_rev.tar.gz::https://github.com/Halium/android-headers/archive/$_rev.tar.gz"
pkgdesc="Android headers used for building libhybris"
subpackages="$pkgname-caf:package_caf"
builddir="$srcdir/$_pkgname-$_rev"
package() {
cd "$builddir"
make PREFIX=/usr DESTDIR="${pkgdir}" install
mv ${pkgdir}/usr/include/android ${pkgdir}/usr/include/android-$_pkgver
sed -i "s~${includedir}/android~${includedir}/android-$_pkgver~g" ${pkgdir}/usr/lib/pkgconfig/android-headers.pc
mv "${pkgdir}/usr/lib/pkgconfig/android-headers.pc" "${pkgdir}/usr/lib/pkgconfig/android-headers-$_pkgver.pc"
}
package_caf() {
cd "$builddir"
sed -i 's~/\* CONFIG GOES HERE \*/~#define QCOM_BSP 1\n#define QTI_BSP 1~g' android-config.h
make PREFIX=/usr DESTDIR="${subpkgdir}" install
mv ${subpkgdir}/usr/include/android ${subpkgdir}/usr/include/android-$_pkgver-caf
sed -i "s~${includedir}/android~${includedir}/android-$_pkgver-caf~g" ${subpkgdir}/usr/lib/pkgconfig/android-headers.pc
mv "${subpkgdir}/usr/lib/pkgconfig/android-headers.pc" "${subpkgdir}/usr/lib/pkgconfig/android-headers-$_pkgver-caf.pc"
}
sha512sums="652641b469f7faf90c7adf03b14047f9eb24fdb190d9ab131d72f73b2d9357aad80cad48867ede66b0a737661cfb9e26fb4583b9fed15b8d6d667fe53ea14419 android-headers-7.1-1f6591ba7d42b91c32acf5a65a2a4fae983d6865.tar.gz"