From a1e0ce5940a0384e2db7381ffae7d82c1ac68375 Mon Sep 17 00:00:00 2001
From: Helmut Pozimski <helmut@pozimski.eu>
Date: Sun, 9 Jun 2019 10:23:39 +0200
Subject: [PATCH 1/4] gstreamer1: update to 1.16.0.

---
 .../gstreamer1/patches/no-gir-automagic.patch | 13 ++++++
 srcpkgs/gstreamer1/template                   | 42 +++++++++----------
 2 files changed, 32 insertions(+), 23 deletions(-)
 create mode 100644 srcpkgs/gstreamer1/patches/no-gir-automagic.patch

diff --git a/srcpkgs/gstreamer1/patches/no-gir-automagic.patch b/srcpkgs/gstreamer1/patches/no-gir-automagic.patch
new file mode 100644
index 00000000000..c0135214edd
--- /dev/null
+++ b/srcpkgs/gstreamer1/patches/no-gir-automagic.patch
@@ -0,0 +1,13 @@
+diff --git a/meson.build b/meson.build
+index e738c55..e1b8d93 100644
+--- meson.build
++++ meson.build
+@@ -451,7 +451,7 @@ rt_lib = cc.find_library('rt', required : false)
+ gir = find_program('g-ir-scanner', required : get_option('introspection'))
+ gnome = import('gnome')
+ 
+-build_gir = gir.found() and not meson.is_cross_build()
++build_gir = gir.found()
+ 
+ gir_init_section = [ '--add-init-section=extern void gst_init(gint*,gchar**);' + \
+     'g_setenv("GST_REGISTRY_DISABLE", "yes", TRUE);' + \
diff --git a/srcpkgs/gstreamer1/template b/srcpkgs/gstreamer1/template
index 4f419e38488..4bcdf03012b 100644
--- a/srcpkgs/gstreamer1/template
+++ b/srcpkgs/gstreamer1/template
@@ -1,40 +1,34 @@
 # Template file for 'gstreamer1'
 pkgname=gstreamer1
-version=1.14.5
+version=1.16.0
 revision=1
 wrksrc="gstreamer-${version}"
-build_style=gnu-configure
+build_style=meson
 build_helper="gir"
-configure_args="--disable-valgrind --enable-docbook
- --with-package-origin=http://www.voidlinux.org $(vopt_enable gir introspection)"
-hostmakedepends="automake gettext-devel libtool pkg-config flex python
- docbook-xsl glib-devel"
-makedepends="libxml2-devel libglib-devel"
+configure_args="-Dptp-helper-permissions=capabilities
+ -Dpackage-origin=https://www.voidlinux.org -Ddbghelp=disabled
+ -Dintrospection=$(vopt_if gir enabled disabled)
+ -Dgtk_doc=$(vopt_if gtk_doc enabled disabled)"
+hostmakedepends="gettext-devel pkg-config flex python docbook-xsl glib-devel
+ libcap-progs $(vopt_if gtk_doc gtk-doc)"
+makedepends="libxml2-devel libglib-devel gtk+3-devel libcap-devel libunwind-devel
+ bash-completion"
 short_desc="Core GStreamer libraries and elements (1.x)"
 maintainer="Juan RP <xtraeme@voidlinux.org>"
 license="LGPL-2.0-or-later"
 homepage="https://gstreamer.freedesktop.org"
 distfiles="${homepage}/src/gstreamer/gstreamer-${version}.tar.xz"
-checksum=e40888752883177e97b2d90cd68591f87ccd213dc0178ff721d80a4cdaad34b5
+checksum=0e8e2f7118be437cba879353970cf83c2acced825ecb9275ba05d9186ef07c00
 
 # Package build options
-build_options="gir"
+build_options="gir gtk_doc"
 build_options_default="gir"
 
-pre_configure() {
-	# Remove a non-existing include path from the gstreamer.pc.in file,
-	# or otherwise building pkgs which enable -Werror fail to build with
-	# gcc-6.2.1 which issues a warning for non existing -I/some/path args.
-	# There is no ./usr/lib/gstreamer-1.0/include path in this pkg.
-	sed -i pkgconfig/gstreamer.pc.in \
-		-e 's; -I${libdir}/gstreamer-@GST_API_VERSION@/include;;'
-	NOCONFIGURE=1 ./autogen.sh
-}
+desc_option_gtk_doc="Build GTK Documentation with gtk-doc"
 
-pre_build() {
-	 # Export paths for gobject introspection
-	 export GIR_EXTRA_LIBS_PATH="${wrksrc}/gst/.libs:${wrksrc}/libs/gst/base/.libs"
-}
+if [ -z "$CROSS_BUILD" ]; then
+	build_options_default+=" gtk_doc"
+fi
 
 gstreamer1-devel_package() {
 	depends="${makedepends} ${sourcepkg}>=${version}_${revision}"
@@ -43,7 +37,9 @@ gstreamer1-devel_package() {
 		vmove usr/include
 		vmove usr/lib/pkgconfig
 		vmove "usr/lib/*.so"
-		vmove usr/share/gtk-doc
+		if [ "$build_option_gtk_doc" ]; then
+			vmove usr/share/gtk-doc
+		fi
 		vmove usr/share/aclocal
 		if [ "$build_option_gir" ]; then
 			vmove "usr/share/gir*"

From 5bdee4cacc328d222412830b3a1ab48af0204bfe Mon Sep 17 00:00:00 2001
From: Helmut Pozimski <helmut@pozimski.eu>
Date: Sun, 9 Jun 2019 10:58:49 +0200
Subject: [PATCH 2/4] gst-plugins-base1: update to 1.16.0.

---
 .../patches/no-gir-automagic.patch            |  11 ++
 srcpkgs/gst-plugins-base1/patches/sndio.patch | 169 ++++++------------
 srcpkgs/gst-plugins-base1/template            |  28 +--
 3 files changed, 77 insertions(+), 131 deletions(-)
 create mode 100644 srcpkgs/gst-plugins-base1/patches/no-gir-automagic.patch

diff --git a/srcpkgs/gst-plugins-base1/patches/no-gir-automagic.patch b/srcpkgs/gst-plugins-base1/patches/no-gir-automagic.patch
new file mode 100644
index 00000000000..f1226041ae6
--- /dev/null
+++ b/srcpkgs/gst-plugins-base1/patches/no-gir-automagic.patch
@@ -0,0 +1,11 @@
+--- meson.build	2019-06-09 10:53:06.607859182 +0200
++++ meson.build	2019-06-09 10:53:24.953088389 +0200
+@@ -356,7 +356,7 @@
+ 
+ gir = find_program('g-ir-scanner', required : get_option('introspection'))
+ gnome = import('gnome')
+-build_gir = gir.found() and not meson.is_cross_build()
++build_gir = gir.found()
+ gir_init_section = [ '--add-init-section=extern void gst_init(gint*,gchar**);' + \
+     'g_setenv("GST_REGISTRY_DISABLE", "yes", TRUE);' + \
+     'g_setenv("GST_REGISTRY_1.0", "@0@", TRUE);'.format(meson.current_build_dir() + '/gir_empty_registry.reg') + \
diff --git a/srcpkgs/gst-plugins-base1/patches/sndio.patch b/srcpkgs/gst-plugins-base1/patches/sndio.patch
index 8173db6ab7d..fe61fb88e67 100644
--- a/srcpkgs/gst-plugins-base1/patches/sndio.patch
+++ b/srcpkgs/gst-plugins-base1/patches/sndio.patch
@@ -1,115 +1,21 @@
-Source: OpenBSD ports
+Source: OpenBSD ports, adapted to work with meson
 Upstream: No
 Reason: sndio support
 
-
-diff --git configure.ac configure.ac
-index 1287583a6..5cb12c7db 100644
---- configure.ac
-+++ configure.ac
-@@ -634,6 +634,20 @@ AG_GST_CHECK_FEATURE(ALSA, [ALSA], alsa, [
-   ])
- ])
- 
-+dnl *** sndio ***
-+AG_GST_CHECK_FEATURE(SNDIO, [sndio audio], sndio, [
-+  AC_CHECK_HEADER(sndio.h, HAVE_SNDIO="yes", HAVE_SNDIO="no")
-+  if test $HAVE_SNDIO = yes
-+  then
-+    AC_CHECK_LIB(sndio, sio_open, HAVE_SNDIO="yes", HAVE_SNDIO="no", [])
-+    if test $HAVE_SNDIO = yes
-+    then
-+      SNDIO_LIBS=-lsndio
-+      AC_SUBST(SNDIO_LIBS)
-+    fi
-+  fi
-+])
-+
- dnl *** CDParanoia ***
- dnl Note: upstream has a pkg-config file only in post-10.2 SVN so far
- translit(dnm, m, l) AM_CONDITIONAL(USE_CDPARANOIA, true)
-@@ -789,6 +803,7 @@ else
- dnl not building plugins with external dependencies,
- dnl but we still need to set the conditionals
- AM_CONDITIONAL(USE_ALSA, false)
-+AM_CONDITIONAL(USE_SNDIO, false)
- AM_CONDITIONAL(USE_CDPARANOIA, false)
- AM_CONDITIONAL(USE_GL, false)
- AM_CONDITIONAL(USE_IVORBIS, false)
-@@ -930,6 +945,7 @@ sys/ximage/Makefile
- sys/xvimage/Makefile
- ext/Makefile
- ext/alsa/Makefile
-+ext/sndio/Makefile
- ext/cdparanoia/Makefile
- ext/gl/Makefile
- ext/libvisual/Makefile
-diff --git ext/Makefile.am ext/Makefile.am
-index c70b212d6..c28b8a3ea 100644
---- ext/Makefile.am
-+++ ext/Makefile.am
-@@ -4,6 +4,12 @@ else
- ALSA_DIR=
- endif
- 
-+if USE_SNDIO
-+SNDIO_DIR=sndio
-+else
-+SNDIO_DIR=
-+endif
-+
- if USE_CDPARANOIA
- CDPARANOIA_DIR=cdparanoia
- else
-@@ -62,6 +68,7 @@ endif
- 
- SUBDIRS = \
-   $(ALSA_DIR) \
-+  $(SNDIO_DIR) \
-   $(CDPARANOIA_DIR) \
-   $(GL_DIR) \
-   $(LIBVISUAL_DIR) \
-@@ -73,6 +80,7 @@ SUBDIRS = \
- 
- DIST_SUBDIRS = \
-   alsa \
-+  sndio \
-   cdparanoia \
-   gl \
-   libvisual \
-diff --git ext/sndio/Makefile.am ext/sndio/Makefile.am
-new file mode 100644
-index 000000000..7b782de8a
---- /dev/null
-+++ ext/sndio/Makefile.am
-@@ -0,0 +1,24 @@
-+plugin_LTLIBRARIES = libgstsndio.la
-+
-+libgstsndio_la_SOURCES = \
-+	gstsndio.c \
-+	sndiosink.c \
-+	sndiosrc.c
-+
-+libgstsndio_la_CFLAGS = \
-+	$(GST_PLUGINS_BASE_CFLAGS) \
-+        $(GST_BASE_CFLAGS) \
-+	$(GST_CFLAGS)
-+	$(SNDIO_CFLAGS)
-+libgstsndio_la_LIBADD = \
-+	$(top_builddir)/gst-libs/gst/audio/libgstaudio-$(GST_API_VERSION).la \
-+	$(GST_BASE_LIBS) \
-+	$(SNDIO_LIBS)
-+
-+libgstsndio_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
-+libgstsndio_la_LIBTOOLFLAGS = --tag=disable-static
-+
-+noinst_HEADERS = \
-+	gstsndio.h \
-+	sndiosink.h \
-+	sndiosrc.h
+diff --git ext/meson.build ext/meson.build
+index d984b50..5f0becc 100644
+--- ext/meson.build
++++ ext/meson.build
+@@ -5,5 +5,6 @@ subdir('libvisual')
+ subdir('ogg')
+ subdir('opus')
+ subdir('pango')
++subdir('sndio')
+ subdir('theora')
+ subdir('vorbis')
 diff --git ext/sndio/gstsndio.c ext/sndio/gstsndio.c
 new file mode 100644
-index 000000000..2321dc208
+index 0000000..2321dc2
 --- /dev/null
 +++ ext/sndio/gstsndio.c
 @@ -0,0 +1,401 @@
@@ -516,7 +422,7 @@ index 000000000..2321dc208
 +}
 diff --git ext/sndio/gstsndio.h ext/sndio/gstsndio.h
 new file mode 100644
-index 000000000..77ec4e6f8
+index 0000000..77ec4e6
 --- /dev/null
 +++ ext/sndio/gstsndio.h
 @@ -0,0 +1,78 @@
@@ -598,9 +504,36 @@ index 000000000..77ec4e6f8
 +GstCaps *gst_sndio_caps (gpointer sio, int mode, struct sio_hdl *hdl);
 +
 +#endif
+diff --git ext/sndio/meson.build ext/sndio/meson.build
+new file mode 100644
+index 0000000..3f9a9fe
+--- /dev/null
++++ ext/sndio/meson.build
+@@ -0,0 +1,21 @@
++sndio_sources = [
++  'gstsndio.c',
++  'sndiosink.c',
++  'sndiosrc.c',
++]
++
++cc =  meson.get_compiler('c')
++
++sndio_dep = cc.find_library('sndio', required : get_option('sndio'))
++
++if sndio_dep.found()
++  gstsndio = library('gstsndio',
++    sndio_sources,
++	c_args : gst_plugins_base_args,
++  include_directories: [configinc, libsinc],
++  dependencies: [gst_base_dep, sndio_dep, audio_dep],
++    install : true,
++    install_dir : plugins_install_dir,
++  )
++  pkgconfig.generate(gstsndio, install_dir : plugins_pkgconfig_install_dir)
++endif
 diff --git ext/sndio/sndiosink.c ext/sndio/sndiosink.c
 new file mode 100644
-index 000000000..cc68bd29d
+index 0000000..cc68bd2
 --- /dev/null
 +++ ext/sndio/sndiosink.c
 @@ -0,0 +1,226 @@
@@ -832,7 +765,7 @@ index 000000000..cc68bd29d
 +}
 diff --git ext/sndio/sndiosink.h ext/sndio/sndiosink.h
 new file mode 100644
-index 000000000..314e62210
+index 0000000..314e622
 --- /dev/null
 +++ ext/sndio/sndiosink.h
 @@ -0,0 +1,57 @@
@@ -895,7 +828,7 @@ index 000000000..314e62210
 +#endif /* __GST_SNDIOSINK_H__ */
 diff --git ext/sndio/sndiosrc.c ext/sndio/sndiosrc.c
 new file mode 100644
-index 000000000..5b6d787c5
+index 0000000..5b6d787
 --- /dev/null
 +++ ext/sndio/sndiosrc.c
 @@ -0,0 +1,225 @@
@@ -1126,7 +1059,7 @@ index 000000000..5b6d787c5
 +}
 diff --git ext/sndio/sndiosrc.h ext/sndio/sndiosrc.h
 new file mode 100644
-index 000000000..83fd29ce4
+index 0000000..83fd29c
 --- /dev/null
 +++ ext/sndio/sndiosrc.h
 @@ -0,0 +1,57 @@
@@ -1187,3 +1120,15 @@ index 000000000..83fd29ce4
 +G_END_DECLS
 +
 +#endif /* __GST_SNDIOSRC_H__ */
+diff --git meson_options.txt meson_options.txt
+index e7af4dd..827507f 100644
+--- meson_options.txt
++++ meson_options.txt
+@@ -58,6 +58,7 @@ option('libvisual', type : 'feature', value : 'auto', description : 'libvisual a
+ option('ogg', type : 'feature', value : 'auto', description : 'ogg parser, muxer, demuxer plugin')
+ option('opus', type : 'feature', value : 'auto', description : 'OPUS audio codec plugin')
+ option('pango', type : 'feature', value : 'auto', description : 'Pango text rendering and overlay plugin')
++option('sndio', type : 'feature', value : 'auto', description : 'sndio support')
+ option('theora', type : 'feature', value : 'auto', description : 'Theora video parser and codec plugin')
+ option('tremor', type : 'feature', value : 'auto', description : 'Integer Vorbis decoder plugin for devices without floating point')
+ option('vorbis', type : 'feature', value : 'auto', description : 'Vorbis audio parser, tagger, and codec plugin')
diff --git a/srcpkgs/gst-plugins-base1/template b/srcpkgs/gst-plugins-base1/template
index f28fcc0b1a7..aa098aecb0e 100644
--- a/srcpkgs/gst-plugins-base1/template
+++ b/srcpkgs/gst-plugins-base1/template
@@ -1,26 +1,27 @@
 # Template file for 'gst-plugins-base1'
 pkgname=gst-plugins-base1
-version=1.14.5
+version=1.16.0
 revision=1
 wrksrc="${pkgname/1/}-${version}"
-build_style=gnu-configure
+build_style=meson
 build_helper="gir"
-configure_args="--enable-experimental --disable-static
- $(vopt_enable gir introspection) $(vopt_enable cdparanoia) $(vopt_enable sndio)"
-hostmakedepends="automake gettext-devel libtool python pkg-config
- glib-devel"
+configure_args="-Dtremor=disabled -Dexamples=disabled -Dgtk_doc=disabled
+ -Dcdparanoia=$(vopt_if cdparanoia enabled disabled)
+ -Dintrospection=$(vopt_if gir enabled disabled)
+ -Dsndio=$(vopt_if sndio enabled disabled)"
+hostmakedepends="gettext-devel pkg-config glib-devel orc"
 makedepends="gstreamer1-devel glib-devel libxml2-devel pango-devel
  cairo-devel liboil-devel alsa-lib-devel libXv-devel libXext-devel
  libvisual-devel libgudev-devel libtheora-devel libvorbis-devel
  libSM-devel orc-devel $(vopt_if cdparanoia libcdparanoia-devel)
- opus-devel MesaLib-devel $(vopt_if sndio sndio-devel)"
+ opus-devel MesaLib-devel $(vopt_if sndio sndio-devel) graphene-devel"
 depends="orc>=0.4.18 gstreamer1>=${version}"
 short_desc="GStreamer Base Plug-ins (v1.x)"
 maintainer="Juan RP <xtraeme@voidlinux.org>"
 license="GPL-2.0-or-later, LGPL-2.0-or-later"
 homepage="https://gstreamer.freedesktop.org"
 distfiles="${homepage}/src/${pkgname/1/}/${pkgname/1/}-${version}.tar.xz"
-checksum=7bfa9b329ea7f3c654fa1b2d43650bf2646598a5e3cb21f42c516b7e975d638e
+checksum=4093aa7b51e28fb24dfd603893fead8d1b7782f088b05ed0f22a21ef176fb5ae
 
 case "$XBPS_TARGET_MACHINE" in
 	i686*) CFLAGS="-O2 -msse2";;
