From 2b76684efeb6956f8d3e509029a330b2f28099af Mon Sep 17 00:00:00 2001 From: maxice8 Date: Sun, 14 Jan 2018 07:03:12 -0200 Subject: [PATCH] New package: pipewire-0.1.7. --- common/shlibs | 2 + srcpkgs/pipewire-devel | 1 + srcpkgs/pipewire-doc | 1 + .../patches/add-missing-fcntl_h-include.patch | 12 ++ .../fix-missing-pthread_h-for-pthread_t.patch | 10 ++ .../patches/fix-usage-of-RLIMIT_RTTIME.patch | 18 ++ .../patches/fix-usage-of-error_h.patch | 164 ++++++++++++++++++ .../patches/remove-systemd-dependency.patch | 10 ++ srcpkgs/pipewire/template | 35 ++++ 9 files changed, 253 insertions(+) create mode 120000 srcpkgs/pipewire-devel create mode 120000 srcpkgs/pipewire-doc create mode 100644 srcpkgs/pipewire/patches/add-missing-fcntl_h-include.patch create mode 100644 srcpkgs/pipewire/patches/fix-missing-pthread_h-for-pthread_t.patch create mode 100644 srcpkgs/pipewire/patches/fix-usage-of-RLIMIT_RTTIME.patch create mode 100644 srcpkgs/pipewire/patches/fix-usage-of-error_h.patch create mode 100644 srcpkgs/pipewire/patches/remove-systemd-dependency.patch create mode 100644 srcpkgs/pipewire/template diff --git a/common/shlibs b/common/shlibs index 4878a41c548..56db6c8aad4 100644 --- a/common/shlibs +++ b/common/shlibs @@ -3089,3 +3089,5 @@ libarcan_shmif_server.so.0.11 arcan-0.5.4.3_1 libarcan_tui.so.0.11 arcan-0.5.4.3_1 libscrypt.so.0 libscrypt-devel-1.21_1 liblwipv6.so.2 lwipv6-1.5a_1 +libpipewire-0.1.so.0 pipewire-0.1.7_1 +libspa-lib.so.0 pipewire-0.1.7_1 diff --git a/srcpkgs/pipewire-devel b/srcpkgs/pipewire-devel new file mode 120000 index 00000000000..c9c97cf6707 --- /dev/null +++ b/srcpkgs/pipewire-devel @@ -0,0 +1 @@ +pipewire \ No newline at end of file diff --git a/srcpkgs/pipewire-doc b/srcpkgs/pipewire-doc new file mode 120000 index 00000000000..c9c97cf6707 --- /dev/null +++ b/srcpkgs/pipewire-doc @@ -0,0 +1 @@ +pipewire \ No newline at end of file diff --git a/srcpkgs/pipewire/patches/add-missing-fcntl_h-include.patch b/srcpkgs/pipewire/patches/add-missing-fcntl_h-include.patch new file mode 100644 index 00000000000..7195b0c1ada --- /dev/null +++ b/srcpkgs/pipewire/patches/add-missing-fcntl_h-include.patch @@ -0,0 +1,12 @@ +Musl is stricter + +--- spa/include/spa/param/meta.h ++++ spa/include/spa/param/meta.h +@@ -24,6 +24,7 @@ + extern "C" { + #endif + ++#include /* for off_t */ + #include + #include + #include diff --git a/srcpkgs/pipewire/patches/fix-missing-pthread_h-for-pthread_t.patch b/srcpkgs/pipewire/patches/fix-missing-pthread_h-for-pthread_t.patch new file mode 100644 index 00000000000..c637920fc9c --- /dev/null +++ b/srcpkgs/pipewire/patches/fix-missing-pthread_h-for-pthread_t.patch @@ -0,0 +1,10 @@ +--- src/pipewire/private.h ++++ src/pipewire/private.h +@@ -25,6 +25,7 @@ extern "C" { + #endif + + #include ++#include /* for pthread_t */ + + + #include "pipewire/mem.h" diff --git a/srcpkgs/pipewire/patches/fix-usage-of-RLIMIT_RTTIME.patch b/srcpkgs/pipewire/patches/fix-usage-of-RLIMIT_RTTIME.patch new file mode 100644 index 00000000000..83509efb8a5 --- /dev/null +++ b/srcpkgs/pipewire/patches/fix-usage-of-RLIMIT_RTTIME.patch @@ -0,0 +1,18 @@ +--- src/pipewire/data-loop.c ++++ src/pipewire/data-loop.c +@@ -47,6 +47,7 @@ static void make_realtime(struct pw_data_loop *this) + system_bus = pw_rtkit_bus_get_system(); + + rl.rlim_cur = rl.rlim_max = rttime; ++#ifdef RLIMIT_RTTIME + if ((r = setrlimit(RLIMIT_RTTIME, &rl)) < 0) + pw_log_debug("setrlimit() failed: %s", strerror(errno)); + +@@ -60,6 +61,7 @@ static void make_realtime(struct pw_data_loop *this) + pw_log_debug("setrlimit() failed: %s", strerror(errno)); + } + } ++#endif + + if ((r = pw_rtkit_make_realtime(system_bus, 0, rtprio)) < 0) { + pw_log_debug("could not make thread realtime: %s", strerror(r)); diff --git a/srcpkgs/pipewire/patches/fix-usage-of-error_h.patch b/srcpkgs/pipewire/patches/fix-usage-of-error_h.patch new file mode 100644 index 00000000000..f7a43c83cfb --- /dev/null +++ b/srcpkgs/pipewire/patches/fix-usage-of-error_h.patch @@ -0,0 +1,164 @@ +--- spa/tests/test-control.c ++++ spa/tests/test-control.c +@@ -18,7 +18,9 @@ + */ + + #include ++#ifdef __GLIBC__ + #include ++#endif + #include + #include + #include +@@ -358,8 +360,10 @@ static int make_nodes(struct data *data, const char *device) + spa_pod_builder_init(&b, buffer, sizeof(buffer)); + if ((res = spa_node_port_enum_params(data->source, SPA_DIRECTION_OUTPUT, 0, + data->type.param.idIO, &idx, NULL, ¶m, &b)) < 1) { ++#ifdef __GLIBC__ + if (res < 0) + error(0, -res, "port_enum_params"); ++#endif + break; + } + +@@ -369,19 +373,23 @@ static int make_nodes(struct data *data, const char *device) + NULL); + + if (propId == data->type.props_freq) { ++#ifdef __GLIBC__ + if ((res = spa_node_port_set_io(data->source, + SPA_DIRECTION_OUTPUT, 0, + id, + &data->ctrl_source_freq, sizeof(data->ctrl_source_freq))) < 0) + error(0, -res, "set_io freq"); ++#endif + + } + else if (propId == data->type.props_volume) { ++#ifdef __GLIBC__ + if ((res = spa_node_port_set_io(data->source, + SPA_DIRECTION_OUTPUT, 0, + id, + &data->ctrl_source_volume, sizeof(data->ctrl_source_volume))) < 0) + error(0, -res, "set_io volume"); ++#endif + } + } + +--- spa/tests/test-mixer.c ++++ spa/tests/test-mixer.c +@@ -18,7 +18,9 @@ + */ + + #include ++#ifdef __GLIBC__ + #include ++#endif + #include + #include + #include +@@ -369,8 +371,10 @@ static int make_nodes(struct data *data, const char *device) + ":", data->type.props_device, "s", device ? device : "hw:0", + ":", data->type.props_min_latency, "i", MIN_LATENCY); + ++#ifdef __GLIBC__ + if ((res = spa_node_set_param(data->sink, data->type.param.idProps, 0, props)) < 0) + error(0, -res, "set_param props"); ++#endif + + if ((res = make_node(data, &data->mix, + "build/spa/plugins/audiomixer/libspa-audiomixer.so", +@@ -453,6 +457,7 @@ static int make_nodes(struct data *data, const char *device) + data->ctrl_volume[0] = SPA_POD_DOUBLE_INIT(0.5); + data->ctrl_volume[1] = SPA_POD_DOUBLE_INIT(0.5); + ++#ifdef __GLIBC__ + if ((res = spa_node_port_set_io(data->mix, + SPA_DIRECTION_INPUT, data->mix_ports[0], + data->type.io_inprop_volume, +@@ -464,6 +469,7 @@ static int make_nodes(struct data *data, const char *device) + data->type.io_inprop_volume, + &data->ctrl_volume[1], sizeof(data->ctrl_volume[1]))) < 0) + error(0, -res, "set_io volume 1"); ++#endif + + + #ifdef USE_GRAPH +--- spa/tools/spa-inspect.c ++++ spa/tools/spa-inspect.c +@@ -17,7 +17,9 @@ + * Boston, MA 02110-1301, USA. + */ + ++#ifdef __GLIBC__ + #include ++#endif + #include + #include + #include +@@ -71,8 +73,10 @@ inspect_node_params(struct data *data, struct spa_node *node) + if ((res = spa_node_enum_params(node, + data->type.param.idList, &idx1, + NULL, ¶m, &b)) <= 0) { ++#ifdef __GLIBC__ + if (res != 0) + error(0, -res, "enum_params"); ++#endif + break; + } + +@@ -88,8 +92,10 @@ inspect_node_params(struct data *data, struct spa_node *node) + if ((res = spa_node_enum_params(node, + id, &idx2, + NULL, ¶m, &b)) <= 0) { ++#ifdef __GLIBC__ + if (res != 0) + error(0, -res, "enum_params %d", id); ++#endif + break; + } + spa_debug_pod(param, flags); +@@ -115,8 +121,10 @@ inspect_port_params(struct data *data, struct spa_node *node, + direction, port_id, + data->type.param.idList, &idx1, + NULL, ¶m, &b)) <= 0) { ++#ifdef __GLIBC__ + if (res != 0) + error(0, -res, "port_enum_params"); ++#endif + break; + } + spa_pod_object_parse(param, +@@ -132,8 +140,10 @@ inspect_port_params(struct data *data, struct spa_node *node, + direction, port_id, + id, &idx2, + NULL, ¶m, &b)) <= 0) { ++#ifdef __GLIBC__ + if (res != 0) + error(0, -res, "port_enum_params"); ++#endif + break; + } + +@@ -214,8 +224,10 @@ static void inspect_factory(struct data *data, const struct spa_handle_factory * + if ((res = spa_handle_factory_enum_interface_info(factory, &info, &index)) <= 0) { + if (res == 0) + break; ++#ifdef __GLIBC__ + else + error(0, -res, "spa_handle_factory_enum_interface_info"); ++#endif + } + printf(" interface: '%s'\n", info->type); + +@@ -297,8 +309,10 @@ int main(int argc, char *argv[]) + const struct spa_handle_factory *factory; + + if ((res = enum_func(&factory, &index)) <= 0) { ++#ifdef __GLIBC__ + if (res != 0) + error(0, -res, "enum_func"); ++#endif + break; + } + inspect_factory(&data, factory); diff --git a/srcpkgs/pipewire/patches/remove-systemd-dependency.patch b/srcpkgs/pipewire/patches/remove-systemd-dependency.patch new file mode 100644 index 00000000000..95a557103f4 --- /dev/null +++ b/srcpkgs/pipewire/patches/remove-systemd-dependency.patch @@ -0,0 +1,10 @@ +nt fazefrench + +--- src/daemon/meson.build ++++ src/daemon/meson.build +@@ -29,5 +29,3 @@ executable('pipewire', + include_directories : [configinc, spa_inc], + dependencies : [pipewire_dep], + ) +- +-subdir('systemd') diff --git a/srcpkgs/pipewire/template b/srcpkgs/pipewire/template new file mode 100644 index 00000000000..74d0f6da549 --- /dev/null +++ b/srcpkgs/pipewire/template @@ -0,0 +1,35 @@ +# Template file for 'pipewire' +pkgname=pipewire +version=0.1.7 +revision=1 +configure_args="-Denable_docs=true -Denable_man=true -Denable_gstreamer=false" +build_style=meson +hostmakedepends="pkg-config xmltoman doxygen graphviz" +makedepends="dbus-devel jack-devel alsa-lib-devel v4l-utils-devel SDL2-devel + ffmpeg-devel libX11-devel" +short_desc="Server and user space API to deal with multimedia pipelines" +maintainer="maxice8 " +license="LGPL-2.1" +homepage="https://pipewire.org/" +distfiles="https://github.com/PipeWire/pipewire/archive/${version}.tar.gz" +checksum=ed186539e08e20886f4ab0720e0e15c24fc71671480684118df004e9abebf125 + +pipewire-doc_package() { + noarch=yes + short_desc+=" - documentation" + pkg_install() { + vmove usr/share/doc + } +} + +# XXX: There is potential to further divide into more subpkgs one for libpipewire +# and another for libspa +pipewire-devel_package() { + depends="${sourcepkg}>=${version}_${revision}" + short_desc+=" - development files" + pkg_install() { + vmove usr/include + vmove usr/lib/pkgconfig + vmove "usr/lib/*.so" + } +}