pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

sndio: few changes



Module Name:	pkgsrc-wip
Committed By:	Paolo Vincenzo Olivo <vms%retrobsd.ddns.net@localhost>
Pushed By:	vms
Date:		Sat Nov 15 17:00:49 2025 +0100
Changeset:	5107ef1a7ee088abaddca4b85f7c0753290db4a1

Modified Files:
	sndio/Makefile
	sndio/distinfo
	sndio/patches/patch-configure
Added Files:
	sndio/patches/patch-libsndio_sio__oss.c

Log Message:
sndio: few changes

* Enable OSS backend on NetBSD.
* Use bmake.

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=5107ef1a7ee088abaddca4b85f7c0753290db4a1

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 sndio/Makefile                          | 26 ++++++++++++++++----------
 sndio/distinfo                          |  3 ++-
 sndio/patches/patch-configure           | 30 ++++++++++++++++++++++++------
 sndio/patches/patch-libsndio_sio__oss.c | 33 +++++++++++++++++++++++++++++++++
 4 files changed, 75 insertions(+), 17 deletions(-)

diffs:
diff --git a/sndio/Makefile b/sndio/Makefile
index ecd544eda8..bba80e0ec1 100644
--- a/sndio/Makefile
+++ b/sndio/Makefile
@@ -11,22 +11,28 @@ LICENSE=	isc
 
 HAS_CONFIGURE=	yes
 
-USE_TOOLS+=	gmake
+RCD_SCRIPTS=	sndio
 
-CONFIGURE_ARGS+=	--prefix=${PREFIX}
-CONFIGURE_ARGS+=	--mandir=${PREFIX}/${PKGMANDIR}
+PKG_USERS=		_sndio:_sndio
+PKG_GROUPS=		_sndio
+PKG_GECOS._sndio=	Sndio user
+PKG_SHELL._sndio=	${NOLOGIN}
+PKG_HOME._sndio=	/nonexistent
 
 PKGCONFIG_OVERRIDE=		libsndio/sndio.pc
 PKGCONFIG_OVERRIDE_STAGE=	post-configure
 
-RCD_SCRIPTS=	sndio
+SUBST_CLASSES+=		oss
+SUBST_STAGE.oss=	pre-configure
+SUBST_MESSAGE.oss=	Point to the correct OSS device.
+SUBST_FILES.oss+=	libsndio/sio_oss.c
+SUBST_SED.oss+=		-e "s,/dev/dsp,${DEVOSSAUDIO},g"
 
-SNDIO_USER=	_sndio
-SNDIO_GROUP=	_sndio
-
-PKG_USERS=			${SNDIO_USER}:${SNDIO_GROUP}
-PKG_GROUPS=			${SNDIO_GROUP}
-PKG_GECOS.${SNDIO_USER}=	Sndio user
+CONFIGURE_ARGS+=	--prefix=${PREFIX}
+CONFIGURE_ARGS+=	--mandir=${PREFIX}/${PKGMANDIR}
+CONFIGURE_ARGS+=	--pkgconfdir=${PREFIX}/lib/pkgconfig
 
+BUILD_DIRS+=		libsndio sndiod sndioctl aucat midicat
 
+.include "../../mk/oss.buildlink3.mk"
 .include "../../mk/bsd.pkg.mk"
diff --git a/sndio/distinfo b/sndio/distinfo
index 7fa703663e..5d8fbdc7d0 100644
--- a/sndio/distinfo
+++ b/sndio/distinfo
@@ -3,4 +3,5 @@ $NetBSD$
 BLAKE2s (sndio-1.10.0.tar.gz) = 39f92241015c931433dad456ee5ca965806c5b86e97950265d8a609ac38525a3
 SHA512 (sndio-1.10.0.tar.gz) = c35462976a1bffd128eacb185165964dac6b03505255e9ab9a933e24be5ed146cd9ac6995fd7af23247cb9133c010cce0876572db53b783ebabeb563fec7a1cf
 Size (sndio-1.10.0.tar.gz) = 162725 bytes
-SHA1 (patch-configure) = ff542abad38ec4148478196abdd04a559840d98f
+SHA1 (patch-configure) = f0d2dadffe8ce50a38a4fe8305c3b776fbbd7aa6
+SHA1 (patch-libsndio_sio__oss.c) = 67d867de6dabe4b4b1beed0ef87652ca854dbc42
diff --git a/sndio/patches/patch-configure b/sndio/patches/patch-configure
index 875fcb3502..0cc668fb48 100644
--- a/sndio/patches/patch-configure
+++ b/sndio/patches/patch-configure
@@ -1,19 +1,37 @@
 $NetBSD$
 