@@ -30,16 +31,6 @@ esac
 build_options="cdparanoia gir sndio"
 build_options_default="cdparanoia gir sndio"
 
-pre_configure() {
-	NOCONFIGURE=1 ./autogen.sh
-}
-
-pre_build() {
-	vsed \
-		-e '/--library/a --library-path="$(top_builddir)/gst-libs/gst/sdp/.libs" \\' \
-		-i gst-libs/gst/rtsp/Makefile
-}
-
 gst-plugins-base1-devel_package() {
 	depends="gstreamer1-devel>=${version} ${sourcepkg}>=${version}_${revision} orc-devel"
 	short_desc+=" - development files"
@@ -47,7 +38,6 @@ gst-plugins-base1-devel_package() {
 		vmove usr/include
 		vmove usr/lib/pkgconfig
 		vmove "usr/lib/*.so"
-		vmove usr/share/gtk-doc
 		if [ "$build_option_gir" ]; then
 			vmove "usr/share/gir*"
 		fi

From 0d07dbcf88522a4d70955d536ffd2a5134ff0cda Mon Sep 17 00:00:00 2001
From: Helmut Pozimski <helmut@pozimski.eu>
Date: Sun, 9 Jun 2019 11:27:51 +0200
Subject: [PATCH 3/4] gst-plugins-good1: update to 1.16.0.

---
 srcpkgs/gst-plugins-good1/template | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/gst-plugins-good1/template b/srcpkgs/gst-plugins-good1/template
index 435febbcbeb..f4d640ef740 100644
--- a/srcpkgs/gst-plugins-good1/template
+++ b/srcpkgs/gst-plugins-good1/template
@@ -1,29 +1,28 @@
 # Template file for 'gst-plugins-good1'
 pkgname=gst-plugins-good1
-version=1.14.5
+version=1.16.0
 revision=1
 wrksrc="${pkgname/1/}-${version}"
 lib32disabled=yes
-build_style=gnu-configure
-configure_args="--with-gudev --with-libv4l2 --enable-experimental
- --enable-libcaca --disable-libdv --disable-dv1394 --disable-shout2
- --enable-aalib --enable-speex"
+build_style=meson
+configure_args="-Ddv=disabled -Ddv1394=disabled -Dshout2=disabled"
 # XXX: libdv, dv1394 and shout2 modules.
-hostmakedepends="pkg-config intltool python glib-devel"
+hostmakedepends="pkg-config intltool glib-devel qt5-qmake orc qt5-host-tools"
 makedepends="
  libpng-devel libxml2-devel libgudev-devel libflac-devel
  libXdamage-devel aalib-devel libcaca-devel
  taglib-devel libsoup-gnome-devel gst-plugins-base1-devel
  pulseaudio-devel orc-devel libXv-devel wavpack-devel
  v4l-utils-devel jack-devel speex-devel libvpx-devel lame-devel
- mpg123-devel twolame-devel $(vopt_if gtk3 gtk+3-devel)"
+ mpg123-devel twolame-devel $(vopt_if gtk3 gtk+3-devel) qt5-devel
+ qt5-declarative-devel  qt5-x11extras-devel qt5-wayland-devel"
 depends="gst-plugins-base1>=${version}"
 short_desc="GStreamer set of well-maintained good plug-ins (1.x)"
 maintainer="Juan RP <xtraeme@voidlinux.org>"
 license="LGPL-2.1-or-later"
 homepage="https://gstreamer.freedesktop.org"
 distfiles="${homepage}/src/${pkgname/1/}/${pkgname/1/}-${version}.tar.xz"
-checksum=678221b3f0208b31b90df3ffa509857cc8bfc337f3f5073d195c5b365d616503
+checksum=654adef33380d604112f702c2927574cfc285e31307b79e584113858838bb0fd
 
 build_options="gtk3"
 build_options_default="gtk3"

From a872220000913af42b98a579ebf7ec4314a944c1 Mon Sep 17 00:00:00 2001
From: Helmut Pozimski <helmut@pozimski.eu>
Date: Sun, 9 Jun 2019 12:38:58 +0200
Subject: [PATCH 4/4] gst-plugins-ugly1: update to 1.16.0.

---
 srcpkgs/gst-plugins-ugly1/template | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/gst-plugins-ugly1/template b/srcpkgs/gst-plugins-ugly1/template
index f6c4e316435..8af690d6240 100644
--- a/srcpkgs/gst-plugins-ugly1/template
+++ b/srcpkgs/gst-plugins-ugly1/template
@@ -1,11 +1,11 @@
 # Template file for 'gst-plugins-ugly1'.
 pkgname=gst-plugins-ugly1
-version=1.14.5
+version=1.16.0
 revision=1
 lib32disabled=yes
 wrksrc="${pkgname/1/}-${version}"
-build_style=gnu-configure
-configure_args="--enable-experimental"
+build_style=meson
+configure_args="-Damrnb=disabled -Damrwbdec=disabled -Dsidplay=disabled"
 # XXX add required pkgs for the amr, sid plugins.
 hostmakedepends="pkg-config intltool python"
 makedepends="glib-devel libxml2-devel gst-plugins-base1-devel
@@ -17,4 +17,4 @@ maintainer="Juan RP <xtraeme@voidlinux.org>"
 license="LGPL-2.1-or-later"
 homepage="https://gstreamer.freedesktop.org"
 distfiles="${homepage}/src/${pkgname/1/}/${pkgname/1/}-${version}.tar.xz"
-checksum=3ed802727286f18a9331cfed6ee85d07744d87cf868baae976615441f4bee04b
+checksum=e30964c5f031c32289e0b25e176c3c95a5737f2052dfc81d0f7427ef0233a4c2
