hybris: remove

Libhybris is failing to build for armhf too. Instead of adding !armhf
everywhere, let's just remove it: as it became clear in #703, nobody is
willing to put in the effort to maintain this properly.

If you would like to continue with libhybris on postmarketOS, please
create your own aports repository and put the aports there.

Related: https://wiki.postmarketos.org/wiki/Hybris
Closes: #703, #700, #678
This commit is contained in:
Oliver Smith 2020-08-03 10:02:02 +02:00
parent 124f740af8
commit e1a3324e5a
No known key found for this signature in database
GPG key ID: 5AE7F5513E0885CB
32 changed files with 0 additions and 3600 deletions

View file

@ -10,7 +10,6 @@ expected_directories = [
"device/community",
"device/main",
"device/testing",
"hybris",
"kde",
"maemo",
"main",

View file

@ -1,26 +0,0 @@
# Maintainer: TheKit <nekit1000@gmail.com>
pkgname=android-headers-4.4
_pkgname=android-headers
pkgver=4.4_git20171022
_pkgver=4.4
pkgrel=0
arch="aarch64 armhf armv7"
url="https://github.com/ubports/android-headers"
license="Apache-2.0"
_commit="f636fa26a61b36bef284a7aeba95eb767344b8b4"
source="$pkgname-$_commit.tar.gz::https://github.com/ubports/android-headers/archive/$_commit.tar.gz
android-headers.pc"
pkgdesc="Android headers used for building libhybris"
options="!check"
builddir="$srcdir/$_pkgname-$_commit"
package() {
mkdir -p "$pkgdir/usr/include"
cp -r "$builddir/19" "$pkgdir/usr/include/android-$_pkgver"
install -Dm644 "$srcdir/android-headers.pc" "$pkgdir/usr/lib/pkgconfig/android-headers-$_pkgver.pc"
}
sha512sums="c146753908ae0dd9aca0138a0a63e8578d65200d6d9b5154b846a0ac3309d9e33f6edddd92cd420e7b7dcaf73630546eb1bd45927cf8b4921f67dec7db7bb55c android-headers-4.4-f636fa26a61b36bef284a7aeba95eb767344b8b4.tar.gz
331f2670da9ce2690225694196265a55e2f41c35a1a12b71a75de3478b3b266c215be9bd451ab5ea13d4802e9f7d4e1bab8aa006d0df81fc264b2a132a022640 android-headers.pc"

View file

@ -1,9 +0,0 @@
Name: Android header files
Description: Header files needed to write applications for the Android platform
Version: 4.4
prefix=/usr
exec_prefix=${prefix}
includedir=${prefix}/include
Cflags: -I${includedir}/android-4.4

View file

@ -1,37 +0,0 @@
# Maintainer: TheKit <nekit1000@gmail.com>
pkgname=android-headers-7.1
_pkgname=android-headers
pkgver=7.1_git20170630
_pkgver=7.1
pkgrel=0
arch="aarch64 armhf armv7"
url="https://github.com/Halium/android-headers"
license="Apache-2.0"
_commit="1f6591ba7d42b91c32acf5a65a2a4fae983d6865"
source="$pkgname-$_commit.tar.gz::https://github.com/Halium/android-headers/archive/$_commit.tar.gz"
pkgdesc="Android headers used for building libhybris"
subpackages="$pkgname-caf:package_caf"
builddir="$srcdir/$_pkgname-$_commit"
package() {
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"

View file

@ -1,24 +0,0 @@
# Maintainer: TheKit <nekit1000@gmail.com>
pkgname=android-headers-9.0
_pkgname=android-headers
pkgver=9.0_git20190803
_pkgver=9.0
pkgrel=0
arch="aarch64 armhf armv7"
url="https://github.com/Halium/android-headers"
license="Apache-2.0"
_commit="00543b4ff3f56a9f96be336df276365aef46f8a2"
source="$pkgname-$_commit.tar.gz::https://github.com/Halium/android-headers/archive/$_commit.tar.gz"
pkgdesc="Android headers used for building libhybris"
builddir="$srcdir/$_pkgname-$_commit"
package() {
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"
}
sha512sums="9b2ab8d7ee56f8e5a875ed139814ed4f6171c3ccd1542a19b74a23cea0fd03ed9aa9b1ee70f2660d858dab891fc55681af6e7510f10995083d23a06a058e6d6d android-headers-9.0-00543b4ff3f56a9f96be336df276365aef46f8a2.tar.gz"

View file

@ -1,31 +0,0 @@
# Maintainer: TheKit <nekit1000@gmail.com>
pkgname=drihybris
pkgver=1.0_git20191009
pkgrel=0
_commit="6bc4f4a2c438ace0db4df2ccaae812465572a840"
pkgdesc="custom DRI3-based Xorg extension for use with libhybris"
url="https://github.com/NotKit/drihybris"
arch="armhf armv7 aarch64"
license="MIT"
subpackages="$pkgname-doc $pkgname-dev"
makedepends="autoconf automake libtool util-macros
xorg-server-dev libxi-dev"
source="$pkgname-$_commit.tar.gz::https://github.com/NotKit/drihybris/archive/$_commit.tar.gz"
options="!check" # no testsuite
builddir="$srcdir"/$pkgname-$_commit
build() {
export LDFLAGS="$LDFLAGS -Wl,-z,lazy"
./autogen.sh \
--build=$CBUILD \
--host=$CHOST \
--prefix=/usr \
make
}
package() {
make DESTDIR="$pkgdir" install
install -Dm644 COPYING "$pkgdir"/usr/share/licenses/$pkgname/COPYING
}
sha512sums="969f934d8d43acef879d534734b29357e68d23f6861e2dbc92a20a67b68507e8670bc99e8591eaa4df47640b774615ab64a4ee651eda81df7f112075cf370e75 drihybris-6bc4f4a2c438ace0db4df2ccaae812465572a840.tar.gz"

View file

@ -1,38 +0,0 @@
# Maintainer: TheKit <nekit1000@gmail.com>
pkgname=glamor-hybris
pkgver=1.0_git20191007
pkgrel=0
_commit="28f342f937a5f9a606273b48dcede7eefbab4bab"
pkgdesc="glamor Xserver 2D acceleration modified to work with libhybris drivers"
url="https://github.com/NotKit/glamor-hybris"
arch="armhf aarch64"
license="MIT"
subpackages="$pkgname-doc $pkgname-dev"
makedepends="autoconf automake util-macros libtool
xorg-server-dev libxi-dev fontsproto randrproto
videoproto renderproto drihybris-dev libepoxy-dev
libhybris-dev"
source="$pkgname-$_commit.tar.gz::https://github.com/NotKit/glamor-hybris/archive/$_commit.tar.gz"
options="!check" # no testsuite
builddir="$srcdir"/$pkgname-$_commit
build() {
export LDFLAGS="$LDFLAGS -Wl,-z,lazy"
export CPPFLAGS="$CPPFLAGS -I/usr/include/android-7.1"
./autogen.sh \
--build=$CBUILD \
--host=$CHOST \
--prefix=/usr \
--enable-glamor-gles2
make
}
package() {
make DESTDIR="$pkgdir" install
mv "$pkgdir/usr/include/xorg/glamor.h" "$pkgdir/usr/include/xorg/glamor-hybris.h"
install -Dm644 COPYING "$pkgdir"/usr/share/licenses/$pkgname/COPYING
}
sha512sums="49a323d40b56f15fe96a7371c864abc78669c7e58585d689c284127f1a01660504938e0dcf6e1199da4f6d382087232a00091d22efa5b12059867e45c301a584 glamor-hybris-28f342f937a5f9a606273b48dcede7eefbab4bab.tar.gz"

View file

@ -1,25 +0,0 @@
pkgname=hybris-base
pkgver=1.0
pkgrel=0
pkgdesc="Meta package to use libhybris adaptation"
url="https://postmarketos.org"
license="GPL-3.0-or-later"
options="!check"
# libhybris cannot be built for arch x86_64
arch="armhf aarch64"
depends="lxc-android libhybris libhybris-7.1 libhybris-egl libhybris-gles libhybris-libwayland-egl wayland-libs-client wayland-libs-server"
subpackages="$pkgname-x11-generic:x11_generic $pkgname-x11-caf:x11_caf"
package() {
mkdir -p "$pkgdir"
}
x11_generic() {
depends="xf86-video-hwcomposer xf86-video-hwcomposer-7.1"
mkdir -p "$subpkgdir"
}
x11_caf() {
depends="xf86-video-hwcomposer xf86-video-hwcomposer-7.1-caf"
mkdir -p "$subpkgdir"
}

View file

@ -1,698 +0,0 @@
From eb4efbb1320271a74cb1ee01dcdce3c088ce5abe Mon Sep 17 00:00:00 2001
From: NeKit <nekit1000@gmail.com>
Date: Wed, 1 Nov 2017 15:39:45 +0300
Subject: [PATCH 1/2] Make libhybris compile with musl
Hooks for some functions had to be disabled due to musl not having/exposing
them, which might lead to problems depending on how musl/bionic are
(in)compatible.
---
hybris/common/hooks.c | 44 +++++++++++++++++++
hybris/common/hooks_shm.c | 4 ++
hybris/common/jb/dlfcn.c | 4 ++
hybris/common/legacy_properties/properties.c | 3 ++
hybris/common/mm/bionic/libc/include/link.h | 1 +
.../mm/bionic/libc/private/libc_logging.h | 13 ++++++
hybris/common/mm/dlfcn.cpp | 4 ++
hybris/common/mm/hybris_compat.h | 11 +++++
hybris/common/mm/linker.cpp | 11 +++++
hybris/common/n/bionic/libc/include/dlfcn.h | 4 +-
hybris/common/n/bionic/libc/include/link.h | 1 +
.../n/bionic/libc/private/libc_logging.h | 15 ++++++-
hybris/common/n/dlfcn.cpp | 4 ++
hybris/common/n/hybris_compat.cpp | 8 ++++
hybris/common/n/hybris_compat.h | 22 ++++++++++
hybris/common/o/bionic/libc/include/dlfcn.h | 8 ++--
hybris/common/o/dlfcn.cpp | 4 ++
hybris/common/o/hybris_compat.cpp | 8 ++++
hybris/common/o/hybris_compat.h | 22 ++++++++++
hybris/include/hybris/common/musl_compat.h | 10 +++++
hybris/libsync/sync.c | 1 +
hybris/tests/test_camera.c | 4 ++
22 files changed, 199 insertions(+), 7 deletions(-)
create mode 100644 hybris/include/hybris/common/musl_compat.h
diff --git a/hybris/common/hooks.c b/hybris/common/hooks.c
index 03b29d4..2a3a20b 100644
--- a/hybris/common/hooks.c
+++ b/hybris/common/hooks.c
@@ -80,6 +80,10 @@ extern int my_property_list(void (*propfn)(const char *key, const char *value, v
#include <hybris/common/hooks.h>
+#ifndef __GLIBC__
+#include <hybris/common/musl_compat.h>
+#endif
+
#include <android-config.h>
// this is also used in bionic:
@@ -531,6 +535,7 @@ static int _hybris_hook_pthread_attr_getstacksize(pthread_attr_t const *__attr,
return pthread_attr_getstacksize(realattr, stack_size);
}
+#ifdef __GLIBC__
static int _hybris_hook_pthread_attr_setstackaddr(pthread_attr_t *__attr, void *stack_addr)
{
pthread_attr_t *realattr = (pthread_attr_t *) *(uintptr_t *) __attr;
@@ -548,6 +553,7 @@ static int _hybris_hook_pthread_attr_getstackaddr(pthread_attr_t const *__attr,
return pthread_attr_getstackaddr(realattr, stack_addr);
}
+#endif
static int _hybris_hook_pthread_attr_setstack(pthread_attr_t *__attr, void *stack_base, size_t stack_size)
{
@@ -1134,6 +1140,7 @@ static int _hybris_hook_pthread_rwlockattr_getpshared(pthread_rwlockattr_t *__at
return pthread_rwlockattr_getpshared(realattr, pshared);
}
+#ifdef __GLIBC__
int _hybris_hook_pthread_rwlockattr_setkind_np(pthread_rwlockattr_t *attr, int pref)
{
pthread_rwlockattr_t *realattr = (pthread_rwlockattr_t *) *(uintptr_t *) attr;
@@ -1151,6 +1158,7 @@ int _hybris_hook_pthread_rwlockattr_getkind_np(const pthread_rwlockattr_t *attr,
return pthread_rwlockattr_getkind_np(realattr, pref);
}
+#endif
/*
* pthread_rwlock_* functions
@@ -1500,10 +1508,14 @@ static int _hybris_hook_fgetpos(FILE *fp, bionic_fpos_t *pos)
{
TRACE_HOOK("fp %p pos %p", fp, pos);
+#ifdef __GLIBC__
fpos_t my_fpos;
int ret = fgetpos(_get_actual_fp(fp), &my_fpos);
*pos = my_fpos.__pos;
+#else
+ int ret = fgetpos(_get_actual_fp(fp), pos);
+#endif
return ret;
}
@@ -1589,12 +1601,16 @@ static int _hybris_hook_fsetpos(FILE *fp, const bionic_fpos_t *pos)
{
TRACE_HOOK("fp %p pos %p", fp, pos);
+#ifdef __GLIBC__
fpos_t my_fpos;
my_fpos.__pos = *pos;
memset(&my_fpos.__state, 0, sizeof(mbstate_t));
mbsinit(&my_fpos.__state);
return fsetpos(_get_actual_fp(fp), &my_fpos);
+#else
+ return fsetpos(_get_actual_fp(fp), pos);
+#endif
}
static long _hybris_hook_ftell(FILE *fp)
@@ -1872,6 +1888,7 @@ static int _hybris_hook_versionsort(struct bionic_dirent **a,
return strverscmp((*a)->d_name, (*b)->d_name);
}
+#ifdef __GLIBC__
static int _hybris_hook_scandirat(int fd, const char *dir,
struct bionic_dirent ***namelist,
int (*filter) (const struct bionic_dirent *),
@@ -1933,6 +1950,7 @@ static int _hybris_hook_scandir(const char *dir,
{
return _hybris_hook_scandirat(AT_FDCWD, dir, namelist, filter, compar);
}
+#endif
static inline void swap(void **a, void **b)
{
@@ -2190,6 +2208,7 @@ int _hybris_hook_open(const char *pathname, int flags, ...)
return open(target_path, flags, mode);
}
+#ifdef __GLIBC__
/**
* Wrap some GCC builtin functions, which don't have any address
*/
@@ -2215,6 +2234,7 @@ __THROW int _hybris_hook___snprintf_chk (char *__restrict __s, size_t __n, int _
return ret;
}
+#endif
static __thread void *tls_hooks[16];
@@ -2360,6 +2380,7 @@ static char* _hybris_hook_setlocale(int category, const char *locale)
return setlocale(category, locale);
}
+#ifdef __GLIBC__
static void* _hybris_hook_mmap(void *addr, size_t len, int prot,
int flags, int fd, off_t offset)
{
@@ -2375,6 +2396,7 @@ static int _hybris_hook_munmap(void *addr, size_t length)
return munmap(addr, length);
}
+#endif
extern size_t strlcat(char *dst, const char *src, size_t siz);
extern size_t strlcpy(char *dst, const char *src, size_t siz);
@@ -2635,7 +2657,9 @@ static struct _hook hooks_common[] = {
HOOK_DIRECT_NO_DEBUG(realloc),
HOOK_DIRECT_NO_DEBUG(memalign),
HOOK_DIRECT_NO_DEBUG(valloc),
+#ifdef __GLIBC__
HOOK_DIRECT_NO_DEBUG(pvalloc),
+#endif
HOOK_DIRECT(fread),
HOOK_DIRECT_NO_DEBUG(getxattr),
HOOK_DIRECT(mprotect),
@@ -2685,8 +2709,10 @@ static struct _hook hooks_common[] = {
HOOK_DIRECT_NO_DEBUG(bcopy),
HOOK_DIRECT_NO_DEBUG(bzero),
HOOK_DIRECT_NO_DEBUG(ffs),
+#ifdef __GLIBC__
HOOK_INDIRECT(__sprintf_chk),
HOOK_INDIRECT(__snprintf_chk),
+#endif
/* pthread.h */
HOOK_DIRECT_NO_DEBUG(getauxval),
HOOK_INDIRECT(gettid),
@@ -2745,8 +2771,10 @@ static struct _hook hooks_common[] = {
HOOK_INDIRECT(pthread_attr_getschedparam),
HOOK_INDIRECT(pthread_attr_setstacksize),
HOOK_INDIRECT(pthread_attr_getstacksize),
+#ifdef __GLIBC__
HOOK_INDIRECT(pthread_attr_setstackaddr),
HOOK_INDIRECT(pthread_attr_getstackaddr),
+#endif
HOOK_INDIRECT(pthread_attr_setstack),
HOOK_INDIRECT(pthread_attr_getstack),
HOOK_INDIRECT(pthread_attr_setguardsize),
@@ -2868,8 +2896,10 @@ static struct _hook hooks_common[] = {
HOOK_DIRECT_NO_DEBUG(seekdir),
HOOK_DIRECT_NO_DEBUG(telldir),
HOOK_DIRECT_NO_DEBUG(dirfd),
+#ifdef __GLIBC__
HOOK_INDIRECT(scandir),
HOOK_INDIRECT(scandirat),
+#endif
HOOK_INDIRECT(alphasort),
HOOK_INDIRECT(versionsort),
/* fcntl.h */
@@ -2893,7 +2923,9 @@ static struct _hook hooks_common[] = {
HOOK_DIRECT_NO_DEBUG(localtime_r),
HOOK_DIRECT_NO_DEBUG(gmtime),
HOOK_DIRECT_NO_DEBUG(abort),
+#ifdef __GLIBC__
HOOK_DIRECT_NO_DEBUG(writev),
+#endif
/* unistd.h */
HOOK_DIRECT_NO_DEBUG(access),
/* grp.h */
@@ -2912,13 +2944,17 @@ static struct _hook hooks_mm[] = {
HOOK_DIRECT(putenv),
HOOK_DIRECT(clearenv),
HOOK_DIRECT_NO_DEBUG(dprintf),
+#ifdef __GLIBC__
HOOK_DIRECT_NO_DEBUG(mallinfo),
+#endif
HOOK_DIRECT(malloc_usable_size),
HOOK_DIRECT(posix_memalign),
HOOK_DIRECT(mprotect),
HOOK_TO(__gnu_strerror_r, _hybris_hook__gnu_strerror_r),
+#ifdef __GLIBC__
HOOK_INDIRECT(pthread_rwlockattr_getkind_np),
HOOK_INDIRECT(pthread_rwlockattr_setkind_np),
+#endif
/* unistd.h */
HOOK_DIRECT(fork),
HOOK_DIRECT_NO_DEBUG(ttyname),
@@ -2940,15 +2976,21 @@ static struct _hook hooks_mm[] = {
HOOK_DIRECT(localeconv),
HOOK_DIRECT(setlocale),
/* sys/mman.h */
+#ifdef __GLIBC__
+ // mmap from musl considers offsets from gralloc to be invalid,
+ // so avoid hooking it
HOOK_DIRECT(mmap),
HOOK_DIRECT(munmap),
+#endif
/* wchar.h */
HOOK_DIRECT_NO_DEBUG(wmemchr),
HOOK_DIRECT_NO_DEBUG(wmemcmp),
HOOK_DIRECT_NO_DEBUG(wmemcpy),
HOOK_DIRECT_NO_DEBUG(wmemmove),
HOOK_DIRECT_NO_DEBUG(wmemset),
+#ifdef __GLIBC__
HOOK_DIRECT_NO_DEBUG(wmempcpy),
+#endif
HOOK_INDIRECT(fputws),
// It's enough to hook vfwprintf here as fwprintf will call it with a
// proper va_list in place so we don't have to handle this here.
@@ -3002,9 +3044,11 @@ static struct _hook hooks_mm[] = {
/* dirent.h */
HOOK_TO(readdir64, _hybris_hook_readdir),
HOOK_TO(readdir64_r, _hybris_hook_readdir_r),
+#ifdef __GLIBC__
HOOK_INDIRECT(scandir),
HOOK_INDIRECT(scandirat),
HOOK_TO(scandir64, _hybris_hook_scandir),
+#endif
};
diff --git a/hybris/common/hooks_shm.c b/hybris/common/hooks_shm.c
index c90cee5..27dfeef 100644
--- a/hybris/common/hooks_shm.c
+++ b/hybris/common/hooks_shm.c
@@ -33,6 +33,10 @@
#include <sys/shm.h>
#include <sys/mman.h>
+#ifndef __GLIBC__
+#include <hybris/common/musl_compat.h>
+#endif
+
/* Debug */
#include "logging.h"
#define LOGD(message, ...) HYBRIS_DEBUG_LOG(HOOKS, message, ##__VA_ARGS__)
diff --git a/hybris/common/jb/dlfcn.c b/hybris/common/jb/dlfcn.c
index 78500e4..6996527 100644
--- a/hybris/common/jb/dlfcn.c
+++ b/hybris/common/jb/dlfcn.c
@@ -23,6 +23,10 @@
#include "linker.h"
#include "linker_format.h"
+#ifndef PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP
+#define PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP {{PTHREAD_MUTEX_RECURSIVE}}
+#endif
+
/* This file hijacks the symbols stubbed out in libdl.so. */
#define DL_SUCCESS 0
diff --git a/hybris/common/legacy_properties/properties.c b/hybris/common/legacy_properties/properties.c
index 0191e7c..c96bd59 100644
--- a/hybris/common/legacy_properties/properties.c
+++ b/hybris/common/legacy_properties/properties.c
@@ -36,6 +36,9 @@
#include <poll.h>
#include <hybris/properties/properties.h>
+#ifndef __GLIBC__
+#include <hybris/common/musl_compat.h>
+#endif
#include "properties_p.h"
static const char property_service_socket[] = "/dev/socket/" PROP_SERVICE_NAME;
diff --git a/hybris/common/mm/bionic/libc/include/link.h b/hybris/common/mm/bionic/libc/include/link.h
index cb8e139..10d105d 100644
--- a/hybris/common/mm/bionic/libc/include/link.h
+++ b/hybris/common/mm/bionic/libc/include/link.h
@@ -29,6 +29,7 @@
#define _LINK_H_
#include <sys/types.h>
+#include <sys/cdefs.h>
#include <elf.h>
__BEGIN_DECLS
diff --git a/hybris/common/mm/bionic/libc/private/libc_logging.h b/hybris/common/mm/bionic/libc/private/libc_logging.h
index 6beb47e..e526c03 100644
--- a/hybris/common/mm/bionic/libc/private/libc_logging.h
+++ b/hybris/common/mm/bionic/libc/private/libc_logging.h
@@ -33,6 +33,8 @@
#include <stdarg.h>
#include <stddef.h>
#include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
__BEGIN_DECLS
@@ -73,7 +75,18 @@ struct abort_msg_t {
// Formats a message to the log (priority 'fatal'), then aborts.
//
+#ifdef __GLIBC__
void __libc_fatal(const char* format, ...);
+#else
+void inline __libc_fatal(const char* format, ...)
+{
+ va_list ap;
+ va_start(ap, format);
+ vfprintf(stderr, format, ap);
+ va_end(ap);
+ abort();
+}
+#endif
//
// Formats a message to the log (priority 'fatal'), but doesn't abort.
diff --git a/hybris/common/mm/dlfcn.cpp b/hybris/common/mm/dlfcn.cpp
index 13976db..d0ec9e5 100644
--- a/hybris/common/mm/dlfcn.cpp
+++ b/hybris/common/mm/dlfcn.cpp
@@ -31,6 +31,10 @@
#include "hybris_compat.h"
+#ifndef PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP
+#define PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP {{PTHREAD_MUTEX_RECURSIVE}}
+#endif
+
#ifdef WANT_ARM_TRACING
#include "../wrappers.h"
#endif
diff --git a/hybris/common/mm/hybris_compat.h b/hybris/common/mm/hybris_compat.h
index 2e10383..de1d852 100644
--- a/hybris/common/mm/hybris_compat.h
+++ b/hybris/common/mm/hybris_compat.h
@@ -32,6 +32,9 @@
#include <string.h>
#include <memory.h>
+#ifndef __GLIBC__
+#include <hybris/common/musl_compat.h>
+#endif
extern "C" size_t strlcpy(char *dest, const char *src, size_t size);
extern "C" size_t strlcat(char *dst, const char *src, size_t size);
@@ -55,4 +58,12 @@ extern "C" size_t strlcat(char *dst, const char *src, size_t size);
#define DT_ANDROID_RELA (DT_LOOS + 4)
#define DT_ANDROID_RELASZ (DT_LOOS + 5)
+#if defined (__aarch64__)
+
+#ifndef R_AARCH64_IRELATIVE
+#define R_AARCH64_IRELATIVE 1032
+#endif
+
+#endif
+
#endif
diff --git a/hybris/common/mm/linker.cpp b/hybris/common/mm/linker.cpp
index 42340cc..986d065 100644
--- a/hybris/common/mm/linker.cpp
+++ b/hybris/common/mm/linker.cpp
@@ -38,6 +38,9 @@
#include <sys/mman.h>
#include <sys/param.h>
#include <unistd.h>
+#ifndef __GLIBC__
+#include <libgen.h>
+#endif
#include <new>
#include <string>
@@ -1193,7 +1196,11 @@ static const char* fix_dt_needed(const char* dt_needed, const char* sopath) {
#if !defined(__LP64__)
// Work around incorrect DT_NEEDED entries for old apps: http://b/21364029
if (get_application_target_sdk_version() <= 22) {
+#ifdef __GLIBC__
const char* bname = basename(dt_needed);
+#else
+ const char* bname = (const char*) basename((char*)dt_needed);
+#endif
if (bname != dt_needed) {
DL_WARN("'%s' library has invalid DT_NEEDED entry '%s'", sopath, dt_needed);
}
@@ -2924,7 +2931,11 @@ bool soinfo::prelink_image() {
// the main executable and linker; they do not need to have dt_soname
if (soname_ == nullptr && this != somain && (flags_ & FLAG_LINKER) == 0 &&
get_application_target_sdk_version() <= 22) {
+#ifdef __GLIBC__
soname_ = basename(realpath_.c_str());
+#else
+ soname_ = (const char*) basename((char*) realpath_.c_str());
+#endif
DL_WARN("%s: is missing DT_SONAME will use basename as a replacement: \"%s\"",
get_realpath(), soname_);
}
diff --git a/hybris/common/n/bionic/libc/include/dlfcn.h b/hybris/common/n/bionic/libc/include/dlfcn.h
index c2e8980..692ce52 100644
--- a/hybris/common/n/bionic/libc/include/dlfcn.h
+++ b/hybris/common/n/bionic/libc/include/dlfcn.h
@@ -46,8 +46,8 @@ typedef struct {
extern void* dlopen(const char* filename, int flag);
extern int dlclose(void* handle);
extern const char* dlerror(void);
-extern void* dlsym(void* handle, const char* symbol) __nonnull((2));
-extern void* dlvsym(void* handle, const char* symbol, const char* version) __nonnull((2, 3));
+extern void* dlsym(void* handle, const char* symbol) __attribute__((nonnull((2))));
+extern void* dlvsym(void* handle, const char* symbol, const char* version) __attribute__((nonnull((2, 3))));
extern int dladdr(const void* addr, Dl_info *info);
enum {
diff --git a/hybris/common/n/bionic/libc/include/link.h b/hybris/common/n/bionic/libc/include/link.h
index cb8e139..10d105d 100644
--- a/hybris/common/n/bionic/libc/include/link.h
+++ b/hybris/common/n/bionic/libc/include/link.h
@@ -29,6 +29,7 @@
#define _LINK_H_
#include <sys/types.h>
+#include <sys/cdefs.h>
#include <elf.h>
__BEGIN_DECLS
diff --git a/hybris/common/n/bionic/libc/private/libc_logging.h b/hybris/common/n/bionic/libc/private/libc_logging.h
index a696cec..2da0238 100644
--- a/hybris/common/n/bionic/libc/private/libc_logging.h
+++ b/hybris/common/n/bionic/libc/private/libc_logging.h
@@ -33,6 +33,8 @@
#include <stdarg.h>
#include <stddef.h>
#include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
__BEGIN_DECLS
@@ -73,7 +75,18 @@ struct abort_msg_t {
// Formats a message to the log (priority 'fatal'), then aborts.
//
-void __libc_fatal(const char* format, ...);
+#ifdef __GLIBC__
+ void __libc_fatal(const char* format, ...);
+#else
+void inline __libc_fatal(const char* format, ...)
+{
+ va_list ap;
+ va_start(ap, format);
+ vfprintf(stderr, format, ap);
+ va_end(ap);
+ abort();
+}
+#endif
//
// Formats a message to the log (priority 'fatal'), but doesn't abort.
diff --git a/hybris/common/n/dlfcn.cpp b/hybris/common/n/dlfcn.cpp
index 92c1349..bfdbb9c 100644
--- a/hybris/common/n/dlfcn.cpp
+++ b/hybris/common/n/dlfcn.cpp
@@ -30,6 +30,10 @@
#include "hybris_compat.h"
+#ifndef PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP
+#define PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP {{PTHREAD_MUTEX_RECURSIVE}}
+#endif
+
/* This file hijacks the symbols stubbed out in libdl.so. */
static pthread_mutex_t g_dl_mutex = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
diff --git a/hybris/common/n/hybris_compat.cpp b/hybris/common/n/hybris_compat.cpp
index cfe1e78..5238409 100644
--- a/hybris/common/n/hybris_compat.cpp
+++ b/hybris/common/n/hybris_compat.cpp
@@ -27,3 +27,11 @@
*/
#include "hybris_compat.h"
+
+#ifndef __GLIBC__
+const char *gnu_basename(const char *path)
+{
+ char *base = strrchr(path, '/');
+ return base ? base + 1 : path;
+}
+#endif
diff --git a/hybris/common/n/hybris_compat.h b/hybris/common/n/hybris_compat.h
index 2e10383..77a0919 100644
--- a/hybris/common/n/hybris_compat.h
+++ b/hybris/common/n/hybris_compat.h
@@ -32,6 +32,9 @@
#include <string.h>
#include <memory.h>
+#ifndef __GLIBC__
+#include <hybris/common/musl_compat.h>
+#endif
extern "C" size_t strlcpy(char *dest, const char *src, size_t size);
extern "C" size_t strlcat(char *dst, const char *src, size_t size);
@@ -55,4 +58,23 @@ extern "C" size_t strlcat(char *dst, const char *src, size_t size);
#define DT_ANDROID_RELA (DT_LOOS + 4)
#define DT_ANDROID_RELASZ (DT_LOOS + 5)
+#if defined (__aarch64__)
+
+#ifndef R_AARCH64_TLS_DTPREL32
+#define R_AARCH64_TLS_DTPREL32 1031
+#endif
+
+#ifndef R_AARCH64_IRELATIVE
+#define R_AARCH64_IRELATIVE 1032
+#endif
+
+#endif
+
+#ifndef __GLIBC__
+#ifndef basename
+const char *gnu_basename(const char *path);
+#define basename gnu_basename
+#endif
+#endif
+
#endif
diff --git a/hybris/common/o/bionic/libc/include/dlfcn.h b/hybris/common/o/bionic/libc/include/dlfcn.h
index acec4a2..3943882 100644
--- a/hybris/common/o/bionic/libc/include/dlfcn.h
+++ b/hybris/common/o/bionic/libc/include/dlfcn.h
@@ -57,11 +57,11 @@ typedef struct {
} Dl_info;
void* dlopen(const char* filename, int flag);
-int dlclose(void* handle) __nonnull((1));
+int dlclose(void* handle) __attribute__((nonnull((1))));
char* dlerror(void);
-void* dlsym(void* handle, const char* symbol) __nonnull((2));
-void* dlvsym(void* handle, const char* symbol, const char* version) __nonnull((2, 3));
-int dladdr(const void* addr, Dl_info* info) __nonnull((2));
+void* dlsym(void* handle, const char* symbol) __attribute__((nonnull((2))));
+void* dlvsym(void* handle, const char* symbol, const char* version) __attribute__((nonnull((2, 3))));
+int dladdr(const void* addr, Dl_info* info) __attribute__((nonnull((2))));
#define RTLD_LOCAL 0
#define RTLD_LAZY 0x00001
diff --git a/hybris/common/o/dlfcn.cpp b/hybris/common/o/dlfcn.cpp
index 6fddbbb..f98f4d2 100644
--- a/hybris/common/o/dlfcn.cpp
+++ b/hybris/common/o/dlfcn.cpp
@@ -42,6 +42,10 @@
#include "private/bionic_tls.h"
#include "private/ScopedPthreadMutexLocker.h"
+#ifndef PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP
+#define PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP {{PTHREAD_MUTEX_RECURSIVE}}
+#endif
+
static pthread_mutex_t g_dl_mutex = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
static __thread char *dl_err_str;
diff --git a/hybris/common/o/hybris_compat.cpp b/hybris/common/o/hybris_compat.cpp
index cfe1e78..5238409 100644
--- a/hybris/common/o/hybris_compat.cpp
+++ b/hybris/common/o/hybris_compat.cpp
@@ -27,3 +27,11 @@
*/
#include "hybris_compat.h"
+
+#ifndef __GLIBC__
+const char *gnu_basename(const char *path)
+{
+ char *base = strrchr(path, '/');
+ return base ? base + 1 : path;
+}
+#endif
diff --git a/hybris/common/o/hybris_compat.h b/hybris/common/o/hybris_compat.h
index 2e10383..77a0919 100644
--- a/hybris/common/o/hybris_compat.h
+++ b/hybris/common/o/hybris_compat.h
@@ -32,6 +32,9 @@
#include <string.h>
#include <memory.h>
+#ifndef __GLIBC__
+#include <hybris/common/musl_compat.h>
+#endif
extern "C" size_t strlcpy(char *dest, const char *src, size_t size);
extern "C" size_t strlcat(char *dst, const char *src, size_t size);
@@ -55,4 +58,23 @@ extern "C" size_t strlcat(char *dst, const char *src, size_t size);
#define DT_ANDROID_RELA (DT_LOOS + 4)
#define DT_ANDROID_RELASZ (DT_LOOS + 5)
+#if defined (__aarch64__)
+
+#ifndef R_AARCH64_TLS_DTPREL32
+#define R_AARCH64_TLS_DTPREL32 1031
+#endif
+
+#ifndef R_AARCH64_IRELATIVE
+#define R_AARCH64_IRELATIVE 1032
+#endif
+
+#endif
+
+#ifndef __GLIBC__
+#ifndef basename
+const char *gnu_basename(const char *path);
+#define basename gnu_basename
+#endif
+#endif
+
#endif
diff --git a/hybris/include/hybris/common/musl_compat.h b/hybris/include/hybris/common/musl_compat.h
new file mode 100644
index 0000000..c5f86f2
--- /dev/null
+++ b/hybris/include/hybris/common/musl_compat.h
@@ -0,0 +1,10 @@
+#include <unistd.h>
+/* taken from glibc unistd.h and fixes musl */
+#ifndef TEMP_FAILURE_RETRY
+#define TEMP_FAILURE_RETRY(expression) \
+ (__extension__ \
+ ({ long int __result; \
+ do __result = (long int) (expression); \
+ while (__result == -1L && errno == EINTR); \
+ __result; }))
+#endif
diff --git a/hybris/libsync/sync.c b/hybris/libsync/sync.c
index dbc3eba..e66840a 100644
--- a/hybris/libsync/sync.c
+++ b/hybris/libsync/sync.c
@@ -27,6 +27,7 @@
#include <linux/sync.h>
#include <linux/sw_sync.h>
#else
+#include <sys/cdefs.h>
#include <sync/sync.h>
#endif
diff --git a/hybris/tests/test_camera.c b/hybris/tests/test_camera.c
index 7ac81f4..b7993a9 100644
--- a/hybris/tests/test_camera.c
+++ b/hybris/tests/test_camera.c
@@ -45,6 +45,10 @@
#include <sys/stat.h>
#include <sys/types.h>
+#ifndef __GLIBC__
+#include <hybris/common/musl_compat.h>
+#endif
+
int shot_counter = 1;
int32_t current_zoom_level = 1;
bool new_camera_frame_available = true;
--
2.23.0

View file

@ -1,75 +0,0 @@
From dd95903bd734aed6407f682aa843a293814d2ec5 Mon Sep 17 00:00:00 2001
From: Richard Braakman <richard.braakman@jollamobile.com>
Date: Wed, 1 Nov 2017 23:35:31 +0300
Subject: [PATCH 2/3] [tests] Regression test for EGL-glibc TLS conflict bionic
and glibc have different layouts for TLS space. Since libEGL used a bionic
slot directly (in inlined code), libhybris's hooks didn't translate it
properly and libEGL ended up overwriting some unrelated thread-local values
in glibc.
The problem only showed up when linking with libGLESv2 (which
pulls in libEGL), not when linking with libEGL directly. That's
why the test was added to test_glesv2.c
---
hybris/tests/test_hwcomposer.cpp | 31 ++++++++++++++++++++++++++++++-
1 file changed, 30 insertions(+), 1 deletion(-)
diff --git a/hybris/tests/test_hwcomposer.cpp b/hybris/tests/test_hwcomposer.cpp
index 68917db..695291e 100644
--- a/hybris/tests/test_hwcomposer.cpp
+++ b/hybris/tests/test_hwcomposer.cpp
@@ -32,6 +32,23 @@
#include <malloc.h>
#include <sync/sync.h>
+/* Regression test: make sure that there's no conflict between
+ * the TLS (thread-local storage) slots used via libEGL/bionic
+ * and the TLS space allocated by the host toolchain. The array
+ * declared here should remain unchanged regardless of GL activity.
+ * Since this array is the first __thread storage declared in the main
+ * program, glibc will allocate it before any others.
+ */
+#define SLOT_FILLER (void *) 0x11122111 /* arbitrary non-zero value */
+#define S SLOT_FILLER
+__thread void *tls_space[64] = {
+ S, S, S, S, S, S, S, S, S, S, S, S, S, S, S, S,
+ S, S, S, S, S, S, S, S, S, S, S, S, S, S, S, S,
+ S, S, S, S, S, S, S, S, S, S, S, S, S, S, S, S,
+ S, S, S, S, S, S, S, S, S, S, S, S, S, S, S, S,
+};
+#undef S
+
const char vertex_src [] =
" \
attribute vec4 position; \
@@ -346,7 +363,7 @@ int main(int argc, char **argv)
glClearColor ( 1. , 1. , 1. , 1.); // background color
float phase = 0;
int i, oldretire = -1, oldrelease = -1, oldrelease2 = -1;
- for (i=0; i<1020*60; ++i) {
+ for (i=0; i<60*60; ++i) {
glClear(GL_COLOR_BUFFER_BIT);
glUniform1f ( phase_loc , phase ); // write the value of phase to the shaders phase
phase = fmodf ( phase + 0.5f , 2.f * 3.141f ); // and update the local variable
@@ -372,6 +389,18 @@ int main(int argc, char **argv)
printf("terminated\n");
android_dlclose(baz);
#endif
+
+ int bad_tls = 0;
+ for (i=0; i<64; ++i) {
+ if (tls_space[i] != SLOT_FILLER) {
+ printf("TLS array slot %d polluted: %p\n", i, tls_space[i]);
+ bad_tls++;
+ }
+ }
+ if (bad_tls)
+ return 1;
+
+ return 0;
}
#else
--
2.23.0

View file

@ -1,55 +0,0 @@
From d1ba53c0eabdc706a19d83f5845a48012a6eb566 Mon Sep 17 00:00:00 2001
From: NeKit <nekit1000@gmail.com>
Date: Sat, 1 Dec 2018 00:02:52 +0100
Subject: [PATCH] test_hwcomposer: hack to build version for Android 7 CAF
devices
Android headers from LineageOS 14.1 include needed changes in structs,
which are conditionally activated by QTI_BSP define. By enabling that
define we can build a separate binary of test_hwcomposer which will
work on Android 7 CAF devices with Halium.
---
hybris/tests/Makefile.am | 27 +++++++++++++++++++++++++++
1 file changed, 27 insertions(+)
diff --git a/hybris/tests/Makefile.am b/hybris/tests/Makefile.am
index 242436b..2255694 100644
--- a/hybris/tests/Makefile.am
+++ b/hybris/tests/Makefile.am
@@ -105,6 +105,33 @@ test_hwcomposer_LDADD = \
$(top_builddir)/libsync/libsync.la \
$(top_builddir)/hardware/libhardware.la
+if HAS_ANDROID_7_0_0
+bin_PROGRAMS += test_hwcomposer_7_caf
+endif
+
+test_hwcomposer_7_caf_SOURCES = test_hwcomposer.cpp
+test_hwcomposer_7_caf_CXXFLAGS = \
+ -I$(top_srcdir)/include \
+ $(ANDROID_HEADERS_CFLAGS) \
+ -DQCOM_BSP=1 -DQTI_BSP=1 \
+ -I$(top_srcdir)/common \
+ -I$(top_srcdir)/egl/platforms/common \
+ -I$(top_srcdir)/egl/platforms/hwcomposer \
+ -I$(top_srcdir)/libsync
+
+if WANT_MESA
+test_hwcomposer_7_caf_CXXFLAGS += -DLIBHYBRIS_WANTS_MESA_X11_HEADERS
+endif
+test_hwcomposer_7_caf_LDADD = \
+ -lm \
+ $(top_builddir)/common/libhybris-common.la \
+ $(top_builddir)/egl/platforms/hwcomposer/libhybris-hwcomposerwindow.la \
+ $(top_builddir)/egl/platforms/common/libhybris-eglplatformcommon.la \
+ $(top_builddir)/egl/libEGL.la \
+ $(top_builddir)/glesv2/libGLESv2.la \
+ $(top_builddir)/libsync/libsync.la \
+ $(top_builddir)/hardware/libhardware.la
+
test_sensors_SOURCES = test_sensors.c
test_sensors_CFLAGS = \
-I$(top_srcdir)/include \
--
2.19.1

View file

@ -1,180 +0,0 @@
# Maintainer: TheKit <nekit1000@gmail.com>
pkgname=libhybris
pkgver=1.0_git20200117
pkgrel=1
arch="armhf aarch64"
url="https://github.com/libhybris/libhybris"
license="Apache-2.0"
pkgdesc="libhybris allows to use bionic-based HW adaptations"
_commit="605f294d3cdf70e3072b9a3077cd14758a174124"
makedepends="autoconf automake libtool wayland-dev linux-headers bsd-compat-headers
libx11-dev libxcb-dev libxext-dev
android-headers-9.0 android-headers-7.1 android-headers-4.4"
depends_dev="bsd-compat-headers android-headers-9.0"
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
"
_base_subpackages="$pkgname-dev
$pkgname-dbg
$pkgname-egl
$pkgname-gles
$pkgname-libwayland-egl:_wayland"
subpackages="$_base_subpackages
$pkgname-9.0:_specific
$pkgname-7.1:_specific
$pkgname-4.4:_specific"
# Override subpackages list for some specific arches
if [ "$CARCH" == "aarch64" ]; then
subpackages="$_base_subpackages $pkgname-9.0:_specific $pkgname-7.1:_specific"
elif [ "$CARCH" == "x86" ]; then
subpackages="$_base_subpackages $pkgname-9.0:_specific $pkgname-7.1:_specific $pkgname-4.4:_specific"
fi
options="!check !strip !tracedeps"
builddir="$srcdir/$pkgname-$_commit"
_tmppkgdir="$srcdir/tmpinstall"
_main_headers_ver=9.0
_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="9.0 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="9.0 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="9.0 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
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/
}
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="9d4705eab02d0f1cd8c2e9fba39f03a7ea73dd0afebd544cf56343b9d002cdb07cc1fd4ffa44802c610782b32cd94d97b0b33a4fdbb7dd80a090965128d03998 libhybris-605f294d3cdf70e3072b9a3077cd14758a174124.tar.gz
a1b707c9aaa7bde2907d04742d7d582df57949415e1afe16c3b461671421a18643008e19aa006e9e67b9644392ec4e2d58c6de725d2db2df077a49526f2893ce 0001-Make-libhybris-compile-with-musl.patch
64fa516c823859c062d175a51fc86846dc85f4e98989cf12c7cb8c9a13ffffb748f6152543f1a6e22f5fe78eb619880262b3c8ff3b6cbd314241fec16ef2eff5 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"

View file

@ -1,15 +0,0 @@
#!/bin/sh
KARCH=$(uname -m)
case "$KARCH" in
armv7l)
ARCH=armhf
;;
*)
ARCH="$KARCH"
;;
esac
if [ ! -f /etc/ld-musl-$ARCH.path ]; then
echo "/usr/lib/libhybris-egl:/lib:/usr/local/lib:/usr/lib" > /etc/ld-musl-$ARCH.path
fi

View file

@ -1,31 +0,0 @@
diff --git a/var/lib/lxc/android/config b/var/lib/lxc/android/config
index 912b72c..af33a23 100644
--- a/var/lib/lxc/android/config
+++ b/var/lib/lxc/android/config
@@ -1,18 +1,17 @@
-lxc.rootfs = /var/lib/lxc/android/rootfs
-lxc.utsname = armhf
+lxc.rootfs.path = /var/lib/lxc/android/rootfs
+lxc.uts.name = armhf
-lxc.network.type = none
+lxc.net.0.type = none
-lxc.devttydir = lxc
-lxc.tty = 4
-lxc.pts = 1024
+lxc.tty.dir = lxc
+lxc.tty.max = 4
+lxc.pty.max = 1024
lxc.arch = armhf
lxc.cap.drop = mac_admin mac_override
-lxc.pivotdir = lxc_putold
lxc.hook.pre-start = /var/lib/lxc/android/pre-start.sh
-lxc.init_cmd = /init
+lxc.init.cmd = /init
-lxc.aa_profile = unconfined
+lxc.apparmor.profile = unconfined
lxc.autodev = 0

View file

@ -1,25 +0,0 @@
diff --git a/lib/udev/rules.d/65-android.rules b/lib/udev/rules.d/65-android.rules
index b3233aa..99fac2f 100644
--- a/lib/udev/rules.d/65-android.rules
+++ b/lib/udev/rules.d/65-android.rules
@@ -12,15 +12,15 @@ ACTION=="add", KERNEL=="binder", MODE="0666"
SUBSYSTEM=="graphics", KERNEL=="*", SYMLINK+="graphics/%k"
# input devices
-ACTION=="add", KERNEL=="event[0-9]*", GROUP="android_input", MODE="0660"
+ACTION=="add", KERNEL=="event[0-9]*", GROUP="aid_input", MODE="0660"
# misc devices
-ACTION=="add", KERNEL=="alarm", OWNER="system", GROUP="phablet", MODE="0660"
-ACTION=="add", KERNEL=="uhid", OWNER="system", GROUP="system", MODE="0660"
+ACTION=="add", KERNEL=="alarm", OWNER="aid_system", GROUP="plugdev", MODE="0660"
+ACTION=="add", KERNEL=="uhid", OWNER="aid_system", GROUP="aid_system", MODE="0660"
ACTION=="add", KERNEL=="mtp_usb", OWNER="root", GROUP="plugdev", MODE="0660"
# memory
-ACTION=="add", KERNEL=="ashmem", OWNER="system", GROUP="system", MODE="0666"
+ACTION=="add", KERNEL=="ashmem", OWNER="aid_system", GROUP="aid_system", MODE="0666"
# rfkill
-ACTION=="add", KERNEL=="rfkill", GROUP="android_input", MODE="0660"
+ACTION=="add", KERNEL=="rfkill", GROUP="aid_input", MODE="0660"

View file

@ -1,55 +0,0 @@
# Maintainer: TheKit <nekit1000@gmail.com>
pkgname=lxc-android
pkgver=1.0_git20190315
pkgrel=2
arch="aarch64 armhf armv7"
url="https://github.com/Halium/lxc-android"
license="Apache"
depends="lxc shadow"
_commit="9551443e5ab11d0d21cb544f681bcb7603b870de"
install="$pkgname.post-install"
source="$pkgname-$_commit.tar.gz::https://github.com/Halium/lxc-android/archive/$_commit.tar.gz
add_android_groups.sh
logcat
pre-start.sh
0001-lxcconfig.patch
0002-fix-android-rules.patch
lxc-android.init"
pkgdesc="Configuration for starting Halium build of Android inside LXC container"
options="!check"
builddir="$srcdir/$pkgname-$_commit"
package() {
mkdir -p "$pkgdir"
cp -r "$builddir"/* "$pkgdir"
# Remove unneeded udev rule override
rm -f "$pkgdir/etc/udev/rules.d/50-firmware.rules"
rm -f "$pkgdir/etc/udev/rules.d/60-persistent-v4l.rules"
# Remove systemd units
rm -rf "$pkgdir/etc/systemd"
rm -rf "$pkgdir/lib/systemd"
# Install wrapper so pre-start.sh could be provided by device package
mv "$pkgdir/var/lib/lxc/android/pre-start.sh" "$pkgdir/var/lib/lxc/android/pre-start.default.sh"
install -m755 "$srcdir/pre-start.sh" "$pkgdir/var/lib/lxc/android/pre-start.sh"
# OpenRC services
install -Dm755 "$srcdir/lxc-android.init" \
"$pkgdir/etc/init.d/lxc-android"
install -Dm755 "$srcdir/logcat" \
"$pkgdir/usr/bin/logcat"
install -Dm755 "$srcdir/add_android_groups.sh" \
"$pkgdir/usr/sbin/add_android_groups.sh"
}
sha512sums="348650f24464abb7a5d2b3e86e762efbdf770bf5f91d4fb12eb62290e3e29b94bcb91fac36cb0b550f4cb1ad9941b97ea7b7c44cccdf9af51d6b35233b6fe46d lxc-android-9551443e5ab11d0d21cb544f681bcb7603b870de.tar.gz
5917947c88e47e7ce982822b8d286073da6b8104a0c3df335b1358908cff0e3d819573a341392958aafb533503847ed2b188cb0e88086a8be16244383a577862 add_android_groups.sh
7c5931671a78ab8222f1c99b9720be328883c8961b7966daf71fd8a7093365d1a2b8785196399534c323585b1c70d723df7c1b52a94d533c62c4942e0eb267f0 logcat
ef7081ea55a1acd5a6c5a973b4a7fc79bad4d5fdc721bc481e4ed92962a8ba9b70634e2a0a8f0afd28c14bd1fd4e1956914f68239c3dc34e41e167254252b1df pre-start.sh
7e8981ba9c779bf893dfddbe495dcaacfa43154748e21dd14fed2696d50b55807585d7168b79d73769d1381bb9974d7661479a303bacef883da0e0cf07dd0ad7 0001-lxcconfig.patch
d5772e4776464acc016854cec8a7348e4226696c343eae3bf5e08fb5ad23155d883c23ed5d00e7ff3876907f516e66dd4438c7894c8441dd9b00d1f8f9f22620 0002-fix-android-rules.patch
ad373e26fb4850f887ca0be76a4c5f19115e214dcbdc315cf24e41eabfd03eebf8f19085a49c97661861b16e8005355c7fd10e86acdb4593d43250e3fed998fb lxc-android.init"

View file

@ -1,219 +0,0 @@
#!/bin/sh
groupadd --gid 1000 aid_system
useradd --gid 1000 --no-create-home --no-user-group --system --uid 1000 aid_system
groupadd --gid 1001 aid_radio
useradd --gid 1001 --no-create-home --no-user-group --system --uid 1001 aid_radio
groupadd --gid 1002 aid_bluetooth
useradd --gid 1002 --no-create-home --no-user-group --system --uid 1002 aid_bluetooth
groupadd --gid 1003 aid_graphics
useradd --gid 1003 --no-create-home --no-user-group --system --uid 1003 aid_graphics
groupadd --gid 1004 aid_input
useradd --gid 1004 --no-create-home --no-user-group --system --uid 1004 aid_input
groupadd --gid 1005 aid_audio
useradd --gid 1005 --no-create-home --no-user-group --system --uid 1005 aid_audio
groupadd --gid 1006 aid_camera
useradd --gid 1006 --no-create-home --no-user-group --system --uid 1006 aid_camera
groupadd --gid 1007 aid_log
useradd --gid 1007 --no-create-home --no-user-group --system --uid 1007 aid_log
groupadd --gid 1008 aid_compass
useradd --gid 1008 --no-create-home --no-user-group --system --uid 1008 aid_compass
groupadd --gid 1009 aid_mount
useradd --gid 1009 --no-create-home --no-user-group --system --uid 1009 aid_mount
groupadd --gid 1010 aid_wifi
useradd --gid 1010 --no-create-home --no-user-group --system --uid 1010 aid_wifi
groupadd --gid 1011 aid_adb
useradd --gid 1011 --no-create-home --no-user-group --system --uid 1011 aid_adb
groupadd --gid 1012 aid_install
useradd --gid 1012 --no-create-home --no-user-group --system --uid 1012 aid_install
groupadd --gid 1013 aid_media
useradd --gid 1013 --no-create-home --no-user-group --system --uid 1013 aid_media
groupadd --gid 1014 aid_dhcp
useradd --gid 1014 --no-create-home --no-user-group --system --uid 1014 aid_dhcp
groupadd --gid 1015 aid_sdcard_rw
useradd --gid 1015 --no-create-home --no-user-group --system --uid 1015 aid_sdcard_rw
groupadd --gid 1016 aid_vpn
useradd --gid 1016 --no-create-home --no-user-group --system --uid 1016 aid_vpn
groupadd --gid 1017 aid_keystore
useradd --gid 1017 --no-create-home --no-user-group --system --uid 1017 aid_keystore
groupadd --gid 1018 aid_usb
useradd --gid 1018 --no-create-home --no-user-group --system --uid 1018 aid_usb
groupadd --gid 1019 aid_drm
useradd --gid 1019 --no-create-home --no-user-group --system --uid 1019 aid_drm
groupadd --gid 1020 aid_mdnsr
useradd --gid 1020 --no-create-home --no-user-group --system --uid 1020 aid_mdnsr
groupadd --gid 1021 aid_gps
useradd --gid 1021 --no-create-home --no-user-group --system --uid 1021 aid_gps
groupadd --gid 1023 aid_media_rw
useradd --gid 1023 --no-create-home --no-user-group --system --uid 1023 aid_media_rw
groupadd --gid 1024 aid_mtp
useradd --gid 1024 --no-create-home --no-user-group --system --uid 1024 aid_mtp
groupadd --gid 1026 aid_drmrpc
useradd --gid 1026 --no-create-home --no-user-group --system --uid 1026 aid_drmrpc
groupadd --gid 1027 aid_nfc
useradd --gid 1027 --no-create-home --no-user-group --system --uid 1027 aid_nfc
groupadd --gid 1028 aid_sdcard_r
useradd --gid 1028 --no-create-home --no-user-group --system --uid 1028 aid_sdcard_r
groupadd --gid 1029 aid_clat
useradd --gid 1029 --no-create-home --no-user-group --system --uid 1029 aid_clat
groupadd --gid 1030 aid_loop_radio
useradd --gid 1030 --no-create-home --no-user-group --system --uid 1030 aid_loop_radio
groupadd --gid 1031 aid_mediadrm
useradd --gid 1031 --no-create-home --no-user-group --system --uid 1031 aid_mediadrm
groupadd --gid 1032 aid_package_info
useradd --gid 1032 --no-create-home --no-user-group --system --uid 1032 aid_package_info
groupadd --gid 1033 aid_sdcard_pics
useradd --gid 1033 --no-create-home --no-user-group --system --uid 1033 aid_sdcard_pics
groupadd --gid 1034 aid_sdcard_av
useradd --gid 1034 --no-create-home --no-user-group --system --uid 1034 aid_sdcard_av
groupadd --gid 1035 aid_sdcard_all
useradd --gid 1035 --no-create-home --no-user-group --system --uid 1035 aid_sdcard_all
groupadd --gid 1036 aid_logd
useradd --gid 1036 --no-create-home --no-user-group --system --uid 1036 aid_logd
groupadd --gid 1037 aid_shared_relro
useradd --gid 1037 --no-create-home --no-user-group --system --uid 1037 aid_shared_relro
groupadd --gid 1038 aid_dbus
useradd --gid 1038 --no-create-home --no-user-group --system --uid 1038 aid_dbus
groupadd --gid 1039 aid_tlsdate
useradd --gid 1039 --no-create-home --no-user-group --system --uid 1039 aid_tlsdate
groupadd --gid 1040 aid_mediaex
useradd --gid 1040 --no-create-home --no-user-group --system --uid 1040 aid_mediaex
groupadd --gid 1041 aid_audioserver
useradd --gid 1041 --no-create-home --no-user-group --system --uid 1041 aid_audioserver
groupadd --gid 1042 aid_metrics_coll
useradd --gid 1042 --no-create-home --no-user-group --system --uid 1042 aid_metrics_coll
groupadd --gid 1043 aid_metricsd
useradd --gid 1043 --no-create-home --no-user-group --system --uid 1043 aid_metricsd
groupadd --gid 1044 aid_webserv
useradd --gid 1044 --no-create-home --no-user-group --system --uid 1044 aid_webserv
groupadd --gid 1045 aid_debuggerd
useradd --gid 1045 --no-create-home --no-user-group --system --uid 1045 aid_debuggerd
groupadd --gid 1046 aid_mediacodec
useradd --gid 1046 --no-create-home --no-user-group --system --uid 1046 aid_mediacodec
groupadd --gid 1047 aid_cameraserver
useradd --gid 1047 --no-create-home --no-user-group --system --uid 1047 aid_cameraserver
groupadd --gid 1048 aid_firewall
useradd --gid 1048 --no-create-home --no-user-group --system --uid 1048 aid_firewall
groupadd --gid 1049 aid_trunks
useradd --gid 1049 --no-create-home --no-user-group --system --uid 1049 aid_trunks
groupadd --gid 1050 aid_nvram
useradd --gid 1050 --no-create-home --no-user-group --system --uid 1050 aid_nvram
groupadd --gid 1051 aid_dns
useradd --gid 1051 --no-create-home --no-user-group --system --uid 1051 aid_dns
groupadd --gid 1052 aid_dns_tether
useradd --gid 1052 --no-create-home --no-user-group --system --uid 1052 aid_dns_tether
groupadd --gid 2000 aid_shell
useradd --gid 2000 --no-create-home --no-user-group --system --uid 2000 aid_shell
groupadd --gid 2001 aid_cache
useradd --gid 2001 --no-create-home --no-user-group --system --uid 2001 aid_cache
groupadd --gid 2002 aid_diag
useradd --gid 2002 --no-create-home --no-user-group --system --uid 2002 aid_diag
groupadd --gid 2950 aid_qcom_diag
useradd --gid 2950 --no-create-home --no-user-group --system --uid 2950 aid_qcom_diag
groupadd --gid 2951 aid_rfs
useradd --gid 2951 --no-create-home --no-user-group --system --uid 2951 aid_rfs
groupadd --gid 2952 aid_rfs_shared
useradd --gid 2952 --no-create-home --no-user-group --system --uid 2952 aid_rfs_shared
groupadd --gid 3001 aid_net_bt_admin
useradd --gid 3001 --no-create-home --no-user-group --system --uid 3001 aid_net_bt_admin
groupadd --gid 3002 aid_net_bt
useradd --gid 3002 --no-create-home --no-user-group --system --uid 3002 aid_net_bt
groupadd --gid 3003 aid_inet
useradd --gid 3003 --no-create-home --no-user-group --system --uid 3003 aid_inet
groupadd --gid 3004 aid_net_raw
useradd --gid 3004 --no-create-home --no-user-group --system --uid 3004 aid_net_raw
groupadd --gid 3005 aid_net_admin
useradd --gid 3005 --no-create-home --no-user-group --system --uid 3005 aid_net_admin
groupadd --gid 3006 aid_net_bw_stats
useradd --gid 3006 --no-create-home --no-user-group --system --uid 3006 aid_net_bw_stats
groupadd --gid 3007 aid_net_bw_acct
useradd --gid 3007 --no-create-home --no-user-group --system --uid 3007 aid_net_bw_acct
groupadd --gid 3008 aid_net_bt_stack
useradd --gid 3008 --no-create-home --no-user-group --system --uid 3008 aid_net_bt_stack
groupadd --gid 3009 aid_readproc
useradd --gid 3009 --no-create-home --no-user-group --system --uid 3009 aid_readproc
groupadd --gid 3010 aid_wakelock
useradd --gid 3010 --no-create-home --no-user-group --system --uid 3010 aid_wakelock
groupadd --gid 3011 aid_sensors
useradd --gid 3011 --no-create-home --no-user-group --system --uid 3011 aid_sensors
groupadd --gid 3012 aid_rfs_old
useradd --gid 3012 --no-create-home --no-user-group --system --uid 3012 aid_rfs_old
groupadd --gid 3013 aid_rfs_shared_old
useradd --gid 3013 --no-create-home --no-user-group --system --uid 3013 aid_rfs_shared_old
groupadd --gid 9997 aid_everybody
useradd --gid 9997 --no-create-home --no-user-group --system --uid 9997 aid_everybody
groupadd --gid 9998 aid_misc
useradd --gid 9998 --no-create-home --no-user-group --system --uid 9998 aid_misc
groupadd --gid 9999 aid_nobody
useradd --gid 9999 --no-create-home --no-user-group --system --uid 9999 aid_nobody

View file

@ -1,2 +0,0 @@
#!/bin/sh
sudo /system/bin/logcat "$@"

View file

@ -1,56 +0,0 @@
#!/sbin/openrc-run
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/app-emulation/lxc/files/lxc.initd.2,v 1.5 2012/07/21 05:07:15 flameeyes Exp $
extra_started_commands="reboot"
description="Android/Halium LXC container"
CONTAINER=android
: ${logdir:=/var/log/lxc}
: ${systemimage:=/var/lib/lxc/android/system.img}
command="/usr/bin/lxc-start"
pidfile="/var/run/lxc/$CONTAINER.pid"
depend() {
need localmount sysfs cgroups
after firewall net
}
start() {
checkpath -d /data
checkpath -d /system
ebegin "Mounting Android filesystems and starting Halium LXC container"
mount -o ro,loop $systemimage /system
/usr/lib/lxc-android/mount-android
rm -f "$logdir"/${CONTAINER}.log
checkpath -d -m 750 -o root:wheel $logdir
checkpath -d ${pidfile%/*}
start-stop-daemon --start $command \
--pidfile $pidfile \
-- \
--daemon \
--pidfile $pidfile \
--name ${CONTAINER} \
--logpriority WARN \
--logfile $logdir/${CONTAINER}.log \
|| eend $? || return $?
lxc-wait -n ${CONTAINER} -t 5 -s RUNNING
eend $?
}
stop() {
ebegin "Stopping container ${CONTAINER}"
lxc-stop -k --name ${CONTAINER}
start-stop-daemon --stop --pidfile ${pidfile} \
--retry ${POWEROFF_SIGNAL:-SIGUSR2}/${TIMEOUT:-30} \
--progress
eend $?
}

View file

@ -1,22 +0,0 @@
#!/bin/sh
# Add all Android groups with their predefined IDs
echo "Adding android groups to system"
/usr/sbin/add_android_groups.sh
# Add user to all needed Android groups
username=$(getent passwd 10000 | cut -d ":" -f 1)
if [ x$username == "x" ]; then
echo "Warning: no user with ID 10000 found!"
else
echo "Adding $username to android groups"
usermod -a -G aid_system,aid_graphics,aid_input,aid_audio,aid_net_bt_admin,aid_net_bt,aid_inet,aid_net_raw,aid_net_admin $username
fi
rc-update add cgroups default
rc-update add lxc-android default
# postmarketOS firmware loader conflicts with ueventd one
if [ -f "/etc/udev/rules.d/50-firmware.rules" ]; then
rm /etc/udev/rules.d/50-firmware.rules
fi

View file

@ -1,4 +0,0 @@
#!/bin/sh
cd /
exec chroot /run/android /init

View file

@ -1,9 +0,0 @@
#!/bin/sh
lxc_config_path="$(dirname $LXC_CONFIG_FILE)"
# Allow pre-start.sh to be provided by device package, otherwise use the default one
if [ -f "$lxc_config_path/pre-start.custom.sh" ]; then
exec $lxc_config_path/pre-start.custom.sh
else
exec $lxc_config_path/pre-start.default.sh
fi

View file

@ -1,35 +0,0 @@
diff --git a/configure.ac b/configure.ac
index 31134c3..412bce9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -6,7 +6,7 @@ AM_INIT_AUTOMAKE([foreign -Wall silent-rules])
AC_CONFIG_MACRO_DIR(m4)
AM_SILENT_RULES([yes])
-AS_IF([! test -n "$VERSION"], [
+AS_IF([! test -n "$PACKAGE_VERSION"], [
AC_MSG_ERROR([git-version-gen failed])
])
@@ -20,9 +20,9 @@ AC_PROG_CC_C99
AM_PROG_CC_C_O
AC_PROG_GCC_TRADITIONAL
-m4_define(pa_major, `echo $VERSION | cut -d. -f1 | cut -d- -f1`)
-m4_define(pa_minor, `echo $VERSION | cut -d. -f2 | cut -d- -f1`)
-m4_define(pa_module_version, `echo $VERSION | cut -d. -f3 | cut -d- -f1`)
+m4_define(pa_major, `echo $PACKAGE_VERSION | cut -d. -f1 | cut -d- -f1`)
+m4_define(pa_minor, `echo $PACKAGE_VERSION | cut -d. -f2 | cut -d- -f1`)
+m4_define(pa_module_version, `echo $PACKAGE_VERSION | cut -d. -f3 | cut -d- -f1`)
AC_SUBST(PA_MAJOR, pa_major)
AC_SUBST(PA_MAJORMINOR, pa_major.pa_minor)
@@ -326,7 +326,7 @@ AC_OUTPUT
echo "
- ---{ $PACKAGE_NAME $VERSION }---
+ ---{ $PACKAGE_NAME $PACKAGE_VERSION }---
compiler: ${CC}
CFLAGS: ${CFLAGS}

View file

@ -1,97 +0,0 @@
# Maintainer: Alexey Min <alexey.min@gmail.com>
pkgname=pulseaudio-modules-droid
# pkgver should match MAJOR.MINOR pulseaudio version
pkgver=13.0
# _pkgver used in URL to download tarball
# Yes, we can build slightly older modules version against newer pulseaudio, if we are lucky
_pkgver=12.2.84
pkgrel=2
pkgdesc="PulseAudio Droid modules by Mer project"
url="https://github.com/mer-hybris/pulseaudio-modules-droid"
arch="armhf aarch64"
license="LGPL-2.1-or-later"
depends="pulseaudio"
makedepends="autoconf automake libtool m4 intltool dbus-dev expat-dev pulseaudio-dev pulsecore-private-headers android-headers-7.1 android-headers-7.1-caf libhybris-dev libhybris-7.1"
options="!check" # No test suite available
source="
$pkgname-$_pkgver.tar.gz::https://github.com/mer-hybris/pulseaudio-modules-droid/archive/$_pkgver.tar.gz
0001-configure-ac-compat.patch
"
install="$pkgname.post-install"
_headers_variants="7.1 7.1-caf"
for _ver in $_headers_variants; do
subpackages="$subpackages $pkgname-$_ver:_variant"
done
builddir="$srcdir/$pkgname-$_pkgver"
_tmppkgdir="$srcdir/tmpinstall"
_list_of_libs="
libdroid-sink.so
libdroid-source.so
libdroid-util.so
module-droid-card.so
module-droid-sink.so
module-droid-source.so
"
prepare() {
default_prepare
echo $pkgver > .tarball-version
autoreconf --force --install
}
build() {
# Hack to build against CAF android headers:
# use our own local pkg-config path folder
mkdir pkgconfig
ln -s /usr/lib/pkgconfig/android-headers-7.1.pc pkgconfig/android-headers.pc
export PKG_CONFIG_PATH="$builddir/pkgconfig"
./configure \
--build=$CBUILD \
--host=$CHOST \
--prefix=/usr \
--sysconfdir=/etc \
--mandir=/usr/share/man \
--localstatedir=/var \
--enable-shared \
--disable-static
# build several times against different android headers variation
for _ver in $_headers_variants; do
msg "building $pkgname-$_ver"
# Before each build make sure that include path points to correct location:
# instead of re-symlinking android-headers.pc file and re-running
# configure every time, just rewrite include paths in every Makefile
for _makefile in "Makefile src/Makefile src/common/Makefile src/droid/Makefile"; do
sed -i -E "s~/usr/include/android-[^ ]+~/usr/include/android-$_ver~g" $_makefile
done
make clean
make
# each variation is installed into a unique temporary directory
make DESTDIR="$_tmppkgdir/$pkgname-$_ver" install
done
}
package() {
# here we should run install for some common files
# for both subpackages, but we don't have anything like that
# pkgdir is still needed, otherwise "rootpkg failed"
mkdir -p "$pkgdir"
}
_variant() {
depends="$pkgname"
mkdir -p "$subpkgdir"
# Copy libs from temp install folder to a proper subpackage dir
for _lib in $_list_of_libs; do
install -Dm644 "$_tmppkgdir/$subpkgname/usr/lib/pulse-$pkgver/modules/$_lib" \
"$subpkgdir/usr/lib/pulse-$pkgver/modules/$_lib"
done
}
sha512sums="7a573573bbcfb3a6b3b82a6d75a79506809b00ab2f000b31cd2f81c6fa433daaa81eeb6a7965ab995e2e36ac87c02252dc1aad413447e82e3b70031dfa9d5e82 pulseaudio-modules-droid-12.2.84.tar.gz
2aa283c64d8623c035522b89b62c80130d14c145a73e6193e2e98c26525cc12670e50f8db4649029e731b61d08c1e5ab2bd4e1a3dae8ca077bbdabe3a69eaa17 0001-configure-ac-compat.patch"

View file

@ -1,17 +0,0 @@
#!/bin/sh
# pulseaudio default config file name
DEFAULT_PA=/etc/pulse/default.pa
# configuration lines
PA_LINES="
.ifexists /etc/pulse/arm_droid_card_custom.pa
.include /etc/pulse/arm_droid_card_custom.pa
.else
load-module module-droid-card
.endif
"
if [ -f ${DEFAULT_PA} ]; then
if ! grep -q "module-droid-card" $DEFAULT_PA; then
echo "$PA_LINES" >> $DEFAULT_PA
fi
fi

View file

@ -1,12 +0,0 @@
diff --git a/src/pulsecore/core-util.h b/src/pulsecore/core-util.h
index e28b6aa..fb0f941 100644
--- a/src/pulsecore/core-util.h
+++ b/src/pulsecore/core-util.h
@@ -26,6 +26,7 @@
#include <stdarg.h>
#include <stdio.h>
#include <string.h>
+#include <sys/socket.h>
#ifdef HAVE_SYS_RESOURCE_H
#include <sys/resource.h>

View file

@ -1,34 +0,0 @@
# Maintainer: Alexey Min <alexey.min@gmail.com>
pkgname=pulsecore-private-headers
pkgver=13.0
pkgrel=0
pkgdesc="PulseAudio internal development library (headers and pkg-config)"
url="http://www.freedesktop.org/wiki/Software/PulseAudio"
arch="all !x86 !x86_64"
license="LGPL-2.1-or-later"
depends="pulseaudio-dev libpulse pkgconfig"
options="!check" # No test suite available
source="
https://freedesktop.org/software/pulseaudio/releases/pulseaudio-$pkgver.tar.xz
pulsecore.pc
0001-core-util-add-socket-h.patch
"
builddir="$srcdir/pulseaudio-$pkgver"
build() {
sed -i "s/@PA_MAJORMINOR@/$pkgver/" "$srcdir"/pulsecore.pc
}
package() {
install -Dm644 "$srcdir"/pulsecore.pc "$pkgdir"/usr/lib/pkgconfig/pulsecore.pc
mkdir -p "$pkgdir"/usr/include/pulsecore
mkdir -p "$pkgdir"/usr/include/pulsecore/filter
cp -r "$builddir"/src/pulsecore/*.h "$pkgdir"/usr/include/pulsecore/
cp -r "$builddir"/src/pulsecore/filter/*.h "$pkgdir"/usr/include/pulsecore/filter/
}
sha512sums="d445b8ccd43029a0ca0e456fc9291a79d3434d6496ead7eb329ab348d5249235e8bde6cf2be68765d8f761452dbe1486fb10c739e40b1e67ed75787bbd24ac0c pulseaudio-13.0.tar.xz
e419ceab4779e061fb0378fc4ce0d24e2a738610b5d837866c47e9fd8044c206bb32485f7aaf0df336c2944d67b856fdee95ea6ca9e7c12954d15ae521adad66 pulsecore.pc
4e24295e5e03d3f89f5197657e7946c56e9d776c1b64306d2798075df322700ca1f89a19f1fa9ab7f379b1b33196eb316dc17a20efdc5b0e41ff47c41b567e34 0001-core-util-add-socket-h.patch"

View file

@ -1,10 +0,0 @@
prefix=/usr
libdir=/usr/lib
includedir=${prefix}/include
ver=@PA_MAJORMINOR@
Name: pulsecore
Description: Module building interface for pulseaudio
Version: @PA_MAJORMINOR@
Libs: -L${libdir} -L${libdir}/pulseaudio -L${libdir}/pulse-${ver}/modules -lpulsecore-${ver} -lpulsecommon-${ver} -lpulse
Cflags: -D_REENTRANT -D__INCLUDED_FROM_PULSE_AUDIO -DPA_DEFAULT_CONFIG_DIR=\"/etc/pulse\" -I${includedir}

View file

@ -1,4 +0,0 @@
Section "Module"
Load "drihybris"
Load "glamoreglhybris"
EndSection

View file

@ -1,79 +0,0 @@
# Maintainer: TheKit <nekit1000@gmail.com>
pkgname=xf86-video-hwcomposer
pkgver=1.0_git20190925
pkgrel=2
pkgdesc="X.Org driver for Android devices rendering through HWComposer API"
url="https://github.com/NotKit/xf86-video-hwcomposer"
arch="armhf aarch64"
license="MIT"
depends="drihybris glamor-hybris libepoxy libhybris"
makedepends="autoconf automake util-macros libtool
xorg-server-dev libxi-dev fontsproto randrproto
videoproto renderproto xf86dgaproto glamor-hybris-dev drihybris-dev
android-headers-4.4 android-headers-7.1 android-headers-7.1-caf
android-headers-9.0
libhybris-dev libhybris libhybris-9.0"
_commit="b33e119005158ddc1988b495121591496bddb915"
source="$pkgname-$_commit.tar.gz::https://github.com/NotKit/xf86-video-hwcomposer/archive/$_commit.tar.gz
fix-hwcomposer.patch
30-modules-hybris.conf"
options="!tracedeps"
subpackages="$pkgname-doc"
if [ "$CARCH" == "armhf" -o "$CARCH" == "armv7" ]; then
_vers="9.0 7.1 7.1-caf 4.4"
elif [ "$CARCH" == "aarch64" ]; then
_vers="9.0 7.1 7.1-caf"
fi
for _ver in $_vers; do
subpackages="$subpackages $pkgname-$_ver:_specific"
done
builddir="$srcdir/$pkgname-$_commit"
_tmppkgdir="$srcdir/tmpinstall"
build() {
export LDFLAGS="$LDFLAGS -Wl,-z,lazy"
export CPPFLAGS="$CPPFLAGS -I/usr/include/android-9.0 -DMESA_EGL_NO_X11_HEADERS"
NOCONFIGURE=1 ./autogen.sh
./configure \
--build=$CBUILD \
--host=$CHOST \
--prefix=/usr \
--enable-drihybris \
--enable-glamor-hybris
for _ver in $_vers; do
msg "building $pkgname-$_ver"
for _makefile in "Makefile src/Makefile"; do
sed -i -E "s~/usr/include/android-[^ ]+~/usr/include/android-$_ver~g" $_makefile
done
make clean
make
make DESTDIR="$_tmppkgdir/$pkgname-$_ver" install
done
}
package() {
install -Dm644 COPYING "$pkgdir"/usr/share/licenses/$pkgname/COPYING
install -Dm644 "$srcdir"/30-modules-hybris.conf \
"$pkgdir"/etc/X11/xorg.conf.d/30-modules-hybris.conf
}
_specific() {
_hybrisver="$(echo $subpkgname | cut -d '-' -f4)"
depends="$depends libhybris-$_hybrisver"
_lib="xorg/modules/drivers/hwcomposer_drv.so"
install -Dm644 "$_tmppkgdir/$subpkgname/usr/lib/$_lib" \
"$subpkgdir/usr/lib/$_lib"
}
sha512sums="61c7f528c0f8848edc72b4f926095a610abf9b7ea1512cce518d6dae359e76a6eb50fc18558238fc3dc6a31ce3cc3237e4663198a05744400282db2825ee6ddb xf86-video-hwcomposer-b33e119005158ddc1988b495121591496bddb915.tar.gz
b76bceba0e784e079b4093f6e4405763f17c4d817ca977e9f8f8878294d37a3876efbbb0dc6ef7f4ce466ccd77bce7e72362c0e3b5ac6dfdb0144ccaac503876 fix-hwcomposer.patch
e8f9f6ec337e88ec440c4bdc3f3441a8252031d1a4265a251b500a087a2c88336861c7e3f81972019f6a492324e94253726ce031fedad60ff582dd8db73efac6 30-modules-hybris.conf"

View file

@ -1,13 +0,0 @@
diff --git a/src/hwcomposer.c b/src/hwcomposer.c
index bb6d204..52e06df 100644
--- a/src/hwcomposer.c
+++ b/src/hwcomposer.c
@@ -123,7 +123,7 @@ Bool hwc_hwcomposer_init(ScrnInfoPtr pScrn)
return hwc_hwcomposer2_init(pScrn);
#endif
- hwc_composer_device_1_t *hwcDevicePtr = (hwc_composer_device_1_t*) hwcDevice;
+ hwc_composer_device_1_t *hwcDevicePtr = hwc->hwcDevicePtr = (hwc_composer_device_1_t*) hwcDevice;
hwc_set_power_mode(pScrn, HWC_DISPLAY_PRIMARY, 1);
uint32_t configs[5];