public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: media-libs/raspberrypi-userland/files/, media-libs/raspberrypi-userland/
@ 2016-03-08 23:20 Miroslav Šulc
  0 siblings, 0 replies; 5+ messages in thread
From: Miroslav Šulc @ 2016-03-08 23:20 UTC (permalink / raw
  To: gentoo-commits

commit:     761027aca528e7290f964ff4163408c908b7c04e
Author:     Miroslav Šulc <fordfrog <AT> gentoo <DOT> org>
AuthorDate: Tue Mar  8 23:20:02 2016 +0000
Commit:     Miroslav Šulc <fordfrog <AT> gentoo <DOT> org>
CommitDate: Tue Mar  8 23:20:02 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=761027ac

media-libs/raspberrypi-userland: version bump and fixed regular user access rights to vchiq when using udev

Package-Manager: portage-2.2.27

 media-libs/raspberrypi-userland/Manifest           |  1 +
 .../files/92-local-vchiq-permissions.rules         |  1 +
 .../raspberrypi-userland-0_pre20160305.ebuild      | 87 ++++++++++++++++++++++
 3 files changed, 89 insertions(+)

diff --git a/media-libs/raspberrypi-userland/Manifest b/media-libs/raspberrypi-userland/Manifest
index 730152c..b4e59ea 100644
--- a/media-libs/raspberrypi-userland/Manifest
+++ b/media-libs/raspberrypi-userland/Manifest
@@ -2,3 +2,4 @@ DIST raspberrypi-userland-0_pre20130705.tar.xz 31966608 SHA256 6307cc9d6103cd8af
 DIST raspberrypi-userland-0_pre20140117.tar.xz 31998784 SHA256 2999d711465ddbc6b70d429a0253b8a9c1f838351a96f2b25cc86109a879005f SHA512 5c3dfebdcb36a2a17da94cafcc92067b24b454d5694b0bd216dd0d6752c4f505840880094c22125ab5da60f7b53b9114e8d04359a223e9e00be967cb8585e42e WHIRLPOOL 5179758c2be4b45f640eb8759554e19ea4fc8c83e63b0d4396ae84e67ae82e97824bf12f0766df5a70e2ca5b80e90be80e5c9b2eaa968752829765463d3f6d0d
 DIST raspberrypi-userland-0_pre20140830.tar.xz 32066536 SHA256 f9a06d2ca7d41cdc700b83eeb7c3e06d3ea6bd3fd187880a563144a6bf6ee901 SHA512 775005177e760fff611d7ce7e4beb466ea111dfc4652b97593d1061b97b1ded32979f8666a0aada6338791abab988883bbfd902f267eba5734e8aa932ebcf487 WHIRLPOOL 3066272a88b868ef20f27614f6f680aa6eb8a43cd2e281a7a930b99be341b037fa843a1c36bfdc6be619544e5b4b8751e5ab58c853b1baff44894b39284bfa55
 DIST raspberrypi-userland-0_pre20150921.tar.xz 32395092 SHA256 771bf96111d40c3b86cf2590f22d02306e5f56668f6ee11ace389c719bfccb2b SHA512 0aad096f5c6d54ef1d494708e80f8fb921e30e0d93ced79b4e939afffa8e824e35347595d6f925d1d7ee86917e72fa0b160ad56c8a4df7711d5e87b5cc399be1 WHIRLPOOL 2204dd8f8acf79c3d8baab770e133d18596f00fbf714e9ab46bf4a5ae1a1c0cf9edcbf763bf7fc0403126bb0ca9de7f422a3427dd429d849df6aee1be08b4b6a
+DIST raspberrypi-userland-0_pre20160305.tar.gz 32888927 SHA256 01cc6dfb5ee50733d58e6cb1ba0f79cb90ab7ef46718c302cbac0fd9e3a09b6a SHA512 8621f48d699b2736d4a22f03e5cdde6be564b8d2100f46ab85d3f6e0fc958634436fafc8d218f55a114a37acaf6dbe21b5cf2bf57c258a3067af2720d63d0c27 WHIRLPOOL 109aabddfc483900741758a737f93c1f3bc4074de2e2f0d25d28a620f8381adb44d21b5fa8eb3f59a69eb3a9903b95b32e3a5d9d9353560d42e37d19aaa9b085

diff --git a/media-libs/raspberrypi-userland/files/92-local-vchiq-permissions.rules b/media-libs/raspberrypi-userland/files/92-local-vchiq-permissions.rules
new file mode 100644
index 0000000..bacea0e
--- /dev/null
+++ b/media-libs/raspberrypi-userland/files/92-local-vchiq-permissions.rules
@@ -0,0 +1 @@
+SUBSYSTEM=="vchiq",GROUP="video",MODE="0660"

diff --git a/media-libs/raspberrypi-userland/raspberrypi-userland-0_pre20160305.ebuild b/media-libs/raspberrypi-userland/raspberrypi-userland-0_pre20160305.ebuild
new file mode 100644
index 0000000..5676f12
--- /dev/null
+++ b/media-libs/raspberrypi-userland/raspberrypi-userland-0_pre20160305.ebuild
@@ -0,0 +1,87 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit cmake-utils
+
+DESCRIPTION="Raspberry Pi userspace tools and libraries"
+HOMEPAGE="https://github.com/raspberrypi/userland"
+
+if [[ ${PV} == 9999* ]]; then
+	inherit git-2
+	EGIT_REPO_URI="git://github.com/${PN/-//}.git"
+	SRC_URI=""
+	KEYWORDS=""
+else
+	GIT_COMMIT="8369e39"
+	SRC_URI="https://github.com/raspberrypi/userland/tarball/${GIT_COMMIT} -> ${P}.tar.gz"
+	KEYWORDS="~arm"
+	S="${WORKDIR}/raspberrypi-userland-${GIT_COMMIT}"
+fi
+
+IUSE="examples"
+LICENSE="BSD"
+SLOT="0"
+
+# TODO:
+# * port vcfiled init script
+# * stuff is still installed to hardcoded /opt/vc location, investigate whether
+#   anything else depends on it being there
+# * live ebuild
+
+src_unpack() {
+	if [[ ${PV} == 9999* ]]; then
+		git-2_src_unpack
+	else
+		default
+	fi
+}
+
+src_prepare() {
+	# init script for Debian, not useful on Gentoo
+	sed -i "/DESTINATION \/etc\/init.d/,+2d" interface/vmcs_host/linux/vcfiled/CMakeLists.txt || die
+}
+
+src_install() {
+	cmake-utils_src_install
+
+	doenvd "${FILESDIR}"/04${PN}
+
+	dodir /etc/udev/rules.d
+	insinto /etc/udev/rules.d
+	doins "${FILESDIR}"/92-local-vchiq-permissions.rules
+
+	# enable dynamic switching of the GL implementation
+	dodir /usr/lib/opengl
+	dosym ../../../opt/vc /usr/lib/opengl/${PN}
+
+	# tell eselect opengl that we do not have libGL
+	touch "${ED}"/opt/vc/.gles-only
+
+	# some #include instructions are wrong so we need to fix them
+	einfo "Fixing #include \"vcos_platform_types.h\""
+	for file in $(grep -l "#include \"vcos_platform_types.h\"" "${D}"/opt/vc/include/* -r); do
+		einfo "  Fixing file ${file}"
+		sed -i "s%#include \"vcos_platform_types.h\"%#include \"interface/vcos/pthreads/vcos_platform_types.h\"%g" ${file}
+	done
+	einfo "Fixing #include \"vcos_platform.h\""
+	for file in $(grep -l "#include \"vcos_platform.h\"" "${D}"/opt/vc/include/* -r); do
+		einfo "  Fixing file ${file}"
+	sed -i "s%#include \"vcos_platform.h\"%#include \"interface/vcos/pthreads/vcos_platform.h\"%g" ${file}
+	done
+	einfo "Fixing #include \"vchost_config.h\""
+	for file in $(grep -l "#include \"vchost_config.h\"" "${D}"/opt/vc/include/* -r); do
+		einfo "  Fixing file ${file}"
+		sed -i "s%#include \"vchost_config.h\"%#include \"interface/vmcs_host/linux/vchost_config.h\"%g" ${file}
+	done
+
+	if use examples ; then
+		dodir /usr/share/doc/${PF}/examples
+		mv "${D}"/opt/vc/src/hello_pi "${D}"/usr/share/doc/${PF}/examples/ || die
+		rm -fr "${D}"/opt/vc/src
+	else
+		rm -fr "${D}/opt/vc/src"
+	fi
+}


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: media-libs/raspberrypi-userland/files/, media-libs/raspberrypi-userland/
@ 2016-03-10 14:04 Miroslav Šulc
  0 siblings, 0 replies; 5+ messages in thread
From: Miroslav Šulc @ 2016-03-10 14:04 UTC (permalink / raw
  To: gentoo-commits

commit:     06c415c57f1452d3376499ff82128d9b7013f64a
Author:     Miroslav Šulc <fordfrog <AT> gentoo <DOT> org>
AuthorDate: Thu Mar 10 14:04:43 2016 +0000
Commit:     Miroslav Šulc <fordfrog <AT> gentoo <DOT> org>
CommitDate: Thu Mar 10 14:04:43 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=06c415c5

media-libs/raspberrypi-userland: bug fixes and improvements

fixed bug #539504: support for GLESv1
fixed bugs #499768 and #529424: added pkgconfig files and set environment path to these files
fixed location of udev rules file
fixed bug #499768: added support for wayland from leio.git overlay

Package-Manager: portage-2.2.27

 .../files/04raspberrypi-userland                   |   2 +-
 media-libs/raspberrypi-userland/files/bcm_host.pc  |  10 +
 media-libs/raspberrypi-userland/files/egl.pc       |  11 ++
 media-libs/raspberrypi-userland/files/glesv2.pc    |  11 ++
 .../files/next-resource-handle.patch               | 207 +++++++++++++++++++++
 .../raspberrypi-userland/files/wayland-wsys.patch  |   0
 ...> raspberrypi-userland-0_pre20160305-r1.ebuild} |  27 ++-
 7 files changed, 264 insertions(+), 4 deletions(-)

diff --git a/media-libs/raspberrypi-userland/files/04raspberrypi-userland b/media-libs/raspberrypi-userland/files/04raspberrypi-userland
index fd37f49..17b493b 100644
--- a/media-libs/raspberrypi-userland/files/04raspberrypi-userland
+++ b/media-libs/raspberrypi-userland/files/04raspberrypi-userland
@@ -1,3 +1,3 @@
-
+PKG_CONFIG_PATH='/opt/vc/lib/pkgconfig'
 PATH='/opt/vc/bin'
 LDPATH='/opt/vc/lib'

diff --git a/media-libs/raspberrypi-userland/files/bcm_host.pc b/media-libs/raspberrypi-userland/files/bcm_host.pc
new file mode 100644
index 0000000..7627ae8
--- /dev/null
+++ b/media-libs/raspberrypi-userland/files/bcm_host.pc
@@ -0,0 +1,10 @@
+prefix=/opt/vc
+exec_prefix=${prefix}
+libdir=${exec_prefix}/lib
+includedir=${prefix}/include
+
+Name: bcm_host
+Description: Broadcom VideoCore host API library
+Version: 1
+Libs: -L${libdir} -lbcm_host -lvcos -lvchiq_arm
+Cflags: -I${includedir} -I${includedir}/interface/vmcs_host/linux -I${includedir}/interface/vcos/pthreads -DUSE_VCHIQ_ARM

diff --git a/media-libs/raspberrypi-userland/files/egl.pc b/media-libs/raspberrypi-userland/files/egl.pc
new file mode 100644
index 0000000..56bf1e0
--- /dev/null
+++ b/media-libs/raspberrypi-userland/files/egl.pc
@@ -0,0 +1,11 @@
+prefix=/opt/vc
+exec_prefix=${prefix}
+libdir=${exec_prefix}/lib
+includedir=${prefix}/include
+
+Name: EGL
+Description: Fake EGL package for RPi
+Version: 10
+Requires: bcm_host glesv2
+Libs: -L${libdir} -lEGL
+Cflags: -I${includedir}

diff --git a/media-libs/raspberrypi-userland/files/glesv2.pc b/media-libs/raspberrypi-userland/files/glesv2.pc
new file mode 100644
index 0000000..04d61c2
--- /dev/null
+++ b/media-libs/raspberrypi-userland/files/glesv2.pc
@@ -0,0 +1,11 @@
+prefix=/opt/vc
+exec_prefix=${prefix}
+libdir=${exec_prefix}/lib
+includedir=${prefix}/include
+
+Name: GLESv2
+Description: Fake GL ES 2 package for RPi
+Version: 10
+Requires: bcm_host
+Libs: -L${libdir} -lGLESv2
+Cflags: -I${includedir}

diff --git a/media-libs/raspberrypi-userland/files/next-resource-handle.patch b/media-libs/raspberrypi-userland/files/next-resource-handle.patch
new file mode 100644
index 0000000..45e1a49
--- /dev/null
+++ b/media-libs/raspberrypi-userland/files/next-resource-handle.patch
@@ -0,0 +1,207 @@
+From 825c3236e5908ff003644abd870bfe98e82722b2 Mon Sep 17 00:00:00 2001
+From: Dom Cobley <dc4@broadcom.com>
+Date: Tue, 9 Jul 2013 09:26:26 -0400
+Subject: [PATCH] Allow applications to set next resource handle
+
+This patch adds provisions in userland to
+let apps callers set the next rendereing dispmanx resource.
+It's useful for implementing, say, a buffer carousel.
+---
+ interface/khronos/common/khrn_client_rpc.h |  2 ++
+ interface/khronos/common/khrn_int_ids.h    |  2 ++
+ interface/khronos/egl/egl_client.c         | 30 +++++++++++++++++++++++++++---
+ interface/khronos/egl/egl_client_surface.c | 24 +++++++++++++++++++++++-
+ interface/khronos/egl/egl_client_surface.h |  3 ++-
+ interface/khronos/egl/egl_int_impl.h       |  5 +++--
+ 6 files changed, 59 insertions(+), 7 deletions(-)
+
+diff --git a/interface/khronos/common/khrn_client_rpc.h b/interface/khronos/common/khrn_client_rpc.h
+index 418aa67..a7557a8 100644
+--- a/interface/khronos/common/khrn_client_rpc.h
++++ b/interface/khronos/common/khrn_client_rpc.h
+@@ -683,6 +683,7 @@ static INLINE void rpc_call18(CLIENT_THREAD_STATE_T *thread, uint32_t id, uint32
+ static INLINE void rpc_call13_out_ctrl(CLIENT_THREAD_STATE_T *thread,uint32_t id, uint32_t p0, uint32_t p1, uint32_t p2, uint32_t p3, uint32_t p4, uint32_t p5, uint32_t p6, uint32_t p7, uint32_t p8, uint32_t p9, uint32_t p10, uint32_t p11, void *out)               { rpc_begin(thread); RPC_CALL(thread, id, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11);      rpc_recv(thread, out, NULL, (RPC_RECV_FLAG_T)(RPC_RECV_FLAG_CTRL | RPC_RECV_FLAG_LEN)); rpc_end(thread); }
+ static INLINE void rpc_call14_out_ctrl(CLIENT_THREAD_STATE_T *thread,uint32_t id, uint32_t p0, uint32_t p1, uint32_t p2, uint32_t p3, uint32_t p4, uint32_t p5, uint32_t p6, uint32_t p7, uint32_t p8, uint32_t p9, uint32_t p10, uint32_t p11, uint32_t p12, void *out) { rpc_begin(thread); RPC_CALL(thread, id, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12); rpc_recv(thread, out, NULL, (RPC_RECV_FLAG_T)(RPC_RECV_FLAG_CTRL | RPC_RECV_FLAG_LEN)); rpc_end(thread); }
+ static INLINE void rpc_call15_out_ctrl(CLIENT_THREAD_STATE_T *thread,uint32_t id, uint32_t p0, uint32_t p1, uint32_t p2, uint32_t p3, uint32_t p4, uint32_t p5, uint32_t p6, uint32_t p7, uint32_t p8, uint32_t p9, uint32_t p10, uint32_t p11, uint32_t p12, uint32_t p13, void *out) { rpc_begin(thread); RPC_CALL(thread, id, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13); rpc_recv(thread, out, NULL, (RPC_RECV_FLAG_T)(RPC_RECV_FLAG_CTRL | RPC_RECV_FLAG_LEN)); rpc_end(thread); }
++static INLINE void rpc_call16_out_ctrl(CLIENT_THREAD_STATE_T *thread,uint32_t id, uint32_t p0, uint32_t p1, uint32_t p2, uint32_t p3, uint32_t p4, uint32_t p5, uint32_t p6, uint32_t p7, uint32_t p8, uint32_t p9, uint32_t p10, uint32_t p11, uint32_t p12, uint32_t p13, uint32_t p14, void *out) { rpc_begin(thread); RPC_CALL(thread, id, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14); rpc_recv(thread, out, NULL, (RPC_RECV_FLAG_T)(RPC_RECV_FLAG_CTRL | RPC_RECV_FLAG_LEN)); rpc_end(thread); }
+ #endif
+ 
+ #define RPC_CALL1_OUT_CTRL(fn, thread, id, out)                                               rpc_call1_out_ctrl(thread, id, out)
+@@ -700,6 +701,7 @@ static INLINE void rpc_call18(CLIENT_THREAD_STATE_T *thread, uint32_t id, uint32
+ #define RPC_CALL13_OUT_CTRL(fn, thread, id, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, out)      rpc_call13_out_ctrl(thread, id, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, out)
+ #define RPC_CALL14_OUT_CTRL(fn, thread, id, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, out) rpc_call14_out_ctrl(thread, id, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, out)
+ #define RPC_CALL15_OUT_CTRL(fn, thread, id, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, out) rpc_call15_out_ctrl(thread, id, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, out)
++#define RPC_CALL16_OUT_CTRL(fn, thread, id, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, out) rpc_call16_out_ctrl(thread, id, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, out)
+ 
+ # if !defined(__SYMBIAN32__)  //use functions defined in khrpc.cpp
+ static INLINE uint32_t rpc_call1_out_ctrl_res(CLIENT_THREAD_STATE_T *thread,uint32_t id, void *out)                                                                                                                       { uint32_t res; rpc_begin(thread); RPC_CALL(thread, id);                                     res = rpc_recv(thread, out, NULL, (RPC_RECV_FLAG_T)(RPC_RECV_FLAG_RES | RPC_RECV_FLAG_CTRL | RPC_RECV_FLAG_LEN)); rpc_end(thread); return res; }
+diff --git a/interface/khronos/common/khrn_int_ids.h b/interface/khronos/common/khrn_int_ids.h
+index 8378f4a..ec961e0 100644
+--- a/interface/khronos/common/khrn_int_ids.h
++++ b/interface/khronos/common/khrn_int_ids.h
+@@ -367,6 +367,7 @@
+ */
+ 
+ #define EGLINTCREATESURFACE_ID            0x4000
++#define EGLINTCREATESURFACE_ID_V2         0x4100
+ #define EGLINTCREATEGLES11_ID             0x4001
+ #define EGLINTCREATEGLES20_ID             0x4002
+ #define EGLINTCREATEVG_ID                 0x4003
+@@ -377,6 +378,7 @@
+ #define EGLINTMAKECURRENT_ID              0x4008
+ #define EGLINTFLUSHANDWAIT_ID             0x4009
+ #define EGLINTSWAPBUFFERS_ID              0x400a
++#define EGLINTSWAPBUFFERS_ID_V2           0x410a
+ #define EGLINTSELECTMIPMAP_ID             0x400b
+ #define EGLINTFLUSH_ID                    0x400c
+ #define EGLINTGETCOLORDATA_ID             0x400d
+diff --git a/interface/khronos/egl/egl_client.c b/interface/khronos/egl/egl_client.c
+index fd07eb6..e902d19 100644
+--- a/interface/khronos/egl/egl_client.c
++++ b/interface/khronos/egl/egl_client.c
+@@ -162,6 +162,17 @@
+ void egl_gl_flush_callback(bool wait);
+ void egl_vg_flush_callback(bool wait);
+ 
++#include "interface/vmcs_host/vc_dispmanx_types.h"
++/**HACKHACK - give us the ability to inject a DispmanX 
++ * resource handle into the CreateWindowSurface and 
++ * SwapBuffers calls */ 
++static DISPMANX_RESOURCE_HANDLE_T next_resource_handle;
++
++EGLAPI EGLBoolean EGLAPIENTRY eglSetNextResourceHandle(DISPMANX_RESOURCE_HANDLE_T handle)
++{
++   next_resource_handle = handle;
++}
++
+ /*
+ TODO: do an RPC call to make sure the Khronos vll is loaded (and that it stays loaded until eglTerminate)
+ Also affects global image (and possibly others?)
+@@ -643,7 +654,8 @@ EGLAPI EGLSurface EGLAPIENTRY eglCreateWindowSurface(EGLDisplay dpy, EGLConfig c
+                                 false,
+                                 EGL_NO_TEXTURE,
+                                 EGL_NO_TEXTURE,
+-                                0, 0);
++                                0, 0,
++                                next_resource_handle);
+ 
+                if (surface) {
+                   if (khrn_pointer_map_insert(&process->surfaces, process->next_surface, surface)) {
+@@ -888,7 +900,7 @@ EGLAPI EGLSurface EGLAPIENTRY eglCreatePbufferSurface(EGLDisplay dpy, EGLConfig
+                              mipmap_texture,
+                              texture_format,
+                              texture_target,
+-                             0, 0);
++                             0, 0, 0);
+ 
+             if (surface) {
+                if (khrn_pointer_map_insert(&process->surfaces, process->next_surface, surface)) {
+@@ -1030,7 +1042,7 @@ EGLAPI EGLSurface EGLAPIENTRY eglCreatePixmapSurface(EGLDisplay dpy, EGLConfig c
+                                    false,
+                                    EGL_NO_TEXTURE,
+                                    EGL_NO_TEXTURE,
+-                                   pixmap, ((server_handle[0] == 0) && (server_handle[1] == (uint32_t)(-1))) ? NULL : server_handle);
++                                   pixmap, ((server_handle[0] == 0) && (server_handle[1] == (uint32_t)(-1))) ? NULL : server_handle, 0);
+ 
+                      if (surface) {
+                         if (khrn_pointer_map_insert(&process->surfaces, process->next_surface, surface)) {
+@@ -2302,6 +2314,18 @@ EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffers(EGLDisplay dpy, EGLSurface surf)
+ 
+                vcos_log_trace("eglSwapBuffers server call");
+ 
++               if (next_resource_handle)
++               RPC_CALL7(eglIntSwapBuffers_impl,
++                     thread,
++                     EGLINTSWAPBUFFERS_ID_V2,
++                     RPC_UINT(surface->serverbuffer),
++                     RPC_UINT(surface->width),
++                     RPC_UINT(surface->height),
++                     RPC_UINT(surface->internal_handle),
++                     RPC_UINT(surface->swap_behavior == EGL_BUFFER_PRESERVED ? 1 : 0),
++                     RPC_UINT(khrn_platform_get_window_position(surface->win)),
++                     RPC_INT(next_resource_handle));
++               else
+                RPC_CALL6(eglIntSwapBuffers_impl,
+                      thread,
+                      EGLINTSWAPBUFFERS_ID,
+diff --git a/interface/khronos/egl/egl_client_surface.c b/interface/khronos/egl/egl_client_surface.c
+index cda5943..0be56c5 100644
+--- a/interface/khronos/egl/egl_client_surface.c
++++ b/interface/khronos/egl/egl_client_surface.c
+@@ -314,7 +314,8 @@ EGL_SURFACE_T *egl_surface_create(
+    EGLenum texture_format,
+    EGLenum texture_target,
+    EGLNativePixmapType pixmap,
+-   const uint32_t *pixmap_server_handle)
++   const uint32_t *pixmap_server_handle,
++   DISPMANX_RESOURCE_HANDLE_T next_resource_handle)
+ {
+    KHRN_IMAGE_FORMAT_T color;
+    KHRN_IMAGE_FORMAT_T depth;
+@@ -473,6 +474,27 @@ EGL_SURFACE_T *egl_surface_create(
+ #endif
+          uint32_t results[3];
+ 
++         if (next_resource_handle)
++         RPC_CALL16_OUT_CTRL(eglIntCreateSurface_impl,
++                             thread,
++                             EGLINTCREATESURFACE_ID_V2,
++                             RPC_UINT(serverwin),
++                             RPC_UINT(buffers),
++                             RPC_UINT(width),
++                             RPC_UINT(height),
++                             RPC_UINT(color),
++                             RPC_UINT(depth),
++                             RPC_UINT(mask),
++                             RPC_UINT(multi),
++                             RPC_UINT(largest_pbuffer),
++                             RPC_UINT(mipmap_texture),
++                             RPC_UINT(config_depth_bits),
++                             RPC_UINT(config_stencil_bits),
++                             RPC_UINT(sem_name),
++                             RPC_UINT(type),
++                             RPC_INT(next_resource_handle),
++                             results);
++         else
+          RPC_CALL15_OUT_CTRL(eglIntCreateSurface_impl,
+                              thread,
+                              EGLINTCREATESURFACE_ID,
+diff --git a/interface/khronos/egl/egl_client_surface.h b/interface/khronos/egl/egl_client_surface.h
+index c99d44c..b5bf70a 100644
+--- a/interface/khronos/egl/egl_client_surface.h
++++ b/interface/khronos/egl/egl_client_surface.h
+@@ -322,7 +322,8 @@ extern EGL_SURFACE_T *egl_surface_create(
+    EGLenum texture_format,
+    EGLenum texture_target,
+    EGLNativePixmapType pixmap,
+-   const uint32_t *pixmap_server_handle);
++   const uint32_t *pixmap_server_handle,
++   DISPMANX_RESOURCE_HANDLE_T next_resource_handle);
+ extern EGL_SURFACE_T *egl_surface_from_vg_image(
+    VGImage vg_handle,
+    EGLSurface name,
+diff --git a/interface/khronos/egl/egl_int_impl.h b/interface/khronos/egl/egl_int_impl.h
+index 8a5734c..51b3580 100644
+--- a/interface/khronos/egl/egl_int_impl.h
++++ b/interface/khronos/egl/egl_int_impl.h
+@@ -56,7 +56,8 @@
+    uint32_t config_stencil_bits,
+    uint32_t sem,
+    uint32_t type,
+-   uint32_t *results))
++   uint32_t *results,
++   DISPMANX_RESOURCE_HANDLE_T next_resource_handle))
+ 
+ FN(int, eglIntCreatePbufferFromVGImage_impl, (
+    VGImage vg_handle,
+@@ -110,7 +111,7 @@
+ FN(int, eglIntFlushAndWait_impl, (uint32_t flushgl, uint32_t flushvg))
+ FN(void, eglIntFlush_impl, (uint32_t flushgl, uint32_t flushvg))
+ 
+-FN(void, eglIntSwapBuffers_impl, (EGL_SURFACE_ID_T s, uint32_t width, uint32_t height, uint32_t handle, uint32_t preserve, uint32_t position))
++FN(void, eglIntSwapBuffers_impl, (EGL_SURFACE_ID_T s, uint32_t width, uint32_t height, uint32_t handle, uint32_t preserve, uint32_t position, DISPMANX_RESOURCE_HANDLE_T new_back_buffer))
+ FN(void, eglIntSelectMipmap_impl, (EGL_SURFACE_ID_T s, int level))
+ 
+ FN(void, eglIntGetColorData_impl, (EGL_SURFACE_ID_T s, KHRN_IMAGE_FORMAT_T format, uint32_t width, uint32_t height, int32_t stride, uint32_t y_offset, void *data))
+-- 
+1.8.5.1

diff --git a/media-libs/raspberrypi-userland/files/wayland-wsys.patch b/media-libs/raspberrypi-userland/files/wayland-wsys.patch
new file mode 100644
index 0000000..e69de29

diff --git a/media-libs/raspberrypi-userland/raspberrypi-userland-0_pre20160305.ebuild b/media-libs/raspberrypi-userland/raspberrypi-userland-0_pre20160305-r1.ebuild
similarity index 74%
rename from media-libs/raspberrypi-userland/raspberrypi-userland-0_pre20160305.ebuild
rename to media-libs/raspberrypi-userland/raspberrypi-userland-0_pre20160305-r1.ebuild
index 5676f12..8ef911f 100644
--- a/media-libs/raspberrypi-userland/raspberrypi-userland-0_pre20160305.ebuild
+++ b/media-libs/raspberrypi-userland/raspberrypi-userland-0_pre20160305-r1.ebuild
@@ -21,7 +21,12 @@ else
 	S="${WORKDIR}/raspberrypi-userland-${GIT_COMMIT}"
 fi
 
-IUSE="examples"
+RDEPEND="!media-libs/raspberrypi-userland-bin
+	wayland? ( dev-libs/wayland )"
+DEPEND="${RDEPEND}
+	wayland? ( virtual/pkgconfig )"
+
+IUSE="examples wayland"
 LICENSE="BSD"
 SLOT="0"
 
@@ -42,15 +47,21 @@ src_unpack() {
 src_prepare() {
 	# init script for Debian, not useful on Gentoo
 	sed -i "/DESTINATION \/etc\/init.d/,+2d" interface/vmcs_host/linux/vcfiled/CMakeLists.txt || die
+
+	# wayland egl support
+	epatch "${FILESDIR}"/next-resource-handle.patch \
+		"${FILESDIR}"/wayland-wsys.patch
 }
 
 src_install() {
 	cmake-utils_src_install
 
+	# provide OpenGL ES v1 according to https://github.com/raspberrypi/firmware/issues/78
+	dosym libGLESv2.so /opt/vc/lib/libGLESv1_CM.so
+
 	doenvd "${FILESDIR}"/04${PN}
 
-	dodir /etc/udev/rules.d
-	insinto /etc/udev/rules.d
+	insinto /lib/udev/rules.d
 	doins "${FILESDIR}"/92-local-vchiq-permissions.rules
 
 	# enable dynamic switching of the GL implementation
@@ -60,6 +71,16 @@ src_install() {
 	# tell eselect opengl that we do not have libGL
 	touch "${ED}"/opt/vc/.gles-only
 
+	insinto /opt/vc/lib/pkgconfig
+	doins "${FILESDIR}"/bcm_host.pc
+	doins "${FILESDIR}"/egl.pc
+	doins "${FILESDIR}"/glesv2.pc
+	if use wayland; then
+	# Missing wayland-egl version from the patch; claim 9.0 (a mesa version) for now, so gst-plugins-bad wayland-egl check is happy
+		sed -i -e 's/Version:  /Version: 9.0/' "${ED}"/opt/vc/lib/pkgconfig/wayland-egl.pc
+		doins "${ED}"/opt/vc/lib/pkgconfig/wayland-egl.pc # Maybe move?
+	fi
+
 	# some #include instructions are wrong so we need to fix them
 	einfo "Fixing #include \"vcos_platform_types.h\""
 	for file in $(grep -l "#include \"vcos_platform_types.h\"" "${D}"/opt/vc/include/* -r); do


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: media-libs/raspberrypi-userland/files/, media-libs/raspberrypi-userland/
@ 2016-05-11 12:27 Alfredo Tupone
  0 siblings, 0 replies; 5+ messages in thread
From: Alfredo Tupone @ 2016-05-11 12:27 UTC (permalink / raw
  To: gentoo-commits

commit:     aa1bf72c3e52e5420c82fd1088032cf222447496
Author:     Tupone Alfredo <tupone <AT> gentoo <DOT> org>
AuthorDate: Wed May 11 12:25:26 2016 +0000
Commit:     Alfredo Tupone <tupone <AT> gentoo <DOT> org>
CommitDate: Wed May 11 12:26:56 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=aa1bf72c

media-libs/raspberrypi-userland: patches accepted by upstream

Package-Manager: portage-2.2.26

 .../files/raspberrypi-userland-9999-gentoo.patch   | 60 ----------------------
 .../raspberrypi-userland-9999.ebuild               | 10 +++-
 2 files changed, 9 insertions(+), 61 deletions(-)

diff --git a/media-libs/raspberrypi-userland/files/raspberrypi-userland-9999-gentoo.patch b/media-libs/raspberrypi-userland/files/raspberrypi-userland-9999-gentoo.patch
index 2c465c7..f58e288 100644
--- a/media-libs/raspberrypi-userland/files/raspberrypi-userland-9999-gentoo.patch
+++ b/media-libs/raspberrypi-userland/files/raspberrypi-userland-9999-gentoo.patch
@@ -8,63 +8,3 @@
  
  # do we actually need this?
  add_definitions(-D__VIDEOCORE4__)
---- interface/vchiq_arm/vchiq_test.c.old	2015-02-20 20:52:15.202983349 +0100
-+++ interface/vchiq_arm/vchiq_test.c	2015-02-20 20:53:34.401882346 +0100
-@@ -130,6 +130,7 @@
- #ifdef __linux__
- 
- #include <fcntl.h>
-+#include <sys/ioctl.h>
- #include "interface/vmcs_host/vc_cma.h"
- 
- static void reserve_test(int reserve, int delay)
-@@ -1311,6 +1312,7 @@
- clnt_callback(VCHIQ_REASON_T reason, VCHIQ_HEADER_T *header,
-    VCHIQ_SERVICE_HANDLE_T service, void *bulk_userdata)
- {
-+   int data;
-    vcos_mutex_lock(&g_mutex);
-    if (reason == VCHIQ_MESSAGE_AVAILABLE)
-    {
-@@ -1318,7 +1320,7 @@
-          vchiq_release_message(service, header);
-       else
-       /* Responses of length 0 are not sync points */
--      if ((header->size >= 4) && (*(int *)header->data == MSG_ECHO))
-+      if ((header->size >= 4) && (memcpy(&data, header->data, sizeof(data)), data == MSG_ECHO))
-       {
-          /* This is a complete echoed packet */
-          if (g_params.verify && (mem_check(header->data, bulk_tx_data[ctrl_received % NUM_BULK_BUFS], g_params.blocksize) != 0))
---- makefiles/cmake/vmcs.cmake.old	2015-02-21 14:31:57.608527445 +0100
-+++ makefiles/cmake/vmcs.cmake	2015-02-21 14:32:09.358363958 +0100
-@@ -10,7 +10,7 @@
- if (ANDROID)
-   SET(VMCS_INSTALL_PREFIX "/vendor/brcm/islands" CACHE PATH "Prefix prepended to install directories" FORCE)
- else()
--  SET(VMCS_INSTALL_PREFIX "/opt/vc" CACHE PATH "Prefix prepended to install directories" FORCE)
-+  SET(VMCS_INSTALL_PREFIX "/usr" CACHE PATH "Prefix prepended to install directories" FORCE)
- endif()
- 
- SET(CMAKE_INSTALL_PREFIX "${VMCS_INSTALL_PREFIX}" CACHE INTERNAL "Prefix
---- interface/vmcs_host/vcilcs_out.c.old	2015-02-24 06:57:20.977771332 +0100
-+++ interface/vmcs_host/vcilcs_out.c	2015-02-24 06:59:34.735428061 +0100
-@@ -37,6 +37,7 @@
- #include "interface/vmcs_host/vc_ilcs_defs.h"
- #include "interface/vmcs_host/vcilcs.h"
- #include "interface/vmcs_host/vcilcs_common.h"
-+#include "interface/vcos/vcos_dlfcn.h"
- 
- static VC_PRIVATE_PORT_T *find_port(VC_PRIVATE_COMPONENT_T *comp, OMX_U32 nPortIndex)
- {
---- interface/khronos/common/linux/khrn_client_rpc_linux.c.old	2015-02-24 06:56:24.458761962 +0100
-+++ interface/khronos/common/linux/khrn_client_rpc_linux.c	2015-02-24 07:02:41.522158412 +0100
-@@ -503,7 +503,8 @@
- void rpc_call8_makecurrent(CLIENT_THREAD_STATE_T *thread, uint32_t id, uint32_t p0,
-    uint32_t p1, uint32_t p2, uint32_t p3, uint32_t p4, uint32_t p5, uint32_t p6, uint32_t p7)
- {
--   if (thread->merge_pos == CLIENT_MAKE_CURRENT_SIZE && *((uint32_t *)thread->merge_buffer) == EGLINTMAKECURRENT_ID)
-+   uint32_t data;
-+   if (thread->merge_pos == CLIENT_MAKE_CURRENT_SIZE && (memcpy(&data,thread->merge_buffer,sizeof(data)), data == EGLINTMAKECURRENT_ID))
-    {
-       rpc_begin(thread);
-       vcos_log_trace("rpc_call8_makecurrent collapse onto previous makecurrent");

diff --git a/media-libs/raspberrypi-userland/raspberrypi-userland-9999.ebuild b/media-libs/raspberrypi-userland/raspberrypi-userland-9999.ebuild
index fc4088c..9c5d675 100644
--- a/media-libs/raspberrypi-userland/raspberrypi-userland-9999.ebuild
+++ b/media-libs/raspberrypi-userland/raspberrypi-userland-9999.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2015 Gentoo Foundation
+# Copyright 1999-2016 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 # $Id$
 
@@ -23,6 +23,14 @@ src_prepare() {
 	epatch "${FILESDIR}"/${P}-gentoo.patch
 }
 
+src_configure() {
+	local mycmakeargs=(
+		-DVMCS_INSTALL_PREFIX="/usr"
+	)
+
+	cmake-utils_src_configure
+}
+
 src_install() {
 	cmake-utils_src_install
 


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: media-libs/raspberrypi-userland/files/, media-libs/raspberrypi-userland/
@ 2017-07-19  8:56 Patrice Clement
  0 siblings, 0 replies; 5+ messages in thread
From: Patrice Clement @ 2017-07-19  8:56 UTC (permalink / raw
  To: gentoo-commits

commit:     9d3fc9e26bf37065b6a435e233a105b34a14184a
Author:     Patrice Clement <monsieurp <AT> gentoo <DOT> org>
AuthorDate: Wed Jul 19 08:03:53 2017 +0000
Commit:     Patrice Clement <monsieurp <AT> gentoo <DOT> org>
CommitDate: Wed Jul 19 08:55:16 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9d3fc9e2

media-libs/raspberrypi-userland: remove empty file.

Package-Manager: Portage-2.3.6, Repoman-2.3.1

 media-libs/raspberrypi-userland/files/wayland-wsys.patch               | 0
 .../raspberrypi-userland/raspberrypi-userland-0_pre20160424.ebuild     | 3 +--
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/media-libs/raspberrypi-userland/files/wayland-wsys.patch b/media-libs/raspberrypi-userland/files/wayland-wsys.patch
deleted file mode 100644
index e69de29bb2d..00000000000

diff --git a/media-libs/raspberrypi-userland/raspberrypi-userland-0_pre20160424.ebuild b/media-libs/raspberrypi-userland/raspberrypi-userland-0_pre20160424.ebuild
index e060f168f5d..44af1834f38 100644
--- a/media-libs/raspberrypi-userland/raspberrypi-userland-0_pre20160424.ebuild
+++ b/media-libs/raspberrypi-userland/raspberrypi-userland-0_pre20160424.ebuild
@@ -47,8 +47,7 @@ src_prepare() {
 	sed -i "/DESTINATION \/etc\/init.d/,+2d" interface/vmcs_host/linux/vcfiled/CMakeLists.txt || die
 
 	# wayland egl support
-	epatch "${FILESDIR}"/next-resource-handle.patch \
-		"${FILESDIR}"/wayland-wsys.patch
+	epatch "${FILESDIR}"/next-resource-handle.patch
 }
 
 src_install() {


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: media-libs/raspberrypi-userland/files/, media-libs/raspberrypi-userland/
@ 2020-11-23  4:52 Sam James
  0 siblings, 0 replies; 5+ messages in thread
From: Sam James @ 2020-11-23  4:52 UTC (permalink / raw
  To: gentoo-commits

commit:     d7fbeb6481a6ffda252f343cc3eeee03533fbad5
Author:     Peter Alfredsen <crabbedhaloablution <AT> icloud <DOT> com>
AuthorDate: Fri Nov 13 13:27:58 2020 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Nov 23 04:42:03 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d7fbeb64

media-libs/raspberrypi-userland: Version bump 0_pre20201022

* Add -0_pre20201022, also update -9999 to same standard.
* Patches described in ebuild.
* raspberrypi-userland produces libEGL and libbrcmEGL, libGLESv2 and
libbrcmGLESv2 libraries. Only the libbrcm variants are actually
needed, plus the other variants collide with libglvnd.
Thanks to KalleBlom on IRC for reporting.
* More closely sync with Raspbian which libs we don't install.
The source for this package is a mess. We build all kinds of things that
just aren't installed, and by default install many things that
shouldn't be.
* Many .so files are not built on arm64, but currently we install
the .pc files anyway. Fix by including the .pc files in the ARM64
conditional.

Closes: https://bugs.gentoo.org/754249
Closes: https://bugs.gentoo.org/718366
Closes: https://bugs.gentoo.org/671492
Closes: https://bugs.gentoo.org/620774
Signed-off-by: Peter Alfredsen <crabbedhaloablution <AT> icloud.com>
Package-Manager: Portage-3.0.9, Repoman-3.0.2
Signed-off-by: Sam James <sam <AT> gentoo.org>

 media-libs/raspberrypi-userland/Manifest           |   1 +
 .../files/raspberrypi-userland-include.patch       |  19 ++
 .../files/raspberrypi-userland-libdir.patch        | 316 +++++++++++++++++++++
 .../files/raspberrypi-userland-libfdt-static.patch |  22 ++
 .../files/raspberrypi-userland-pkgconf-arm64.patch |  38 +++
 .../raspberrypi-userland-0_pre20201022.ebuild      |  69 +++++
 .../raspberrypi-userland-9999.ebuild               |  65 +++--
 7 files changed, 511 insertions(+), 19 deletions(-)

diff --git a/media-libs/raspberrypi-userland/Manifest b/media-libs/raspberrypi-userland/Manifest
index 0b6aea310c4..29025c84702 100644
--- a/media-libs/raspberrypi-userland/Manifest
+++ b/media-libs/raspberrypi-userland/Manifest
@@ -1 +1,2 @@
 DIST raspberrypi-userland-0_pre20160424.tar.gz 32933952 BLAKE2B 4a2d40200a6a4d673be277a0958f768342a2777c28b14b4c7fcac1dbc9c59f2ef2485234f11fbd228aea6bbcf4982a3fd1d4825268af60be91665ea6fee6922d SHA512 04a71837b1247ecbbe479b3b09b5705638a9e576dc99a1ab2200727509195a4a2f2a9b184e3c23ce3933a3236b260afc8bd2b75bc218567b386445bdd8208a5b
+DIST raspberrypi-userland-0_pre20201022.tar.gz 32958590 BLAKE2B 01733a24822d80c5bf9aa3e0feefc3e9437390a465d7a4184d0a9c6a68446e91515d3d6d398ff516d9fd1bdcd4a885512d358a4ed1d24d9b94bdc72d81db84d3 SHA512 1813224068b8a8e569c874a8ffb354f1ac86e95b482caaad18b9703a187baaea60f1f87dfbb0c7e4b3cb2eb875abbcc82aedba410646a3c1df0208bd73aaf9f9

diff --git a/media-libs/raspberrypi-userland/files/raspberrypi-userland-include.patch b/media-libs/raspberrypi-userland/files/raspberrypi-userland-include.patch
new file mode 100644
index 00000000000..83556be3ae4
--- /dev/null
+++ b/media-libs/raspberrypi-userland/files/raspberrypi-userland-include.patch
@@ -0,0 +1,19 @@
+diff -NrU5 1/makefiles/cmake/vmcs.cmake 2/makefiles/cmake/vmcs.cmake
+--- 1/makefiles/cmake/vmcs.cmake	2020-11-06 14:21:49.103179336 +0100
++++ 2/makefiles/cmake/vmcs.cmake	2020-11-06 17:00:57.410230948 +0100
+@@ -72,10 +72,14 @@
+ install(DIRECTORY ${vmcs_root}/interface/vctypes   DESTINATION ${VMCS_INSTALL_PREFIX}/include/interface FILES_MATCHING PATTERN "*.h")
+ install(DIRECTORY ${vmcs_root}/vcinclude           DESTINATION ${VMCS_INSTALL_PREFIX}/include           FILES_MATCHING PATTERN "*.h")
+ install(DIRECTORY ${vmcs_root}/interface/peer      DESTINATION ${VMCS_INSTALL_PREFIX}/include/interface FILES_MATCHING PATTERN "*.h")
+ install(DIRECTORY ${vmcs_root}/interface/vmcs_host DESTINATION ${VMCS_INSTALL_PREFIX}/include/interface FILES_MATCHING PATTERN "*.h" PATTERN "${vmcs_root}/interface/vmcs_host/khronos" EXCLUDE)
+ 
+-install(DIRECTORY ${vmcs_root}/interface/khronos/include       DESTINATION ${VMCS_INSTALL_PREFIX}     FILES_MATCHING PATTERN "*.h")
++install(DIRECTORY ${vmcs_root}/interface/khronos/include       DESTINATION ${VMCS_INSTALL_PREFIX}     FILES_MATCHING PATTERN "*.h"
++	PATTERN EGL EXCLUDE
++	PATTERN GLES EXCLUDE
++	PATTERN GLES2 EXCLUDE
++	PATTERN KHR EXCLUDE )
+ install(DIRECTORY ${vmcs_root}/interface/vmcs_host/khronos/IL  DESTINATION ${VMCS_INSTALL_PREFIX}/include     FILES_MATCHING PATTERN "*.h")
+ 
+ install(DIRECTORY ${vmcs_root}/host_applications/linux/libs/bcm_host/include     DESTINATION ${VMCS_INSTALL_PREFIX}       FILES_MATCHING PATTERN "*.h")
+ 

diff --git a/media-libs/raspberrypi-userland/files/raspberrypi-userland-libdir.patch b/media-libs/raspberrypi-userland/files/raspberrypi-userland-libdir.patch
new file mode 100644
index 00000000000..b1367a98232
--- /dev/null
+++ b/media-libs/raspberrypi-userland/files/raspberrypi-userland-libdir.patch
@@ -0,0 +1,316 @@
+From 9f2ba8c56e473fa05a5f216260571f4269fc16cc Mon Sep 17 00:00:00 2001
+From: Damian Wrobel <dwrobel@ertelnet.rybnik.pl>
+Date: Mon, 14 Sep 2020 09:23:07 +0200
+Subject: [PATCH] Install libraries as per GNU Coding Standards
+
+Includes GNUInstallDirs and uses LIBDIR (instead of hardcoded lib)
+to install libraries.
+
+Fixes packaging on aarch64 systems where LIBDIR=lib64 (not lib).
+
+Signed-off-by: Damian Wrobel <dwrobel@ertelnet.rybnik.pl>
+---
+ CMakeLists.txt                                        | 4 +++-
+ containers/CMakeLists.txt                             | 2 +-
+ helpers/dtoverlay/CMakeLists.txt                      | 2 +-
+ host_applications/linux/libs/bcm_host/CMakeLists.txt  | 2 +-
+ host_applications/linux/libs/debug_sym/CMakeLists.txt | 4 ++--
+ host_applications/linux/libs/sm/CMakeLists.txt        | 2 +-
+ interface/khronos/CMakeLists.txt                      | 6 +++---
+ interface/mmal/CMakeLists.txt                         | 2 +-
+ interface/mmal/components/CMakeLists.txt              | 2 +-
+ interface/mmal/core/CMakeLists.txt                    | 2 +-
+ interface/mmal/util/CMakeLists.txt                    | 2 +-
+ interface/mmal/vc/CMakeLists.txt                      | 2 +-
+ interface/vchiq_arm/CMakeLists.txt                    | 2 +-
+ interface/vcos/pthreads/CMakeLists.txt                | 2 +-
+ interface/vmcs_host/CMakeLists.txt                    | 2 +-
+ middleware/openmaxil/CMakeLists.txt                   | 2 +-
+ pkgconfig/bcm_host.pc.in                              | 2 +-
+ pkgconfig/brcmegl.pc.in                               | 2 +-
+ pkgconfig/brcmglesv2.pc.in                            | 2 +-
+ pkgconfig/brcmvg.pc.in                                | 2 +-
+ pkgconfig/mmal.pc.in                                  | 2 +-
+ pkgconfig/vcsm.pc.in                                  | 2 +-
+ 22 files changed, 27 insertions(+), 25 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index fe67fc87..035b16fa 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -8,6 +8,8 @@ SET(PROJECT_VER_PATCH 0)
+ SET(PROJECT_VER "${PROJECT_VER_MAJOR}.${PROJECT_VER_MINOR}.${PROJECT_VER_PATCH}")
+ SET(PROJECT_APIVER "${PROJECT_VER}")
+ 
++include(GNUInstallDirs)
++
+ if(ARM64)
+    set(BUILD_MMAL FALSE)
+    set(BUILD_MMAL_APPS FALSE)
+@@ -125,7 +127,7 @@ if(PKG_CONFIG_FOUND)
+ 	foreach(PCFILE bcm_host.pc brcmegl.pc brcmglesv2.pc brcmvg.pc vcsm.pc mmal.pc)
+ 		configure_file("pkgconfig/${PCFILE}.in" "${PCFILE}" @ONLY)
+ 		install(FILES       "${CMAKE_CURRENT_BINARY_DIR}/${PCFILE}"
+-			DESTINATION "${CMAKE_INSTALL_PREFIX}/lib/pkgconfig")
++			DESTINATION "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/pkgconfig")
+ 	endforeach()
+ endif()
+ # Remove cache entry, if one added by command line
+diff --git a/containers/CMakeLists.txt b/containers/CMakeLists.txt
+index 5570038c..3578fe80 100644
+--- a/containers/CMakeLists.txt
++++ b/containers/CMakeLists.txt
+@@ -66,7 +66,7 @@ set(packetizers_SRCS ${packetizers_SRCS} ${SOURCE_DIR}/h264/avc1_packetizer.c)
+ 
+ add_library(containers ${LIBRARY_TYPE} ${core_SRCS} ${io_SRCS} ${net_SRCS} ${packetizers_SRCS})
+ target_link_libraries(containers vcos)
+-install(TARGETS containers DESTINATION lib)
++install(TARGETS containers DESTINATION ${LIBDIR})
+ 
+ set(container_readers)
+ set(container_writers)
+diff --git a/helpers/dtoverlay/CMakeLists.txt b/helpers/dtoverlay/CMakeLists.txt
+index b3bd30f1..5e1a3a4a 100644
+--- a/helpers/dtoverlay/CMakeLists.txt
++++ b/helpers/dtoverlay/CMakeLists.txt
+@@ -22,4 +22,4 @@ add_library (dtovl ${SHARED}
+ 
+ target_link_libraries(dtovl fdt)
+ 
+-install (TARGETS dtovl DESTINATION lib)
++install (TARGETS dtovl DESTINATION ${LIBDIR})
+diff --git a/host_applications/linux/libs/bcm_host/CMakeLists.txt b/host_applications/linux/libs/bcm_host/CMakeLists.txt
+index 2f4beb93..e18d611c 100644
+--- a/host_applications/linux/libs/bcm_host/CMakeLists.txt
++++ b/host_applications/linux/libs/bcm_host/CMakeLists.txt
+@@ -19,5 +19,5 @@ add_library(bcm_host ${SHARED} bcm_host.c)
+ 
+ target_link_libraries(bcm_host vcos vchostif)
+ 
+-install(TARGETS bcm_host DESTINATION lib)
++install(TARGETS bcm_host DESTINATION ${LIBDIR})
+ 
+diff --git a/host_applications/linux/libs/debug_sym/CMakeLists.txt b/host_applications/linux/libs/debug_sym/CMakeLists.txt
+index d437b995..40e0bc77 100644
+--- a/host_applications/linux/libs/debug_sym/CMakeLists.txt
++++ b/host_applications/linux/libs/debug_sym/CMakeLists.txt
+@@ -11,6 +11,6 @@ include_directories (
+ add_library(debug_sym ${SHARED} debug_sym.c)
+ add_library(debug_sym_static STATIC debug_sym.c)
+ 
+-install(TARGETS debug_sym DESTINATION lib)
+-install(TARGETS debug_sym_static DESTINATION lib)
++install(TARGETS debug_sym DESTINATION ${LIBDIR})
++install(TARGETS debug_sym_static DESTINATION ${LIBDIR})
+ install(FILES debug_sym.h DESTINATION include/interface/debug_sym)
+diff --git a/host_applications/linux/libs/sm/CMakeLists.txt b/host_applications/linux/libs/sm/CMakeLists.txt
+index 5ce5aca7..f85959bd 100644
+--- a/host_applications/linux/libs/sm/CMakeLists.txt
++++ b/host_applications/linux/libs/sm/CMakeLists.txt
+@@ -14,5 +14,5 @@ add_library(vcsm ${SHARED} user-vcsm.c)
+ 
+ target_link_libraries(vcsm vcos)
+ 
+-install(TARGETS vcsm DESTINATION lib)
++install(TARGETS vcsm DESTINATION ${LIBDIR})
+ install(FILES user-vcsm.h DESTINATION include/interface/vcsm)
+diff --git a/interface/khronos/CMakeLists.txt b/interface/khronos/CMakeLists.txt
+index 9ad615b8..97683049 100644
+--- a/interface/khronos/CMakeLists.txt
++++ b/interface/khronos/CMakeLists.txt
+@@ -78,8 +78,8 @@ target_link_libraries(GLESv2 EGL khrn_client vcos)
+ target_link_libraries(WFC EGL)
+ target_link_libraries(OpenVG EGL)
+ 
+-install(TARGETS EGL GLESv2 OpenVG WFC khrn_client DESTINATION lib)
+-install(TARGETS EGL_static GLESv2_static khrn_static DESTINATION lib)
++install(TARGETS EGL GLESv2 OpenVG WFC khrn_client DESTINATION ${LIBDIR})
++install(TARGETS EGL_static GLESv2_static khrn_static DESTINATION ${LIBDIR})
+ 
+ # recommended names to use to avoid conflicts with mesa libs
+ add_library(brcmEGL ${SHARED} ${EGL_SOURCE})
+@@ -92,4 +92,4 @@ target_link_libraries(brcmGLESv2 brcmEGL khrn_client vcos)
+ target_link_libraries(brcmWFC brcmEGL)
+ target_link_libraries(brcmOpenVG brcmEGL)
+ 
+-install(TARGETS brcmEGL brcmGLESv2 brcmOpenVG brcmWFC DESTINATION lib)
++install(TARGETS brcmEGL brcmGLESv2 brcmOpenVG brcmWFC DESTINATION ${LIBDIR})
+diff --git a/interface/mmal/CMakeLists.txt b/interface/mmal/CMakeLists.txt
+index 46f149df..544f173b 100644
+--- a/interface/mmal/CMakeLists.txt
++++ b/interface/mmal/CMakeLists.txt
+@@ -16,7 +16,7 @@ add_subdirectory(client)
+ 
+ target_link_libraries(mmal mmal_core mmal_util mmal_vc_client vcos mmal_components)
+ 
+-install(TARGETS mmal DESTINATION lib)
++install(TARGETS mmal DESTINATION ${LIBDIR})
+ install(FILES
+    mmal.h
+    mmal_buffer.h
+diff --git a/interface/mmal/components/CMakeLists.txt b/interface/mmal/components/CMakeLists.txt
+index d65fa37d..5b929098 100644
+--- a/interface/mmal/components/CMakeLists.txt
++++ b/interface/mmal/components/CMakeLists.txt
+@@ -30,5 +30,5 @@ set(container_libs ${container_libs} containers)
+ target_link_libraries(mmal_components ${container_libs} mmal_util)
+ target_link_libraries(mmal_components mmal_core)
+ 
+-install(TARGETS mmal_components DESTINATION lib)
++install(TARGETS mmal_components DESTINATION ${LIBDIR})
+ 
+diff --git a/interface/mmal/core/CMakeLists.txt b/interface/mmal/core/CMakeLists.txt
+index de0bcb25..7f1adb86 100644
+--- a/interface/mmal/core/CMakeLists.txt
++++ b/interface/mmal/core/CMakeLists.txt
+@@ -13,7 +13,7 @@ add_library (mmal_core ${LIBRARY_TYPE}
+ 
+ target_link_libraries (mmal_core vcos)
+ 
+-install(TARGETS mmal_core DESTINATION lib)
++install(TARGETS mmal_core DESTINATION ${LIBDIR})
+ install(FILES
+    mmal_buffer_private.h
+    mmal_clock_private.h
+diff --git a/interface/mmal/util/CMakeLists.txt b/interface/mmal/util/CMakeLists.txt
+index b2a6858b..acabed6f 100644
+--- a/interface/mmal/util/CMakeLists.txt
++++ b/interface/mmal/util/CMakeLists.txt
+@@ -12,7 +12,7 @@ add_library (mmal_util ${LIBRARY_TYPE}
+ 
+ target_link_libraries (mmal_util vcos)
+ 
+-install(TARGETS mmal_util DESTINATION lib)
++install(TARGETS mmal_util DESTINATION ${LIBDIR})
+ install(FILES
+    mmal_component_wrapper.h
+    mmal_connection.h
+diff --git a/interface/mmal/vc/CMakeLists.txt b/interface/mmal/vc/CMakeLists.txt
+index d6e80db7..ecba8112 100644
+--- a/interface/mmal/vc/CMakeLists.txt
++++ b/interface/mmal/vc/CMakeLists.txt
+@@ -13,7 +13,7 @@ endif(BUILD_MMAL_APPS)
+ 
+ include_directories ( ../../../host_applications/linux/libs/sm )
+ 
+-install(TARGETS mmal_vc_client DESTINATION lib)
++install(TARGETS mmal_vc_client DESTINATION ${LIBDIR})
+ install(FILES
+    mmal_vc_api.h
+    mmal_vc_api_drm.h
+diff --git a/interface/vchiq_arm/CMakeLists.txt b/interface/vchiq_arm/CMakeLists.txt
+index 7af383de..75080655 100644
+--- a/interface/vchiq_arm/CMakeLists.txt
++++ b/interface/vchiq_arm/CMakeLists.txt
+@@ -5,7 +5,7 @@ add_library(vchiq_arm SHARED
+ # pull in VCHI cond variable emulation
+ target_link_libraries(vchiq_arm vcos)
+ 
+-install(TARGETS vchiq_arm DESTINATION lib)
++install(TARGETS vchiq_arm DESTINATION ${LIBDIR})
+ #install(FILES etc/10-vchiq.rules DESTINATION /etc/udev/rules.d)
+ 
+ include_directories(../..)
+diff --git a/interface/vcos/pthreads/CMakeLists.txt b/interface/vcos/pthreads/CMakeLists.txt
+index 1d81ca3c..c6a80cf3 100644
+--- a/interface/vcos/pthreads/CMakeLists.txt
++++ b/interface/vcos/pthreads/CMakeLists.txt
+@@ -43,4 +43,4 @@ endif ()
+ 
+ 
+ #install(FILES ${HEADERS} DESTINATION include)
+-install(TARGETS vcos DESTINATION lib)
++install(TARGETS vcos DESTINATION ${LIBDIR})
+diff --git a/interface/vmcs_host/CMakeLists.txt b/interface/vmcs_host/CMakeLists.txt
+index cbef80c5..f61067f0 100755
+--- a/interface/vmcs_host/CMakeLists.txt
++++ b/interface/vmcs_host/CMakeLists.txt
+@@ -32,5 +32,5 @@ target_link_libraries(vchostif vchiq_arm vcos)
+ 
+ #target_link_libraries(bufman WFC)
+ 
+-install(TARGETS ${INSTALL_TARGETS} DESTINATION lib)
++install(TARGETS ${INSTALL_TARGETS} DESTINATION ${LIBDIR})
+ 
+diff --git a/middleware/openmaxil/CMakeLists.txt b/middleware/openmaxil/CMakeLists.txt
+index 3e9c5f9d..6b6c36a6 100644
+--- a/middleware/openmaxil/CMakeLists.txt
++++ b/middleware/openmaxil/CMakeLists.txt
+@@ -49,4 +49,4 @@ else ()
+ 
+ endif ()
+ 
+-install (TARGETS openmaxil DESTINATION lib)
++install (TARGETS openmaxil DESTINATION ${LIBDIR})
+diff --git a/pkgconfig/bcm_host.pc.in b/pkgconfig/bcm_host.pc.in
+index c7237c53..2988b42f 100644
+--- a/pkgconfig/bcm_host.pc.in
++++ b/pkgconfig/bcm_host.pc.in
+@@ -1,6 +1,6 @@
+ prefix=@CMAKE_INSTALL_PREFIX@
+ exec_prefix=${prefix}
+-libdir=${exec_prefix}/lib
++libdir=${exec_prefix}/@CMAKE_INSTALL_LIBDIR@
+ includedir=${prefix}/include
+ 
+ Name: bcm_host
+diff --git a/pkgconfig/brcmegl.pc.in b/pkgconfig/brcmegl.pc.in
+index 5dd3d5b9..a45bf22a 100644
+--- a/pkgconfig/brcmegl.pc.in
++++ b/pkgconfig/brcmegl.pc.in
+@@ -1,6 +1,6 @@
+ prefix=@CMAKE_INSTALL_PREFIX@
+ exec_prefix=${prefix}
+-libdir=${exec_prefix}/lib
++libdir=${exec_prefix}/@CMAKE_INSTALL_LIBDIR@
+ includedir=${prefix}/include
+ 
+ Name: brcmEGL
+diff --git a/pkgconfig/brcmglesv2.pc.in b/pkgconfig/brcmglesv2.pc.in
+index e0e36f5a..902fbf33 100644
+--- a/pkgconfig/brcmglesv2.pc.in
++++ b/pkgconfig/brcmglesv2.pc.in
+@@ -1,6 +1,6 @@
+ prefix=@CMAKE_INSTALL_PREFIX@
+ exec_prefix=${prefix}
+-libdir=${exec_prefix}/lib
++libdir=${exec_prefix}/@CMAKE_INSTALL_LIBDIR@
+ includedir=${prefix}/include
+ 
+ Name: brcmGLESv2
+diff --git a/pkgconfig/brcmvg.pc.in b/pkgconfig/brcmvg.pc.in
+index 763a44b0..98489ee4 100644
+--- a/pkgconfig/brcmvg.pc.in
++++ b/pkgconfig/brcmvg.pc.in
+@@ -1,6 +1,6 @@
+ prefix=@CMAKE_INSTALL_PREFIX@
+ exec_prefix=${prefix}
+-libdir=${exec_prefix}/lib
++libdir=${exec_prefix}/@CMAKE_INSTALL_LIBDIR@
+ includedir=${prefix}/include
+ 
+ Name: brcmOpenVG
+diff --git a/pkgconfig/mmal.pc.in b/pkgconfig/mmal.pc.in
+index 37d344c4..1ffa4f51 100644
+--- a/pkgconfig/mmal.pc.in
++++ b/pkgconfig/mmal.pc.in
+@@ -1,6 +1,6 @@
+ prefix=@CMAKE_INSTALL_PREFIX@
+ exec_prefix=${prefix}
+-libdir=${exec_prefix}/lib
++libdir=${exec_prefix}/@CMAKE_INSTALL_LIBDIR@
+ includedir=${prefix}/include
+ 
+ Name: MMAL
+diff --git a/pkgconfig/vcsm.pc.in b/pkgconfig/vcsm.pc.in
+index b12c56fc..6f762cbf 100644
+--- a/pkgconfig/vcsm.pc.in
++++ b/pkgconfig/vcsm.pc.in
+@@ -1,6 +1,6 @@
+ prefix=@CMAKE_INSTALL_PREFIX@
+ exec_prefix=${prefix}
+-libdir=${exec_prefix}/lib
++libdir=${exec_prefix}/@CMAKE_INSTALL_LIBDIR@
+ includedir=${prefix}/include
+ 
+ Name: VCSM

diff --git a/media-libs/raspberrypi-userland/files/raspberrypi-userland-libfdt-static.patch b/media-libs/raspberrypi-userland/files/raspberrypi-userland-libfdt-static.patch
new file mode 100644
index 00000000000..7ba0cd0852d
--- /dev/null
+++ b/media-libs/raspberrypi-userland/files/raspberrypi-userland-libfdt-static.patch
@@ -0,0 +1,22 @@
+From 55999626af756874012f0163718152a77b14ff51 Mon Sep 17 00:00:00 2001
+From: crabbed halo ablution
+ <17379795+crabbedhaloablution@users.noreply.github.com>
+Date: Sun, 8 Nov 2020 13:49:09 +0100
+Subject: [PATCH] Make explicit that libfdt should be built static
+
+---
+ opensrc/helpers/libfdt/CMakeLists.txt | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/opensrc/helpers/libfdt/CMakeLists.txt b/opensrc/helpers/libfdt/CMakeLists.txt
+index f57c61cb..fad86d32 100755
+--- a/opensrc/helpers/libfdt/CMakeLists.txt
++++ b/opensrc/helpers/libfdt/CMakeLists.txt
+@@ -1,6 +1,6 @@
+ include_directories(.)
+ 
+-add_library(fdt
++add_library(fdt STATIC
+             fdt.c 
+             fdt_empty_tree.c
+             fdt_ro.c

diff --git a/media-libs/raspberrypi-userland/files/raspberrypi-userland-pkgconf-arm64.patch b/media-libs/raspberrypi-userland/files/raspberrypi-userland-pkgconf-arm64.patch
new file mode 100644
index 00000000000..48ccea1f681
--- /dev/null
+++ b/media-libs/raspberrypi-userland/files/raspberrypi-userland-pkgconf-arm64.patch
@@ -0,0 +1,38 @@
+From 6d666d333f2022004fa453b28faad91021cd13d3 Mon Sep 17 00:00:00 2001
+From: crabbedhaloablution
+ <17379795+crabbedhaloablution@users.noreply.github.com>
+Date: Mon, 16 Nov 2020 13:41:12 +0100
+Subject: [PATCH] Only install .pc files for which we build a .so.
+
+Many .so files are not built on arm64, but currently we install
+the .pc files anyway. Fix by including the .pc files in the ARM64
+conditional.
+---
+ CMakeLists.txt | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index fe67fc87..8393a8bd 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -11,9 +11,11 @@ SET(PROJECT_APIVER "${PROJECT_VER}")
+ if(ARM64)
+    set(BUILD_MMAL FALSE)
+    set(BUILD_MMAL_APPS FALSE)
++   set(PKGCONFFILES bcm_host.pc)
+ else()
+    set(BUILD_MMAL TRUE)
+    set(BUILD_MMAL_APPS TRUE)
++   set(PKGCONFFILES bcm_host.pc brcmegl.pc brcmglesv2.pc brcmvg.pc vcsm.pc mmal.pc)
+ endif()
+ set(vmcs_root ${PROJECT_SOURCE_DIR})
+ get_filename_component(VIDEOCORE_ROOT . ABSOLUTE)
+@@ -122,7 +124,7 @@ include_directories("${PROJECT_BINARY_DIR}")
+ include(FindPkgConfig QUIET)
+ if(PKG_CONFIG_FOUND)
+ 	# Produce a pkg-config file
+-	foreach(PCFILE bcm_host.pc brcmegl.pc brcmglesv2.pc brcmvg.pc vcsm.pc mmal.pc)
++	foreach(PCFILE IN LISTS PKGCONFFILES)
+ 		configure_file("pkgconfig/${PCFILE}.in" "${PCFILE}" @ONLY)
+ 		install(FILES       "${CMAKE_CURRENT_BINARY_DIR}/${PCFILE}"
+ 			DESTINATION "${CMAKE_INSTALL_PREFIX}/lib/pkgconfig")

diff --git a/media-libs/raspberrypi-userland/raspberrypi-userland-0_pre20201022.ebuild b/media-libs/raspberrypi-userland/raspberrypi-userland-0_pre20201022.ebuild
new file mode 100644
index 00000000000..9242ae883fc
--- /dev/null
+++ b/media-libs/raspberrypi-userland/raspberrypi-userland-0_pre20201022.ebuild
@@ -0,0 +1,69 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+inherit cmake flag-o-matic udev
+
+if [[ ${PV} == 9999* ]]; then
+	inherit git-r3
+	EGIT_REPO_URI="https://github.com/${PN/-//}.git"
+	SRC_URI=""
+else
+	#We base our versioning off Raspbian's
+	#Go to https://archive.raspberrypi.org/debian/pool/main/r/raspberrypi-userland/
+	#Example:
+	#libraspberrypi-bin-dbgsym_2+git20201022~151804+e432bc3-1_arm64.deb
+	#"e432bc3" is the first 7 hex digits of the commit hash.
+	#Now go to https://github.com/raspberrypi/userland/commits/master and find the
+	#full hash
+	GIT_COMMIT="e432bc3400401064e2d8affa5d1454aac2cf4a00"
+	SRC_URI="https://github.com/raspberrypi/userland/archive/${GIT_COMMIT}.tar.gz -> ${P}.tar.gz"
+	KEYWORDS="~arm ~arm64"
+	S="${WORKDIR}/userland-${GIT_COMMIT}"
+fi
+
+DESCRIPTION="Raspberry Pi userspace tools and libraries"
+HOMEPAGE="https://github.com/raspberrypi/userland"
+
+LICENSE="BSD"
+SLOT="0"
+IUSE=""
+
+DEPEND=""
+RDEPEND="acct-group/video
+	!media-libs/raspberrypi-userland-bin"
+
+#Install in $(get_libdir)
+#See https://github.com/raspberrypi/userland/pull/650
+PATCHES=( "${FILESDIR}/${PN}-libdir.patch" )
+#Don't install includes that collide.
+PATCHES+=( "${FILESDIR}/${PN}-include.patch" )
+#See https://github.com/raspberrypi/userland/pull/655
+PATCHES+=( "${FILESDIR}/${PN}-libfdt-static.patch" )
+#See https://github.com/raspberrypi/userland/pull/659
+PATCHES+=( "${FILESDIR}/${PN}-pkgconf-arm64.patch" )
+
+pkg_setup() {
+	append-ldflags $(no-as-needed)
+
+	mycmakeargs=(
+		-DVMCS_INSTALL_PREFIX="/usr"
+		-DARM64=$(usex arm64 ON OFF)
+	)
+}
+
+src_prepare() {
+	cmake_src_prepare
+	sed -i \
+		-e 's:DESTINATION ${VMCS_INSTALL_PREFIX}/src:DESTINATION ${VMCS_INSTALL_PREFIX}/'"share/doc/${PF}:" \
+		"${S}/makefiles/cmake/vmcs.cmake" || die "Failed sedding makefiles/cmake/vmcs.cmake"
+	sed -i \
+		-e 's:^install(TARGETS EGL GLESv2 OpenVG WFC:install(TARGETS:' \
+		-e '/^install(TARGETS EGL_static GLESv2_static/d' \
+		"${S}/interface/khronos/CMakeLists.txt" || die "Failed sedding interface/khronos/CMakeLists.txt"
+}
+
+src_install() {
+	cmake_src_install
+	udev_dorules "${FILESDIR}/92-local-vchiq-permissions.rules"
+}

diff --git a/media-libs/raspberrypi-userland/raspberrypi-userland-9999.ebuild b/media-libs/raspberrypi-userland/raspberrypi-userland-9999.ebuild
index 6906bbc7039..9242ae883fc 100644
--- a/media-libs/raspberrypi-userland/raspberrypi-userland-9999.ebuild
+++ b/media-libs/raspberrypi-userland/raspberrypi-userland-9999.ebuild
@@ -1,42 +1,69 @@
-# Copyright 1999-2017 Gentoo Foundation
+# Copyright 1999-2020 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI=5
-inherit cmake-utils flag-o-matic git-r3
+EAPI=7
+inherit cmake flag-o-matic udev
+
+if [[ ${PV} == 9999* ]]; then
+	inherit git-r3
+	EGIT_REPO_URI="https://github.com/${PN/-//}.git"
+	SRC_URI=""
+else
+	#We base our versioning off Raspbian's
+	#Go to https://archive.raspberrypi.org/debian/pool/main/r/raspberrypi-userland/
+	#Example:
+	#libraspberrypi-bin-dbgsym_2+git20201022~151804+e432bc3-1_arm64.deb
+	#"e432bc3" is the first 7 hex digits of the commit hash.
+	#Now go to https://github.com/raspberrypi/userland/commits/master and find the
+	#full hash
+	GIT_COMMIT="e432bc3400401064e2d8affa5d1454aac2cf4a00"
+	SRC_URI="https://github.com/raspberrypi/userland/archive/${GIT_COMMIT}.tar.gz -> ${P}.tar.gz"
+	KEYWORDS="~arm ~arm64"
+	S="${WORKDIR}/userland-${GIT_COMMIT}"
+fi
 
 DESCRIPTION="Raspberry Pi userspace tools and libraries"
 HOMEPAGE="https://github.com/raspberrypi/userland"
-SRC_URI=""
 
 LICENSE="BSD"
 SLOT="0"
-KEYWORDS=""
 IUSE=""
 
 DEPEND=""
-RDEPEND=""
+RDEPEND="acct-group/video
+	!media-libs/raspberrypi-userland-bin"
 
-EGIT_REPO_URI="https://github.com/raspberrypi/userland"
+#Install in $(get_libdir)
+#See https://github.com/raspberrypi/userland/pull/650
+PATCHES=( "${FILESDIR}/${PN}-libdir.patch" )
+#Don't install includes that collide.
+PATCHES+=( "${FILESDIR}/${PN}-include.patch" )
+#See https://github.com/raspberrypi/userland/pull/655
+PATCHES+=( "${FILESDIR}/${PN}-libfdt-static.patch" )
+#See https://github.com/raspberrypi/userland/pull/659
+PATCHES+=( "${FILESDIR}/${PN}-pkgconf-arm64.patch" )
 
 pkg_setup() {
 	append-ldflags $(no-as-needed)
-}
 
-src_configure() {
-	local mycmakeargs=(
+	mycmakeargs=(
 		-DVMCS_INSTALL_PREFIX="/usr"
+		-DARM64=$(usex arm64 ON OFF)
 	)
+}
 
-	cmake-utils_src_configure
+src_prepare() {
+	cmake_src_prepare
+	sed -i \
+		-e 's:DESTINATION ${VMCS_INSTALL_PREFIX}/src:DESTINATION ${VMCS_INSTALL_PREFIX}/'"share/doc/${PF}:" \
+		"${S}/makefiles/cmake/vmcs.cmake" || die "Failed sedding makefiles/cmake/vmcs.cmake"
+	sed -i \
+		-e 's:^install(TARGETS EGL GLESv2 OpenVG WFC:install(TARGETS:' \
+		-e '/^install(TARGETS EGL_static GLESv2_static/d' \
+		"${S}/interface/khronos/CMakeLists.txt" || die "Failed sedding interface/khronos/CMakeLists.txt"
 }
 
 src_install() {
-	cmake-utils_src_install
-
-	insinto /lib/udev/rules.d
-	doins "${FILESDIR}"/92-local-vchiq-permissions.rules
-
-	dodir /usr/share/doc/${PF}
-	mv "${D}"/usr/src/hello_pi "${D}"/usr/share/doc/${PF}/
-	rmdir "${D}"/usr/src
+	cmake_src_install
+	udev_dorules "${FILESDIR}/92-local-vchiq-permissions.rules"
 }


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-11-23  4:52 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-10 14:04 [gentoo-commits] repo/gentoo:master commit in: media-libs/raspberrypi-userland/files/, media-libs/raspberrypi-userland/ Miroslav Šulc
  -- strict thread matches above, loose matches on Subject: below --
2020-11-23  4:52 Sam James
2017-07-19  8:56 Patrice Clement
2016-05-11 12:27 Alfredo Tupone
2016-03-08 23:20 Miroslav Šulc

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox