summaryrefslogtreecommitdiff
path: root/dev-libs/weston
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2021-05-22 07:31:18 +0100
committerV3n3RiX <venerix@redcorelinux.org>2021-05-22 07:31:18 +0100
commit908778078736bd36f7a60a2d576d415cb8e000fa (patch)
treec6a4796c48b608c14dc7e9674cdbd38f905e3c15 /dev-libs/weston
parent185fa19bbf68a4d4dca534d2b46729207a177f16 (diff)
gentoo resync : 22.05.2021
Diffstat (limited to 'dev-libs/weston')
-rw-r--r--dev-libs/weston/Manifest3
-rw-r--r--dev-libs/weston/files/weston-pipewire-0.3.patch373
-rw-r--r--dev-libs/weston/weston-9.0.0.ebuild6
3 files changed, 380 insertions, 2 deletions
diff --git a/dev-libs/weston/Manifest b/dev-libs/weston/Manifest
index 1d326cfd47db..3bd9e430be34 100644
--- a/dev-libs/weston/Manifest
+++ b/dev-libs/weston/Manifest
@@ -1,5 +1,6 @@
AUX README.gentoo 383 BLAKE2B a0d8fef2d1f0deebe46ed85065a09057a620aa7af4e7aa901f1fef7b75d15e2ca9d2be1b9367a651a2edf3b4265441ce47af832f423cf9725c78e61836a4f982 SHA512 e4d8f8e0edeb6773dd7ef6329074d1e40b694b9e7e10b6a429d8c5dd4fe1170594f447a42eb41446ec2355829a1da1606bf6c544434551c5c931b0794422e786
+AUX weston-pipewire-0.3.patch 11856 BLAKE2B aebe0f4859a0ac3144d8f631fd8b5e35c02f62217ad94106c138aa6095430a2aff7aedf88d67f95991d32e9c728b6704746fedc9858e41e5d99900722b6617ec SHA512 f3e028df4967672c58e1cac66fc8b7781252f15094439dca399d820d945156a15f1e420a8ed062584dcdd7c9577849127aa52974639877796ce91231123bf50d
DIST weston-9.0.0.tar.xz 1555212 BLAKE2B 6c5feb3959ebe894861c6dc0817633b23e8518baf1c359c2967f111c071e9d4f166ef1421ad6465b036b3f1c485cab5f442476e7a44e3ec722cff576dea73852 SHA512 ccc263f8279b7b23e5c593b4a8a023de2c3dc178b1b8d6593599171770bcfe97608de9fcb77aa1cab39255451d289d323e51c317dae190c7641282e085b84f90
-EBUILD weston-9.0.0.ebuild 3696 BLAKE2B e2347bde9ba185d5e11bf712db5f9383ede9e97dfb4b3a35c8d7ffc4cc419ac8d28b34032a3c78cabc324a41258a75b4968faae74d8304cb85b156ff837b221c SHA512 de29d0a2fc75111d9a49aade4991a37705c5dcf2288bafef696efc2a8af60cc07748bff24a8786ffa2c3c3f6de9ce2d8a60ec2df2a427ba35577c138eb618b26
+EBUILD weston-9.0.0.ebuild 3756 BLAKE2B 1b543d591c30fa7e3929b5873090e8e0e337f41d5f8c21c01499ce5cc293a4b875f08e3cd19f08d9b2d216e03992ec80e7659591c9a95288e2b35492c738822d SHA512 498658504d1c64ef95db55e8b876f3afb5c8ff542a573b6f40918afd7562f15c544bca66e49e02146224be1dab7660211656d3da5bf6b62033c6b38e26e2124f
EBUILD weston-9999.ebuild 3692 BLAKE2B 7932952bee15707f295c7c489c34fd0c2f5d665ba91c61bba818e9a54f6589bf74267833674f7c3e7b98983524adfe1ab24a612da7328d18b0441e1c27bd229f SHA512 4eed0f6064e23485be67450e21cdb42074d45dbdc3c90cda7968983f7a35e282250fae8eed5aa0aa4d585e3b9bb855f3aae5f5acd9b5ccffb1b685aba4245be4
MISC metadata.xml 1484 BLAKE2B 0cf0554d570059077eedaf579dc65651c715a80520d89633cf1979af25014fd7817d7e4ded1d7bdbbc77346e58d026e6371cfec91f710abfdcdc5d360eec60ef SHA512 63e012a64c88b3c2aca3a5f109d468e3dd5e856b1bd42ad2a803e2881b0962f499f8b201e99e940f04b09a3618e9f3594ea2e8565b204cab4093030913222900
diff --git a/dev-libs/weston/files/weston-pipewire-0.3.patch b/dev-libs/weston/files/weston-pipewire-0.3.patch
new file mode 100644
index 000000000000..a38250d8c8f2
--- /dev/null
+++ b/dev-libs/weston/files/weston-pipewire-0.3.patch
@@ -0,0 +1,373 @@
+https://gitlab.freedesktop.org/wayland/weston/-/merge_requests/456
+
+diff --git a/pipewire/meson.build b/pipewire/meson.build
+index 67db61f0777325695864db2bc6cf94145ed5564d..944b2259f146e07abdbd4773223f4bdb76dfa45a 100644
+--- a/pipewire/meson.build
++++ b/pipewire/meson.build
+@@ -5,17 +5,25 @@ if get_option('pipewire')
+ error('Attempting to build the pipewire plugin without the required DRM backend. ' + user_hint)
+ endif
+
+- depnames = [
+- 'libpipewire-0.2', 'libspa-0.1'
+- ]
+ deps_pipewire = [ dep_libweston_private ]
+- foreach depname : depnames
+- dep = dependency(depname, required: false)
+- if not dep.found()
+- error('Pipewire plugin requires @0@ which was not found. '.format(depname) + user_hint)
+- endif
+- deps_pipewire += dep
+- endforeach
++
++ dep_libpipewire = dependency('libpipewire-0.3', required: false)
++ if not dep_libpipewire.found()
++ dep_libpipewire = dependency('libpipewire-0.2', required: false)
++ endif
++ if not dep_libpipewire.found()
++ error('Pipewire plugin requires libpipewire which was not found. ' + user_hint)
++ endif
++ deps_pipewire += dep_libpipewire
++
++ dep_libspa = dependency('libspa-0.2', required: false)
++ if not dep_libspa.found()
++ dep_libspa = dependency('libspa-0.1', required: false)
++ endif
++ if not dep_libspa.found()
++ error('Pipewire plugin requires libspa which was not found. ' + user_hint)
++ endif
++ deps_pipewire += dep_libspa
+
+ plugin_pipewire = shared_library(
+ 'pipewire-plugin',
+diff --git a/pipewire/pipewire-plugin.c b/pipewire/pipewire-plugin.c
+index fe7eb1d654d5ec67f7a3287532bb21c19ad9eac5..2c65f502c2917c23290a51bf1c24eac8d50129f1 100644
+--- a/pipewire/pipewire-plugin.c
++++ b/pipewire/pipewire-plugin.c
+@@ -34,20 +34,27 @@
+ #include <errno.h>
+ #include <unistd.h>
+
++#include <pipewire/pipewire.h>
++
+ #include <spa/param/format-utils.h>
+ #include <spa/param/video/format-utils.h>
+ #include <spa/utils/defs.h>
+
+-#include <pipewire/pipewire.h>
++#if PW_CHECK_VERSION(0, 2, 90)
++#include <spa/buffer/meta.h>
++#include <spa/utils/result.h>
++#endif
+
+ #define PROP_RANGE(min, max) 2, (min), (max)
+
++#if !PW_CHECK_VERSION(0, 2, 90)
+ struct type {
+ struct spa_type_media_type media_type;
+ struct spa_type_media_subtype media_subtype;
+ struct spa_type_format_video format_video;
+ struct spa_type_video_format video_format;
+ };
++#endif
+
+ struct weston_pipewire {
+ struct weston_compositor *compositor;
+@@ -60,12 +67,19 @@ struct weston_pipewire {
+ struct pw_loop *loop;
+ struct wl_event_source *loop_source;
+
++#if PW_CHECK_VERSION(0, 2, 90)
++ struct pw_context *context;
++#endif
+ struct pw_core *core;
+ struct pw_type *t;
++#if PW_CHECK_VERSION(0, 2, 90)
++ struct spa_hook core_listener;
++#else
+ struct type type;
+
+ struct pw_remote *remote;
+ struct spa_hook remote_listener;
++#endif
+ };
+
+ struct pipewire_output {
+@@ -100,6 +114,7 @@ struct pipewire_frame_data {
+ struct wl_event_source *fence_sync_event_source;
+ };
+
++#if !PW_CHECK_VERSION(0, 2, 90)
+ static inline void init_type(struct type *type, struct spa_type_map *map)
+ {
+ spa_type_media_type_map(map, &type->media_type);
+@@ -107,6 +122,7 @@ static inline void init_type(struct type *type, struct spa_type_map *map)
+ spa_type_format_video_map(map, &type->format_video);
+ spa_type_video_format_map(map, &type->video_format);
+ }
++#endif
+
+ static void
+ pipewire_debug_impl(struct weston_pipewire *pipewire,
+@@ -141,6 +157,7 @@ pipewire_debug_impl(struct weston_pipewire *pipewire,
+ free(logstr);
+ }
+
++#if !PW_CHECK_VERSION(0, 2, 90)
+ static void
+ pipewire_debug(struct weston_pipewire *pipewire, const char *fmt, ...)
+ {
+@@ -150,6 +167,7 @@ pipewire_debug(struct weston_pipewire *pipewire, const char *fmt, ...)
+ pipewire_debug_impl(pipewire, NULL, fmt, ap);
+ va_end(ap);
+ }
++#endif
+
+ static void
+ pipewire_output_debug(struct pipewire_output *output, const char *fmt, ...)
+@@ -185,7 +203,9 @@ pipewire_output_handle_frame(struct pipewire_output *output, int fd,
+ const struct weston_drm_virtual_output_api *api =
+ output->pipewire->virtual_output_api;
+ size_t size = output->output->height * stride;
++#if !PW_CHECK_VERSION(0, 2, 90)
+ struct pw_type *t = output->pipewire->t;
++#endif
+ struct pw_buffer *buffer;
+ struct spa_buffer *spa_buffer;
+ struct spa_meta_header *h;
+@@ -203,7 +223,12 @@ pipewire_output_handle_frame(struct pipewire_output *output, int fd,
+
+ spa_buffer = buffer->buffer;
+
++#if PW_CHECK_VERSION(0, 2, 90)
++ if ((h = spa_buffer_find_meta_data(spa_buffer, SPA_META_Header,
++ sizeof(struct spa_meta_header)))) {
++#else
+ if ((h = spa_buffer_find_meta(spa_buffer, t->meta.Header))) {
++#endif
+ h->pts = -1;
+ h->flags = 0;
+ h->seq = output->seq++;
+@@ -375,18 +400,40 @@ pipewire_set_dpms(struct weston_output *base_output, enum dpms_enum level)
+ static int
+ pipewire_output_connect(struct pipewire_output *output)
+ {
++#if !PW_CHECK_VERSION(0, 2, 90)
+ struct weston_pipewire *pipewire = output->pipewire;
+ struct type *type = &pipewire->type;
++#endif
+ uint8_t buffer[1024];
+ struct spa_pod_builder builder =
+ SPA_POD_BUILDER_INIT(buffer, sizeof(buffer));
+ const struct spa_pod *params[1];
++#if !PW_CHECK_VERSION(0, 2, 90)
+ struct pw_type *t = pipewire->t;
++#endif
+ int frame_rate = output->output->current_mode->refresh / 1000;
+ int width = output->output->width;
+ int height = output->output->height;
+ int ret;
+
++#if PW_CHECK_VERSION(0, 2, 90)
++ params[0] = spa_pod_builder_add_object(&builder,
++ SPA_TYPE_OBJECT_Format, SPA_PARAM_EnumFormat,
++ SPA_FORMAT_mediaType, SPA_POD_Id(SPA_MEDIA_TYPE_video),
++ SPA_FORMAT_mediaSubtype, SPA_POD_Id(SPA_MEDIA_SUBTYPE_raw),
++ SPA_FORMAT_VIDEO_format, SPA_POD_Id(SPA_VIDEO_FORMAT_BGRx),
++ SPA_FORMAT_VIDEO_size, SPA_POD_Rectangle(&SPA_RECTANGLE(width, height)),
++ SPA_FORMAT_VIDEO_framerate, SPA_POD_Fraction(&SPA_FRACTION (0, 1)),
++ SPA_FORMAT_VIDEO_maxFramerate,
++ SPA_POD_CHOICE_RANGE_Fraction(&SPA_FRACTION(frame_rate, 1),
++ &SPA_FRACTION(1, 1),
++ &SPA_FRACTION(frame_rate, 1)));
++
++ ret = pw_stream_connect(output->stream, PW_DIRECTION_OUTPUT, SPA_ID_INVALID,
++ (PW_STREAM_FLAG_DRIVER |
++ PW_STREAM_FLAG_MAP_BUFFERS),
++ params, 1);
++#else
+ params[0] = spa_pod_builder_object(&builder,
+ t->param.idEnumFormat, t->spa_format,
+ "I", type->media_type.video,
+@@ -406,6 +453,7 @@ pipewire_output_connect(struct pipewire_output *output)
+ (PW_STREAM_FLAG_DRIVER |
+ PW_STREAM_FLAG_MAP_BUFFERS),
+ params, 1);
++#endif
+ if (ret != 0) {
+ weston_log("Failed to connect pipewire stream: %s",
+ spa_strerror(ret));
+@@ -482,26 +530,42 @@ pipewire_output_stream_state_changed(void *data, enum pw_stream_state old,
+ }
+
+ static void
++#if PW_CHECK_VERSION(0, 2, 90)
++pipewire_output_stream_param_changed(void *data, uint32_t id, const struct spa_pod *format)
++#else
+ pipewire_output_stream_format_changed(void *data, const struct spa_pod *format)
++#endif
+ {
+ struct pipewire_output *output = data;
++#if !PW_CHECK_VERSION(0, 2, 90)
+ struct weston_pipewire *pipewire = output->pipewire;
++#endif
+ uint8_t buffer[1024];
+ struct spa_pod_builder builder =
+ SPA_POD_BUILDER_INIT(buffer, sizeof(buffer));
+ const struct spa_pod *params[2];
++#if !PW_CHECK_VERSION(0, 2, 90)
+ struct pw_type *t = pipewire->t;
++#endif
+ int32_t width, height, stride, size;
+ const int bpp = 4;
+
+ if (!format) {
+ pipewire_output_debug(output, "format = None");
++#if PW_CHECK_VERSION(0, 2, 90)
++ pw_stream_update_params(output->stream, NULL, 0);
++#else
+ pw_stream_finish_format(output->stream, 0, NULL, 0);
++#endif
+ return;
+ }
+
++#if PW_CHECK_VERSION(0, 2, 90)
++ spa_format_video_raw_parse(format, &output->video_format);
++#else
+ spa_format_video_raw_parse(format, &output->video_format,
+ &pipewire->type.format_video);
++#endif
+
+ width = output->video_format.size.width;
+ height = output->video_format.size.height;
+@@ -510,6 +574,21 @@ pipewire_output_stream_format_changed(void *data, const struct spa_pod *format)
+
+ pipewire_output_debug(output, "format = %dx%d", width, height);
+
++#if PW_CHECK_VERSION(0, 2, 90)
++ params[0] = spa_pod_builder_add_object(&builder,
++ SPA_TYPE_OBJECT_ParamBuffers, SPA_PARAM_Buffers,
++ SPA_PARAM_BUFFERS_size, SPA_POD_Int(size),
++ SPA_PARAM_BUFFERS_stride, SPA_POD_Int(stride),
++ SPA_PARAM_BUFFERS_buffers, SPA_POD_CHOICE_RANGE_Int(4, 2, 8),
++ SPA_PARAM_BUFFERS_align, SPA_POD_Int(16));
++
++ params[1] = spa_pod_builder_add_object(&builder,
++ SPA_TYPE_OBJECT_ParamMeta, SPA_PARAM_Meta,
++ SPA_PARAM_META_type, SPA_POD_Id(SPA_META_Header),
++ SPA_PARAM_META_size, SPA_POD_Int(sizeof(struct spa_meta_header)));
++
++ pw_stream_update_params(output->stream, params, 2);
++#else
+ params[0] = spa_pod_builder_object(&builder,
+ t->param.idBuffers, t->param_buffers.Buffers,
+ ":", t->param_buffers.size,
+@@ -527,12 +606,17 @@ pipewire_output_stream_format_changed(void *data, const struct spa_pod *format)
+ ":", t->param_meta.size, "i", sizeof(struct spa_meta_header));
+
+ pw_stream_finish_format(output->stream, 0, params, 2);
++#endif
+ }
+
+ static const struct pw_stream_events stream_events = {
+ PW_VERSION_STREAM_EVENTS,
+ .state_changed = pipewire_output_stream_state_changed,
++#if PW_CHECK_VERSION(0, 2, 90)
++ .param_changed = pipewire_output_stream_param_changed,
++#else
+ .format_changed = pipewire_output_stream_format_changed,
++#endif
+ };
+
+ static struct weston_output *
+@@ -560,7 +644,11 @@ pipewire_output_create(struct weston_compositor *c, char *name)
+ if (!head)
+ goto err;
+
++#if PW_CHECK_VERSION(0, 2, 90)
++ output->stream = pw_stream_new(pipewire->core, name, NULL);
++#else
+ output->stream = pw_stream_new(pipewire->remote, name, NULL);
++#endif
+ if (!output->stream) {
+ weston_log("Cannot initialize pipewire stream\n");
+ goto err;
+@@ -704,6 +792,14 @@ weston_pipewire_loop_handler(int fd, uint32_t mask, void *data)
+ return 0;
+ }
+
++#if PW_CHECK_VERSION(0, 2, 90)
++static void
++weston_pipewire_error(void *data, uint32_t id, int seq, int res,
++ const char *error)
++{
++ weston_log("pipewire remote error: %s\n", error);
++}
++#else
+ static void
+ weston_pipewire_state_changed(void *data, enum pw_remote_state old,
+ enum pw_remote_state state, const char *error)
+@@ -725,12 +821,20 @@ weston_pipewire_state_changed(void *data, enum pw_remote_state old,
+ break;
+ }
+ }
++#endif
+
+
++#if PW_CHECK_VERSION(0, 2, 90)
++static const struct pw_core_events core_events = {
++ PW_VERSION_CORE_EVENTS,
++ .error = weston_pipewire_error,
++};
++#else
+ static const struct pw_remote_events remote_events = {
+ PW_VERSION_REMOTE_EVENTS,
+ .state_changed = weston_pipewire_state_changed,
+ };
++#endif
+
+ static int
+ weston_pipewire_init(struct weston_pipewire *pipewire)
+@@ -745,10 +849,19 @@ weston_pipewire_init(struct weston_pipewire *pipewire)
+
+ pw_loop_enter(pipewire->loop);
+
++#if PW_CHECK_VERSION(0, 2, 90)
++ pipewire->context = pw_context_new(pipewire->loop, NULL, 0);
++#else
+ pipewire->core = pw_core_new(pipewire->loop, NULL);
+ pipewire->t = pw_core_get_type(pipewire->core);
+ init_type(&pipewire->type, pipewire->t->map);
++#endif
+
++#if PW_CHECK_VERSION(0, 2, 90)
++ pw_core_add_listener(pipewire->core,
++ &pipewire->core_listener,
++ &core_events, pipewire);
++#else
+ pipewire->remote = pw_remote_new(pipewire->core, NULL, 0);
+ pw_remote_add_listener(pipewire->remote,
+ &pipewire->remote_listener,
+@@ -777,6 +890,7 @@ weston_pipewire_init(struct weston_pipewire *pipewire)
+ goto err;
+ }
+ }
++#endif
+
+ loop = wl_display_get_event_loop(pipewire->compositor->wl_display);
+ pipewire->loop_source =
+@@ -786,12 +900,14 @@ weston_pipewire_init(struct weston_pipewire *pipewire)
+ pipewire);
+
+ return 0;
++#if !PW_CHECK_VERSION(0, 2, 90)
+ err:
+ if (pipewire->remote)
+ pw_remote_destroy(pipewire->remote);
+ pw_loop_leave(pipewire->loop);
+ pw_loop_destroy(pipewire->loop);
+ return -1;
++#endif
+ }
+
+ static const struct weston_pipewire_api pipewire_api = {
diff --git a/dev-libs/weston/weston-9.0.0.ebuild b/dev-libs/weston/weston-9.0.0.ebuild
index ff6a7c803237..85cdf01cd444 100644
--- a/dev-libs/weston/weston-9.0.0.ebuild
+++ b/dev-libs/weston/weston-9.0.0.ebuild
@@ -18,7 +18,7 @@ if [[ ${PV} = *9999* ]]; then
SRC_URI="${SRC_PATCHES}"
else
SRC_URI="https://wayland.freedesktop.org/releases/${P}.tar.xz"
- KEYWORDS="amd64 arm ~arm64 x86"
+ KEYWORDS="amd64 arm ~arm64 ~ppc64 x86"
fi
LICENSE="MIT CC-BY-SA-3.0"
@@ -92,6 +92,10 @@ BDEPEND="
virtual/pkgconfig
"
+PATCHES=(
+ "${FILESDIR}"/${PN}-pipewire-0.3.patch
+)
+
src_configure() {
local emesonargs=(
$(meson_use drm backend-drm)