git: 981929d361d7 - main - audio/pulseaudio-module-sndio: Fix an error on loading

From: Nicola Vitale <nivit_at_FreeBSD.org>
Date: Thu, 29 Aug 2024 13:00:22 UTC
The branch main has been updated by nivit:

URL: https://cgit.FreeBSD.org/ports/commit/?id=981929d361d7811d3d21205d5d4da213acc58d8a

commit 981929d361d7811d3d21205d5d4da213acc58d8a
Author:     Nicola Vitale <nivit@FreeBSD.org>
AuthorDate: 2024-08-29 12:40:00 +0000
Commit:     Nicola Vitale <nivit@FreeBSD.org>
CommitDate: 2024-08-29 12:59:05 +0000

    audio/pulseaudio-module-sndio: Fix an error on loading
    
    - Enabling this module in LOCALBASE/etc/pulse/default.pa.d/* pulseaudio
      prints this error on loading:
    
    Aug 29 14:33:26 ***** pulseaudio[3024]: [] module.c: Module "module-sndio" version (0.0) doesn't match the expected version (16.1).
    
      This patch fix the module version making it the same as pulseaudio's.
      The latter is retrieved via pkg-config.
    
    - Pet portclippy
    - Bump PORTREVISION
---
 audio/pulseaudio-module-sndio/Makefile | 22 ++++++++++++++++------
 1 file changed, 16 insertions(+), 6 deletions(-)

diff --git a/audio/pulseaudio-module-sndio/Makefile b/audio/pulseaudio-module-sndio/Makefile
index 4cbea17b62a0..a904bfa5a2a3 100644
--- a/audio/pulseaudio-module-sndio/Makefile
+++ b/audio/pulseaudio-module-sndio/Makefile
@@ -1,6 +1,6 @@
 PORTNAME=	pulseaudio-module-sndio
 DISTVERSION=	13.0
-PORTREVISION=	4
+PORTREVISION=	5
 CATEGORIES=	audio
 MASTER_SITES=	https://github.com/t6/pulseaudio-module-sndio/releases/download/${DISTVERSION}/
 
@@ -11,12 +11,22 @@ WWW=		https://github.com/t6/pulseaudio-module-sndio
 LICENSE=	ISCL LGPL21+
 LICENSE_COMB=	multi
 
-LIB_DEPENDS=	libsndio.so:audio/sndio \
-		libpulse.so:audio/pulseaudio
+LIB_DEPENDS=	libpulse.so:audio/pulseaudio \
+		libsndio.so:audio/sndio
 
 USES=		pkgconfig
-PULSE_MODDIR=	`pkg-config --variable=modlibexecdir libpulse`
-PLIST_FILES=	${PULSE_MODDIR}/module-sndio.so
+
 SUB_FILES=	pkg-message
+PLIST_FILES=	${PULSE_MODDIR}/module-sndio.so
+
+post-patch:
+	${REINPLACE_CMD} \
+		-e '/^PA_MODULE_VERSION/s/0.0/${PULSE_VERSION}/1' \
+		${WRKSRC}/module-sndio.c
+
+.include <bsd.port.pre.mk>
+
+PULSE_MODDIR!=	${LOCALBASE}/bin/pkg-config --variable=modlibexecdir libpulse
+PULSE_VERSION!=	${LOCALBASE}/bin/pkg-config --modversion libpulse
 
-.include <bsd.port.mk>
+.include <bsd.port.post.mk>