git: a9bbba1949a7 - main - audio/virtual_oss_sndio: New port

From: Christos Margiolis <christos_at_FreeBSD.org>
Date: Tue, 30 Sep 2025 15:40:01 UTC
The branch main has been updated by christos:

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

commit a9bbba1949a79c419d88e64a280e56c0cc8131fc
Author:     Christos Margiolis <christos@FreeBSD.org>
AuthorDate: 2025-09-30 15:39:15 +0000
Commit:     Christos Margiolis <christos@FreeBSD.org>
CommitDate: 2025-09-30 15:39:15 +0000

    audio/virtual_oss_sndio: New port
    
    Although src commit 9cab9fde5eda ("virtual_oss: Port to base") includes
    the sndio backend, we do not hook it to the src build, because it
    depends on the third party library libsndio, so we build it as a port
    instead.
    
    The port simply builds the files from src, which is not ideal, as this
    means that the src repo needs to be present in the system in order for
    the port to build, but this way we can avoid version mismatches and
    ifdef hell as the project progresses.
    
    Note that this is an extension for the base system virtual_oss, and not
    audio/virtual_oss.
    
    Sponsored by:   The FreeBSD Foundation
    Reviewed by:    arrowd
    Differential Revision:  https://reviews.freebsd.org/D52365
---
 audio/Makefile                    |  1 +
 audio/virtual_oss_sndio/Makefile  | 33 +++++++++++++++++++++++++++++++++
 audio/virtual_oss_sndio/pkg-descr |  5 +++++
 3 files changed, 39 insertions(+)

diff --git a/audio/Makefile b/audio/Makefile
index 5255e7df4991..9604b781dda8 100644
--- a/audio/Makefile
+++ b/audio/Makefile
@@ -833,6 +833,7 @@
     SUBDIR += vimpc
     SUBDIR += virtual_oss
     SUBDIR += virtual_oss_ctl
+    SUBDIR += virtual_oss_sndio
     SUBDIR += visp-go
     SUBDIR += vitunes
     SUBDIR += vm-lv2
diff --git a/audio/virtual_oss_sndio/Makefile b/audio/virtual_oss_sndio/Makefile
new file mode 100644
index 000000000000..d6e0524d9e68
--- /dev/null
+++ b/audio/virtual_oss_sndio/Makefile
@@ -0,0 +1,33 @@
+PORTNAME=	virtual_oss_sndio
+DISTVERSION=	${OSVERSION}
+CATEGORIES=	audio
+DISTFILES=
+
+MAINTAINER=	christos@FreeBSD.org
+COMMENT=	virtual_oss sndio backend
+WWW=		https://freebsd.org
+
+LICENSE=	BSD2CLAUSE
+
+LIB_DEPENDS=	libsndio.so:audio/sndio
+
+USES=		pathfix uidfix
+USE_LDCONFIG=	yes
+
+MAKE_ENV=	LIBDIR=${PREFIX}/lib \
+		MAKEOBJDIRPREFIX=${WRKDIR}
+
+WRKSRC=		${SRC_BASE}/lib/virtual_oss/sndio
+
+PLIST_FILES=	lib/virtual_oss/voss_sndio.so
+
+pre-install:
+	${MKDIR} ${STAGEDIR}${PREFIX}/lib/virtual_oss
+
+.include <bsd.port.pre.mk>
+
+.if !exists(${WRKSRC})
+IGNORE=		requires FreeBSD source files in ${SRC_BASE}
+.endif
+
+.include <bsd.port.post.mk>
diff --git a/audio/virtual_oss_sndio/pkg-descr b/audio/virtual_oss_sndio/pkg-descr
new file mode 100644
index 000000000000..9ebfc484831e
--- /dev/null
+++ b/audio/virtual_oss_sndio/pkg-descr
@@ -0,0 +1,5 @@
+sndio backend for virtual_oss.
+
+This is an extension for the base system version of virtual_oss. It provides
+sndio support and gets loaded dynamically only when a virtual_oss(8) invocation
+uses an sndio device.