-Create libsndio.so.${MAJ} on non-Linux platforms.
+* Create libsndio.so.${MAJ} on non-Linux platforms.
+* Enable OSS backend on NetBSD. 
 
 --- configure.orig	2024-08-01 15:36:54.000000000 +0000
 +++ configure
-@@ -97,7 +97,7 @@ case `uname` in
+@@ -71,7 +71,7 @@ case `uname` in
+ 		alsa=yes
+ 		ldadd="-lrt -lm"
+ 		user=sndiod
+-		so_link="libsndio.so libsndio.so.\${MAJ} libsndio.so.\${MAJ}.0"
++		so_link="libsndio.so libsndio.so.\${MAJ}"
+ 		so_ldflags="-Wl,-soname=libsndio.so.\${MAJ}"
+ 		defs='-D_GNU_SOURCE -DHAVE_SOCK_CLOEXEC -DHAVE_CLOCK_GETTIME'
+ 		;;
+@@ -95,17 +95,21 @@ case `uname` in
+ 		;;
+ 	NetBSD)
  		sun=no
++		oss=yes
++		ldadd="-lossaudio -lm"
  		rmidi=yes
  		user=_sndio
 -		so_link="libsndio.so"
++		so_ldflags="-Wl,-soname=libsndio.so.\${MAJ}"
 +		so_link="libsndio.so libsndio.so.\${MAJ}"
  		defs='-DHAVE_ARC4RANDOM -DHAVE_GETPEEREID -DHAVE_ISSETUGID \\\
- 		-DHAVE_STRLCAT -DHAVE_STRLCPY \\\
- 		-DHAVE_SOCK_CLOEXEC -DHAVE_CLOCK_GETTIME'
-@@ -106,6 +106,7 @@ case `uname` in
+-		-DHAVE_STRLCAT -DHAVE_STRLCPY \\\
+-		-DHAVE_SOCK_CLOEXEC -DHAVE_CLOCK_GETTIME'
++		-D_OPENBSD_SOURCE -DHAVE_STRLCAT -DHAVE_STRLCPY \\\
++		-DHAVE_STRTONUM -DHAVE_SOCK_CLOEXEC -DHAVE_CLOCK_GETTIME'
+ 		;;
+ 	OpenBSD)
  		sun=yes
  		rmidi=yes
  		user=_sndiop
@@ -21,7 +39,7 @@ Create libsndio.so.${MAJ} on non-Linux platforms.
  		defs='-DHAVE_ARC4RANDOM -DHAVE_GETPEEREID -DHAVE_ISSETUGID \\\
  		-DHAVE_STRLCAT -DHAVE_STRLCPY -DHAVE_STRTONUM \\\
  		-DHAVE_SOCK_CLOEXEC -DHAVE_CLOCK_GETTIME'
-@@ -115,7 +116,7 @@ case `uname` in
+@@ -115,7 +119,7 @@ case `uname` in
  		umidi=yes
  		user=_sndio
  		so_ldflags="-Wl,-soname=libsndio.so.\${MAJ}.\${MIN}"
diff --git a/sndio/patches/patch-libsndio_sio__oss.c b/sndio/patches/patch-libsndio_sio__oss.c
new file mode 100644
index 0000000000..d22dbc67c3
--- /dev/null
+++ b/sndio/patches/patch-libsndio_sio__oss.c
@@ -0,0 +1,33 @@
+$NetBSD$
+
+Add missing bits for ossaudio(3) on NetBSD.
+
+--- libsndio/sio_oss.c.orig	2025-11-15 14:07:59.501355746 +0000
++++ libsndio/sio_oss.c
+@@ -37,6 +37,26 @@
+ 	sizeof(DEVPATH_PREFIX) - 1 +	\
+ 	sizeof(int) * 3)
+ 
++#ifndef SNDCTL_DSP_LOW_WATER	/* Low water level control */
++#define SNDCTL_DSP_LOW_WATER	_IOW ('P', 34, int)
++#endif
++
++/*
++ * Additional OSS formats definitions.
++ */
++#ifndef AFMT_U32_LE
++#define AFMT_U32_LE 0x00004000	/* Little endian unsigned 32-bit */
++#endif
++#ifndef AFMT_U32_BE
++#define AFMT_U32_BE 0x00008000	/* Big endian unsigned 32-bit */
++#endif
++#ifndef AFMT_U24_LE
++#define AFMT_U24_LE 0x00040000	/* Little endian unsigned 24-bit */
++#endif
++#ifndef AFMT_U24_BE
++#define AFMT_U24_BE 0x00080000	/* Big endian unsigned 24-bit */
++#endif
++
+ struct sio_oss_fmt {
+ 	int fmt;
+ 	unsigned int bits;


Home | Main Index | Thread Index | Old Index