From e44a5818aee4660169b2683c77bb46b441d44b5b Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Fri, 16 Jun 2017 10:06:50 +0200 Subject: [PATCH] Cleanups --- Makefile | 3 + pipewire.spec | 67 +++++------------------ pipewire/client/context.c | 11 ++-- pipewire/client/protocol-native.c | 10 ++-- pipewire/client/protocol-native.h | 4 +- pipewire/client/proxy.h | 2 +- pipewire/modules/module-protocol-native.c | 5 +- pipewire/server/protocol-native.c | 10 ++-- pipewire/server/protocol-native.h | 2 +- 9 files changed, 40 insertions(+), 74 deletions(-) diff --git a/Makefile b/Makefile index 546ab8deb..f6555909e 100644 --- a/Makefile +++ b/Makefile @@ -11,3 +11,6 @@ run: PIPEWIRE_MODULE_DIR=build \ PIPEWIRE_CONFIG_FILE=build/pipewire/daemon/pipewire.conf \ build/pipewire/daemon/pipewire + +dist: + git archive --prefix=pipewire-0.1.0/ -o pipewire-0.1.0.tar.gz HEAD diff --git a/pipewire.spec b/pipewire.spec index d4acf3460..5d4a4dcb4 100644 --- a/pipewire.spec +++ b/pipewire.spec @@ -1,4 +1,4 @@ -%global majorminor 0.1 +%global majorminor 0.1.0 #global snap 20141103 #global gitrel 327 @@ -13,36 +13,31 @@ Name: pipewire Summary: Media Sharing Server -Version: 0.1 +Version: 0.1.0 Release: 2%{?snap:.%{snap}git%{shortcommit}}%{?dist} License: LGPLv2+ URL: http://www.freedesktop.org/wiki/Software/PipeWire %if 0%{?gitrel} # git clone git://anongit.freedesktop.org/gstreamer/pipewire # cd pipewire; git reset --hard %{gitcommit}; ./autogen.sh; make; make distcheck -Source0: pipewire-%{version}-%{gitrel}-g%{shortcommit}.tar.xz +Source0: pipewire-%{version}-%{gitrel}-g%{shortcommit}.tar.gz %else -Source0: http://freedesktop.org/software/pipewire/releases/pipewire-%{version}.tar.xz +Source0: http://freedesktop.org/software/pipewire/releases/pipewire-%{version}.tar.gz %endif ## upstream patches ## upstreamable patches -BuildRequires: automake libtool -BuildRequires: m4 -BuildRequires: libtool-ltdl-devel -BuildRequires: intltool +BuildRequires: meson >= 0.35.0 BuildRequires: pkgconfig -BuildRequires: xmltoman -BuildRequires: tcp_wrappers-devel BuildRequires: pkgconfig(glib-2.0) >= 2.32 BuildRequires: pkgconfig(gio-unix-2.0) >= 2.32 -BuildRequires: pkgconfig(gstreamer-1.0) >= 1.5.0 -BuildRequires: pkgconfig(gstreamer-base-1.0) >= 1.5.0 -BuildRequires: pkgconfig(gstreamer-plugins-base-1.0) >= 1.5.0 -BuildRequires: pkgconfig(gstreamer-net-1.0) >= 1.5.0 -BuildRequires: pkgconfig(gstreamer-allocators-1.0) >= 1.5.0 +BuildRequires: pkgconfig(gstreamer-1.0) >= 1.10.0 +BuildRequires: pkgconfig(gstreamer-base-1.0) >= 1.10.0 +BuildRequires: pkgconfig(gstreamer-plugins-base-1.0) >= 1.10.0 +BuildRequires: pkgconfig(gstreamer-net-1.0) >= 1.10.0 +BuildRequires: pkgconfig(gstreamer-allocators-1.0) >= 1.10.0 BuildRequires: systemd-devel >= 184 Requires(pre): shadow-utils @@ -81,46 +76,15 @@ This package contains command line utilities for the PipeWire media server. %prep %setup -q -T -b0 -n %{name}-%{version}%{?gitrel:-%{gitrel}-g%{shortcommit}} -%if 0%{?gitrel:1} -# fixup PACKAGE_VERSION that leaks into pkgconfig files and friends -sed -i.PACKAGE_VERSION -e "s|^PACKAGE_VERSION=.*|PACKAGE_VERSION=\'%{version}\'|" configure -%else -## kill rpaths -%if "%{_libdir}" != "/usr/lib" -sed -i -e 's|"/lib /usr/lib|"/%{_lib} %{_libdir}|' configure -%endif -%endif - - %build -%configure \ - --disable-silent-rules \ - --disable-static \ - --disable-rpath \ - --with-system-user=pipewire \ - --with-system-group=pipewire \ - --with-access-group=pipewire-access \ - --disable-systemd-daemon \ - --enable-tests - -make %{?_smp_mflags} V=1 +%meson +%meson_build %install -make install DESTDIR=$RPM_BUILD_ROOT - -## unpackaged files -# extraneous libtool crud -rm -fv $RPM_BUILD_ROOT%{_libdir}/*.la +%meson_install %check -# don't fail build due failing tests on big endian arches (rhbz#1067470) -make check \ -%ifarch ppc %{power64} s390 s390x - || : -%else - %{nil} -%endif - +%meson_test %pre getent group pipewire >/dev/null || groupadd -r pipewire @@ -135,9 +99,6 @@ exit 0 %license LICENSE GPL LGPL %doc README %{_sysconfdir}/xdg/autostart/pipewire.desktop -## already owned by -libs, see also https://bugzilla.redhat.com/show_bug.cgi?id=909690 -#dir %{_sysconfdir}/pipewire/ -%{_sysconfdir}/dbus-1/system.d/pipewire-system.conf %{_bindir}/pipewire %{_libdir}/libpipewire-%{majorminor}.so %{_libdir}/libpipewirecore-%{majorminor}.so diff --git a/pipewire/client/context.c b/pipewire/client/context.c index 2dc91c24a..5dd250fad 100644 --- a/pipewire/client/context.c +++ b/pipewire/client/context.c @@ -453,8 +453,7 @@ struct pw_context *pw_context_new(struct pw_loop *loop, this->loop = loop; - this->protocol = pw_protocol_get(PW_TYPE_PROTOCOL__Native); - pw_protocol_native_client_init(); + this->protocol = pw_protocol_native_client_init(); pw_type_init(&this->type); @@ -753,7 +752,7 @@ pw_context_list_module_info(struct pw_context *context, pw_module_info_cb_t cb, /** Get module information * * \param context A \ref pw_context - * \param id the server side id of the module to query + * \param id the client side id of the module to query * \param cb the callback to call with the results * \param user_data user data passed to \a cb * @@ -800,7 +799,7 @@ pw_context_list_client_info(struct pw_context *context, pw_client_info_cb_t cb, /** Get client information * * \param context A \ref pw_context - * \param id the server side id of the client to query + * \param id the client side id of the client to query * \param cb the callback to call with the results * \param user_data user data passed to \a cb * @@ -846,7 +845,7 @@ void pw_context_list_node_info(struct pw_context *context, pw_node_info_cb_t cb, /** Get node information * * \param context A \ref pw_context - * \param id the server side id of the node to query + * \param id the client side id of the node to query * \param cb the callback to call with the results * \param user_data user data passed to \a cb * @@ -892,7 +891,7 @@ void pw_context_list_link_info(struct pw_context *context, pw_link_info_cb_t cb, /** Get link information * * \param context A \ref pw_context - * \param id the server side id of the link to query + * \param id the client side id of the link to query * \param cb the callback to call with the results * \param user_data user data passed to \a cb * diff --git a/pipewire/client/protocol-native.c b/pipewire/client/protocol-native.c index 1b88859e8..48b865b23 100644 --- a/pipewire/client/protocol-native.c +++ b/pipewire/client/protocol-native.c @@ -1025,16 +1025,16 @@ static const struct pw_interface pw_protocol_native_client_link_interface = { PW_LINK_EVENT_NUM, pw_protocol_native_client_link_demarshal, }; -void pw_protocol_native_client_init(void) +struct pw_protocol *pw_protocol_native_client_init(void) { static bool init = false; struct pw_protocol *protocol; - if (init) - return; - protocol = pw_protocol_get(PW_TYPE_PROTOCOL__Native); + if (init) + return protocol; + pw_protocol_add_interfaces(protocol, &pw_protocol_native_client_core_interface, NULL); @@ -1058,4 +1058,6 @@ void pw_protocol_native_client_init(void) NULL); init = true; + + return protocol; } diff --git a/pipewire/client/protocol-native.h b/pipewire/client/protocol-native.h index f36ec6cb8..f76f75d3d 100644 --- a/pipewire/client/protocol-native.h +++ b/pipewire/client/protocol-native.h @@ -17,4 +17,6 @@ * Boston, MA 02110-1301, USA. */ -void pw_protocol_native_client_init(void); +#include + +struct pw_protocol *pw_protocol_native_client_init(void); diff --git a/pipewire/client/proxy.h b/pipewire/client/proxy.h index bada46ba7..09bfa7395 100644 --- a/pipewire/client/proxy.h +++ b/pipewire/client/proxy.h @@ -100,7 +100,7 @@ struct pw_proxy { const void *implementation; /**< event handler implementation */ pw_destroy_t destroy; /**< optional destroy function to clean up the object */ - /** destroy_signal is emited when the proxy is destroyed */ + /** destroy is emited when the proxy is destroyed */ PW_SIGNAL(destroy_signal, (struct pw_listener *listener, struct pw_proxy *proxy)); void *user_data; /**< extra user data */ diff --git a/pipewire/modules/module-protocol-native.c b/pipewire/modules/module-protocol-native.c index 5271ba6f8..e9b408425 100644 --- a/pipewire/modules/module-protocol-native.c +++ b/pipewire/modules/module-protocol-native.c @@ -85,7 +85,6 @@ struct native_client { int fd; struct spa_source *source; struct pw_connection *connection; - struct pw_listener resource_added; struct pw_listener busy_changed; }; @@ -219,7 +218,7 @@ static struct native_client *client_new(struct impl *impl, int fd) if (this->connection == NULL) goto no_connection; - client->protocol = pw_protocol_get(PW_TYPE_PROTOCOL__Native); + client->protocol = pw_protocol_native_server_init(); client->protocol_private = this->connection; this->client = client; @@ -453,8 +452,6 @@ static void pw_protocol_native_destroy(struct impl *impl) bool pipewire__module_init(struct pw_module *module, const char *args) { - pw_protocol_native_server_init(); - pw_protocol_native_new(module->core, NULL); return true; } diff --git a/pipewire/server/protocol-native.c b/pipewire/server/protocol-native.c index a96aad359..b8f9134e1 100644 --- a/pipewire/server/protocol-native.c +++ b/pipewire/server/protocol-native.c @@ -978,16 +978,16 @@ const struct pw_interface pw_protocol_native_server_link_interface = { PW_LINK_EVENT_NUM, &pw_protocol_native_server_link_events, }; -void pw_protocol_native_server_init(void) +struct pw_protocol *pw_protocol_native_server_init(void) { static bool init = false; struct pw_protocol *protocol; - if (init) - return; - protocol = pw_protocol_get(PW_TYPE_PROTOCOL__Native); + if (init) + return protocol; + pw_protocol_add_interfaces(protocol, NULL, &pw_protocol_native_server_core_interface); @@ -1011,4 +1011,6 @@ void pw_protocol_native_server_init(void) &pw_protocol_native_server_link_interface); init = true; + + return protocol; } diff --git a/pipewire/server/protocol-native.h b/pipewire/server/protocol-native.h index 26b3d1838..cb50a4f24 100644 --- a/pipewire/server/protocol-native.h +++ b/pipewire/server/protocol-native.h @@ -19,4 +19,4 @@ #include "pipewire/client/pipewire.h" -void pw_protocol_native_server_init(void); +struct pw_protocol *pw_protocol_native_server_init(void);