git: 7fac7b6b62bb - main - audio/gstreamer1-plugins-alsa: Add port

From: Jason E. Hale <jhale_at_FreeBSD.org>
Date: Sun, 22 Dec 2024 06:53:36 UTC
The branch main has been updated by jhale:

URL: https://cgit.FreeBSD.org/ports/commit/?id=7fac7b6b62bb55df32a6bdad4eab3374ff298fc5

commit 7fac7b6b62bb55df32a6bdad4eab3374ff298fc5
Author:     Jason E. Hale <jhale@FreeBSD.org>
AuthorDate: 2024-12-22 05:47:12 +0000
Commit:     Jason E. Hale <jhale@FreeBSD.org>
CommitDate: 2024-12-22 06:47:24 +0000

    audio/gstreamer1-plugins-alsa: Add port
    
    GStreamer ALSA plugin.
    
    If multimedia/qt6-multimedia is built with both the GSTREAMER and ALSA
    options enabled, certain applications like multimedia/mkvtoolnix may
    crash if this plugin is not installed.
    
    PR:             282078
---
 Mk/Uses/gstreamer.mk                                     |  5 ++++-
 audio/Makefile                                           |  1 +
 audio/gstreamer1-plugins-alsa/Makefile                   | 16 ++++++++++++++++
 audio/gstreamer1-plugins-alsa/pkg-plist                  |  1 +
 .../gstreamer1-plugins/files/patch-ext_alsa_meson.build  | 13 +++++++++++++
 5 files changed, 35 insertions(+), 1 deletion(-)

diff --git a/Mk/Uses/gstreamer.mk b/Mk/Uses/gstreamer.mk
index ff2851b60357..e4ec45219cca 100644
--- a/Mk/Uses/gstreamer.mk
+++ b/Mk/Uses/gstreamer.mk
@@ -54,7 +54,7 @@ _GST1_SOVERSION=	0.${_GST1_VERSION:R:E}${${_GST1_VERSION:E} > 9:?:0}${_GST1_VERS
 
 _GST1_CATEGORIES=	audio comms devel ftp graphics multimedia net security \
 			sysutils textproc www x11 x11-toolkits
-_GST1_PLUGINS_audio= 	a52dec amrnb amrwbdec bs2b cdparanoia chromaprint faac \
+_GST1_PLUGINS_audio= 	a52dec alsa amrnb amrwbdec bs2b cdparanoia chromaprint faac \
 			faad flac flite gme gsm jack ladspa lame lv2 modplug \
 			mpg123 ogg openmpt opus pulse shout2 sidplay \
 			sndfile sndio soundtouch speex taglib twolame vorbis \
@@ -121,6 +121,9 @@ gst-libgstreamer_PORT=	multimedia/gstreamer${_GST_VER}
 gst-a52dec_PORT=	audio/gstreamer${_GST_VER}-plugins-a52dec
 gst-a52dec_IMPL=	ugly
 
+gst-alsa_PORT=		audio/gstreamer${_GST_VER}-plugins-alsa
+gst-alsa_IMPL=		#
+
 gst-amrnb_PORT=		audio/gstreamer${_GST_VER}-plugins-amrnb
 gst-amrnb_IMPL=		ugly
 
diff --git a/audio/Makefile b/audio/Makefile
index a48ed8ce5750..76521d42179a 100644
--- a/audio/Makefile
+++ b/audio/Makefile
@@ -226,6 +226,7 @@
     SUBDIR += gsm
     SUBDIR += gsound
     SUBDIR += gstreamer1-plugins-a52dec
+    SUBDIR += gstreamer1-plugins-alsa
     SUBDIR += gstreamer1-plugins-amrnb
     SUBDIR += gstreamer1-plugins-amrwbdec
     SUBDIR += gstreamer1-plugins-bs2b
diff --git a/audio/gstreamer1-plugins-alsa/Makefile b/audio/gstreamer1-plugins-alsa/Makefile
new file mode 100644
index 000000000000..cfee1c89cbdf
--- /dev/null
+++ b/audio/gstreamer1-plugins-alsa/Makefile
@@ -0,0 +1,16 @@
+PORTREVISION=	0
+CATEGORIES=	audio
+
+COMMENT=	GStreamer ALSA plugin
+
+LIB_DEPENDS=	libasound.so:audio/alsa-lib
+RUN_DEPENDS=	alsa-plugins>=0:audio/alsa-plugins
+
+MASTERDIR=	${.CURDIR:H:H}/multimedia/gstreamer1-plugins
+
+PLIST=		${.CURDIR}/pkg-plist
+
+DIST=		base
+GST_PLUGIN=	alsa
+
+.include "${MASTERDIR}/Makefile"
diff --git a/audio/gstreamer1-plugins-alsa/pkg-plist b/audio/gstreamer1-plugins-alsa/pkg-plist
new file mode 100644
index 000000000000..e61312b54550
--- /dev/null
+++ b/audio/gstreamer1-plugins-alsa/pkg-plist
@@ -0,0 +1 @@
+lib/gstreamer-%%VERSION%%/libgstalsa.so
diff --git a/multimedia/gstreamer1-plugins/files/patch-ext_alsa_meson.build b/multimedia/gstreamer1-plugins/files/patch-ext_alsa_meson.build
new file mode 100644
index 000000000000..c252092b788a
--- /dev/null
+++ b/multimedia/gstreamer1-plugins/files/patch-ext_alsa_meson.build
@@ -0,0 +1,13 @@
+--- ext/alsa/meson.build.orig	2024-12-03 23:29:07 UTC
++++ ext/alsa/meson.build
+@@ -15,7 +15,9 @@ if alsa_dep.found()
+     alsa_sources,
+     c_args : gst_plugins_base_args,
+     include_directories: [configinc, libsinc],
+-    dependencies : [alsa_dep, audio_dep, tag_dep, gst_dep, gst_base_dep],
++    dependencies : [alsa_dep, dependency('gstreamer-audio-1.0'),
++      dependency('gstreamer-audio-1.0'), dependency('gstreamer-tag-1.0'),
++      gst_dep, gst_base_dep],
+     install : true,
+     install_dir : plugins_install_dir,
+   )