pmaports/hybris/libhybris/APKBUILD
Alexey Min 4e0132a4f6
hybris/libhybris: Fix eglplatform_wayland linking issue (!589)
It should not directly call functions from hybris's libEGL,
because it is not linking to libEGL. Load libEGL dynamically
and resolve function at run time instead.

Related: https://github.com/libhybris/libhybris/pull/424
[ci:skip-build]: already built successfully in CI
2019-09-03 23:10:58 +02:00

176 lines
6 KiB
Text

pkgname=libhybris
pkgver=1.0_git20190508
pkgrel=3
arch="x86 armhf armv7 aarch64"
url="https://github.com/libhybris/libhybris"
license="Apache"
makedepends="autoconf automake libtool wayland-dev linux-headers bsd-compat-headers
libx11-dev libxcb-dev libxext-dev
android-headers-7.1 android-headers-4.4"
depends_dev="bsd-compat-headers android-headers-7.1"
_commit="8ddb15b53d6a63b1545bbf97d00ea93827bd68eb"
source="$pkgname-$_commit.tar.gz::https://github.com/libhybris/libhybris/archive/$_commit.tar.gz
0001-Make-libhybris-compile-with-musl.patch
0002-tests-Regression-test-for-EGL-glibc-TLS-conflict.patch
0003-PATCH-v2-Implement-X11-EGL-platform-based-on-wayland.patch
0004-Build-test-hwcomposer-7-caf.patch
0005-eglplatform_wayland-link-libEGL-at-runtime.patch
"
pkgdesc="libhybris allows to use bionic-based HW adaptations"
subpackages="$pkgname-dev $pkgname-egl $pkgname-gles $pkgname-libwayland-egl:_wayland
$pkgname-7.1:_specific $pkgname-4.4:_specific"
if [ "$CARCH" == "aarch64" ]; then
subpackages="$pkgname-dev $pkgname-egl $pkgname-gles $pkgname-libwayland-egl:_wayland
$pkgname-7.1:_specific"
elif [ "$CARCH" == "x86" ]; then
subpackages="$pkgname-dev $pkgname-egl $pkgname-gles $pkgname-libwayland-egl:_wayland
$pkgname-7.1:_specific $pkgname-4.4:_specific"
fi
options="!check !strip !tracedeps"
builddir="$srcdir/$pkgname-$_commit"
_tmppkgdir="$srcdir/tmpinstall"
_main_headers_ver=7.1
_bins_specific="test_audio test_camera test_egl_configs test_gps
test_hwcomposer test_hwcomposer_7_caf test_input test_lights test_media test_nfc
test_recorder test_sensors test_sf test_vibrator test_wifi"
_libs_specific="libcamera.so.1.0.0 libhardware.so.2.0.0
libhybris-common.so.1.0.0 libhybris-eglplatformcommon.so.1.0.0
libhybris-hwcomposerwindow.so.1.0.0 libis.so.1.0.0 libmedia.so.1
libmedia.so.1.0.0 libnfc_ndef_nxp.so.1.0.0 libnfc_nxp.so.1.0.0
libsf.so.1.0.0 libsync.so.2.0.0 libui.so.1.0.0 libvibrator.so.1.0.0
libwifi.so.1.0.0
libhybris/eglplatform_fbdev.so libhybris/eglplatform_hwcomposer.so
libhybris/eglplatform_null.so libhybris/eglplatform_wayland.so
libhybris/eglplatform_x11.so"
build() {
cd "$builddir/hybris"
NOCONFIGURE=1 ./autogen.sh
if [ "$CARCH" == "armhf" -o "$CARCH" == "armv7" ]; then
_vers="7.1 4.4"
_ldpath="/usr/libexec/droid-hybris/system/lib:/vendor/lib:/system/lib"
_arch="arm"
_enable_quirks="--enable-mali-quirks \
--enable-adreno-quirks"
elif [ "$CARCH" == "aarch64" ]; then
_vers="7.1"
_ldpath="/usr/libexec/droid-hybris/system/lib64:/vendor/lib64:/system/lib64"
_arch="arm64"
_enable_quirks="--enable-mali-quirks \
--enable-adreno-quirks"
elif [ "$CARCH" == "x86" ]; then
_vers="7.1 4.4"
_ldpath="/usr/libexec/droid-hybris/system/lib:/vendor/lib:/system/lib"
_arch="x86"
fi
for _headers_ver in $_vers; do
msg "building $pkgname-$_headers_ver"
./configure \
--prefix=/usr \
--enable-wayland \
--enable-trace \
--enable-debug \
--enable-experimental \
--with-android-headers=/usr/include/android-$_headers_ver \
--with-default-hybris-ld-library-path=$_ldpath \
--enable-arch=$_arch \
$_enable_quirks \
--enable-property-cache
make clean
make DESTDIR="${_tmppkgdir}/$pkgname-$_headers_ver" install
done
}
package() {
cd "$builddir/hybris"
# make DESTDIR="${pkgdir}" install
mkdir -p "${pkgdir}"
cp -a ${_tmppkgdir}/$pkgname-$_main_headers_ver/* "${pkgdir}"
for _bin in ${_bins_specific}; do
rm "${pkgdir}/usr/bin/${_bin}" || true
done
for _lib in ${_libs_specific}; do
rm "${pkgdir}/usr/lib/${_lib}"
done
}
_specific() {
depends="$pkgname"
for _bin in ${_bins_specific}; do
install -Dm755 "${_tmppkgdir}/${subpkgname}/usr/bin/${_bin}" \
"${subpkgdir}/usr/bin/${_bin}" || true
done
for _lib in ${_libs_specific}; do
install -Dm755 "${_tmppkgdir}/${subpkgname}/usr/lib/${_lib}" \
"${subpkgdir}/usr/lib/${_lib}"
done
}
egl() {
depends="$pkgname"
pkgdesc="libhybris libEGL runtime libraries"
install="$subpkgname.post-install"
install -d "$subpkgdir"/usr/lib/libhybris-egl
mv "$pkgdir"/usr/lib/libEGL.so.* \
"$subpkgdir"/usr/lib/libhybris-egl/
}
gles() {
depends="$pkgname"
pkgdesc="libhybris libGLESv2 runtime libraries"
install -d "$subpkgdir"/usr/lib/libhybris-egl
mv "$pkgdir"/usr/lib/libGLES*.so.* \
"$subpkgdir"/usr/lib/libhybris-egl/
}
_wayland() {
depends="$pkgname"
pkgdesc="libhybris libwayland-egl library"
mkdir -p "$subpkgdir"/usr/lib/libhybris-egl
mv "$pkgdir"/usr/lib/libwayland-egl.so.* "$subpkgdir"/usr/lib/libhybris-egl/ \
|| return 1
}
dev() {
default_dev
# Avoid conflicts with mesa-dev
install -d "$subpkgdir"/usr/lib/libhybris-egl
mv "$subpkgdir"/usr/lib/lib*GL*.so "$subpkgdir"/usr/lib/libhybris-egl
mv "$subpkgdir"/usr/lib/libwayland-egl.so "$subpkgdir"/usr/lib/libhybris-egl
cd "$subpkgdir"/usr/lib/pkgconfig
rm -f egl.pc glesv*.pc wayland-egl.pc
cd "$subpkgdir"/usr/include
# Move libhybris-provided headers into hybris dir
mv CL EGL GLES GLES2 KHR VG hybris
# Symlink eglhybris.h
mkdir -p EGL
cd EGL
ln -s ../hybris/EGL/eglhybris.h .
}
sha512sums="681e8345ba56d5b9684ab3901c9cfdc6d4f48f55ef97611eef14d9471f08f1c0f60803298224df5110f2a3d08da145a61e38ea241585bc07e30cb48a893dc92b libhybris-8ddb15b53d6a63b1545bbf97d00ea93827bd68eb.tar.gz
9f7a324f18332e44f8789108e32f0587c268d10adaee0040c42d1bece7ab58e292d68243e7814f34f37b3b5dff590758269e531b4f2fd1991334eda4333f5854 0001-Make-libhybris-compile-with-musl.patch
1355a4403d1af8bdf75b9e4502cbfc093b9788224ce7c24a1f6a53dd7996d385d31a3362577a4293db6b6d0dd0ae4e88140b38c658ff0a288d9acfc2753859bb 0002-tests-Regression-test-for-EGL-glibc-TLS-conflict.patch
db7bb0ffc04042b32d870db364df4d38d9769978f26d71f98dd2569b4cae7fb3839c7a0c421b465f931a57fcde38b8eca091b7ae0062e32a7e09b93a701397f3 0003-PATCH-v2-Implement-X11-EGL-platform-based-on-wayland.patch
eda57804fefa1d586e90fb2198c310f65e6dbc7e09b5d1dd7d15df4ab152c4c8915c212230a92c35ec8a013d3ec7a7b1d289653bedb46b7eb2850a477ccebe16 0004-Build-test-hwcomposer-7-caf.patch
39cfd9db2bcd77615de7370e0df861ce61a7025d1b39fd049d27f345643626bbe5253515a876f606fc86b678cb85f8634a9df663b5b32a90fa53b37136d25814 0005-eglplatform_wayland-link-libEGL-at-runtime.patch"