pkgsrc-Changes archive

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

CVS commit: pkgsrc/audio/sndio



Module Name:    pkgsrc
Committed By:   vins
Date:           Sat Nov 15 21:38:43 UTC 2025

Added Files:
        pkgsrc/audio/sndio: DESCR Makefile PLIST buildlink3.mk distinfo
        pkgsrc/audio/sndio/files: sndio.sh
        pkgsrc/audio/sndio/patches: patch-configure patch-libsndio_sio__oss.c

Log Message:
audio/sndio: initial import of package

Import sndio-1.0.1 from wip.
Initially ported to NetBSD by Kamil Rytarowski.
Maintained by @kikadf in wip in more recent years,
with minor modifications added by @vins.

Sndio is a small audio and MIDI framework part of the OpenBSD project. It
provides an lightweight audio & MIDI server and a fully documented user-space
API to access either the server or directly the hardware in a uniform way.
Sndio is designed to work for desktop applications, but pays special attention
to synchronization mechanisms and reliability required by music applications.
Reliability through simplicity are part of the project goals.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 pkgsrc/audio/sndio/DESCR pkgsrc/audio/sndio/Makefile \
    pkgsrc/audio/sndio/PLIST pkgsrc/audio/sndio/buildlink3.mk \
    pkgsrc/audio/sndio/distinfo
cvs rdiff -u -r0 -r1.1 pkgsrc/audio/sndio/files/sndio.sh
cvs rdiff -u -r0 -r1.1 pkgsrc/audio/sndio/patches/patch-configure \
    pkgsrc/audio/sndio/patches/patch-libsndio_sio__oss.c

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

Added files:

Index: pkgsrc/audio/sndio/DESCR
diff -u /dev/null pkgsrc/audio/sndio/DESCR:1.1
--- /dev/null   Sat Nov 15 21:38:43 2025
+++ pkgsrc/audio/sndio/DESCR    Sat Nov 15 21:38:42 2025
@@ -0,0 +1,6 @@
+Sndio is a small audio and MIDI framework part of the OpenBSD project. It
+provides an lightweight audio & MIDI server and a fully documented user-space
+API to access either the server or directly the hardware in a uniform way.
+Sndio is designed to work for desktop applications, but pays special attention
+to synchronization mechanisms and reliability required by music applications.
+Reliability through simplicity are part of the project goals.
Index: pkgsrc/audio/sndio/Makefile
diff -u /dev/null pkgsrc/audio/sndio/Makefile:1.1
--- /dev/null   Sat Nov 15 21:38:43 2025
+++ pkgsrc/audio/sndio/Makefile Sat Nov 15 21:38:42 2025
@@ -0,0 +1,50 @@
+# $NetBSD: Makefile,v 1.1 2025/11/15 21:38:42 vins Exp $
+
+DISTNAME=      sndio-1.10.0
+CATEGORIES=    audio
+MASTER_SITES=  http://www.sndio.org/
+
+MAINTAINER=    pkgsrc-users%NetBSD.org@localhost
+HOMEPAGE=      http://www.sndio.org/
+COMMENT=       Small audio and MIDI framework
+LICENSE=       isc
+
+HAS_CONFIGURE= yes
+
+BUILD_DEFS+=   VARBASE
+SNDIO_HOME=    ${VARBASE}/run/sndio
+
+DEPENDS+=      daemonize-[0-9]*:../../sysutils/daemonize
+
+RCD_SCRIPTS=   sndio
+
+PKG_USERS=             _sndio:_sndio
+PKG_GROUPS=            _sndio
+PKG_GECOS._sndio=      sndio user
+PKG_SHELL._sndio=      ${NOLOGIN}
+PKG_HOME._sndio=       ${SNDIO_HOME}
+
+PKGCONFIG_OVERRIDE=            libsndio/sndio.pc
+PKGCONFIG_OVERRIDE_STAGE=      post-configure
+
+CONFIGURE_ARGS+=       --prefix=${PREFIX} \
+                       --mandir=${PREFIX}/${PKGMANDIR} \
+                       --pkgconfdir=${PREFIX}/lib/pkgconfig
+
+.include "../../mk/bsd.prefs.mk"
+
+.if ${OPSYS:M*BSD}
+.  include "../../mk/oss.buildlink3.mk"
+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"
+.elif ${OPSYS} == "Linux"
+.  include "../../devel/libbsd/buildlink3.mk"
+.  include "../../audio/alsa-lib/buildlink3.mk"
+.endif
+
+BUILD_DIRS+=           libsndio sndiod sndioctl aucat midicat
+
+.include "../../mk/bsd.pkg.mk"
Index: pkgsrc/audio/sndio/PLIST
diff -u /dev/null pkgsrc/audio/sndio/PLIST:1.1
--- /dev/null   Sat Nov 15 21:38:43 2025
+++ pkgsrc/audio/sndio/PLIST    Sat Nov 15 21:38:42 2025
@@ -0,0 +1,49 @@
+@comment $NetBSD: PLIST,v 1.1 2025/11/15 21:38:42 vins Exp $
+bin/aucat
+bin/midicat
+bin/sndioctl
+bin/sndiod
+include/sndio.h
+lib/libsndio.so
+lib/libsndio.so.7
+lib/libsndio.so.7.3
+lib/pkgconfig/sndio.pc
+man/man1/aucat.1
+man/man1/midicat.1
+man/man1/sndioctl.1
+man/man3/mio_close.3
+man/man3/mio_eof.3
+man/man3/mio_nfds.3
+man/man3/mio_open.3
+man/man3/mio_pollfd.3
+man/man3/mio_read.3
+man/man3/mio_revents.3
+man/man3/mio_write.3
+man/man3/sio_close.3
+man/man3/sio_eof.3
+man/man3/sio_getcap.3
+man/man3/sio_getpar.3
+man/man3/sio_initpar.3
+man/man3/sio_nfds.3
+man/man3/sio_onmove.3
+man/man3/sio_onvol.3
+man/man3/sio_open.3
+man/man3/sio_pollfd.3
+man/man3/sio_read.3
+man/man3/sio_revents.3
+man/man3/sio_setpar.3
+man/man3/sio_setvol.3
+man/man3/sio_start.3
+man/man3/sio_stop.3
+man/man3/sio_write.3
+man/man3/sioctl_close.3
+man/man3/sioctl_eof.3
+man/man3/sioctl_nfds.3
+man/man3/sioctl_ondesc.3
+man/man3/sioctl_onval.3
+man/man3/sioctl_open.3
+man/man3/sioctl_pollfd.3
+man/man3/sioctl_revents.3
+man/man3/sioctl_setval.3
+man/man7/sndio.7
+man/man8/sndiod.8
Index: pkgsrc/audio/sndio/buildlink3.mk
diff -u /dev/null pkgsrc/audio/sndio/buildlink3.mk:1.1
--- /dev/null   Sat Nov 15 21:38:43 2025
+++ pkgsrc/audio/sndio/buildlink3.mk    Sat Nov 15 21:38:42 2025
@@ -0,0 +1,12 @@
+# $NetBSD: buildlink3.mk,v 1.1 2025/11/15 21:38:42 vins Exp $
+
+BUILDLINK_TREE+=       sndio
+
+.if !defined(SNDIO_BUILDLINK3_MK)
+SNDIO_BUILDLINK3_MK:=
+
+BUILDLINK_API_DEPENDS.sndio+=  sndio>=1.10.0
+BUILDLINK_PKGSRCDIR.sndio?=    ../../audio/sndio
+.endif # SNDIO_BUILDLINK3_MK
+
+BUILDLINK_TREE+=       -sndio
Index: pkgsrc/audio/sndio/distinfo
diff -u /dev/null pkgsrc/audio/sndio/distinfo:1.1
--- /dev/null   Sat Nov 15 21:38:43 2025
+++ pkgsrc/audio/sndio/distinfo Sat Nov 15 21:38:42 2025
@@ -0,0 +1,7 @@
+$NetBSD: distinfo,v 1.1 2025/11/15 21:38:42 vins Exp $
+
+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) = d1c1833fbcf925cbb31de04c3480757b83fb1aea
+SHA1 (patch-libsndio_sio__oss.c) = ca220153f77b65659b490ef26bfbb2efaab67d74

Index: pkgsrc/audio/sndio/files/sndio.sh
diff -u /dev/null pkgsrc/audio/sndio/files/sndio.sh:1.1
--- /dev/null   Sat Nov 15 21:38:43 2025
+++ pkgsrc/audio/sndio/files/sndio.sh   Sat Nov 15 21:38:42 2025
@@ -0,0 +1,43 @@
+#!@RCD_SCRIPTS_SHELL@
+#
+# $NetBSD: sndio.sh,v 1.1 2025/11/15 21:38:42 vins Exp $
+#
+# PROVIDE: sndio
+# REQUIRE: DAEMON
+# KEYWORD: shutdown
+
+. /etc/rc.subr
+
+name="sndio"
+rcvar=${name}
+command="@PREFIX@/bin/sndiod"
+command_args="-dd"
+pidfile="@VARBASE@/run/sndio/pid"
+logfile="@VARBASE@/run/sndio/log"
+start_precmd=sndio_prestart
+start_cmd=sndio_start
+stop_cmd=":"
+
+sndio_prestart() {
+       dir="@VARBASE@/run/sndio"
+       if [ ! -d "$dir" ]; then
+               @MKDIR@ -p $dir
+               @CHMOD@ 0755 $dir
+               @CHOWN@ _sndio:_sndio $dir
+       fi
+}
+
+sndio_start()
+{
+       echo "Starting sndio server"
+       daemonize="@PREFIX@/sbin/daemonize"
+       if [ -x "$daemonize" ]; then
+               $daemonize -p ${pidfile} -e ${logfile} \
+                       ${command} ${command_args} ${sndio_flags}
+       else
+               ${command} ${command_args} ${sndio_flags}
+       fi
+}
+
+load_rc_config ${name}
+run_rc_command "$1"

Index: pkgsrc/audio/sndio/patches/patch-configure
diff -u /dev/null pkgsrc/audio/sndio/patches/patch-configure:1.1
--- /dev/null   Sat Nov 15 21:38:43 2025
+++ pkgsrc/audio/sndio/patches/patch-configure  Sat Nov 15 21:38:43 2025
@@ -0,0 +1,56 @@
+$NetBSD: patch-configure,v 1.1 2025/11/15 21:38:43 vins Exp $
+
+* Standardise configure options to avoid PLIST inconsistencies.
+* Enable OSS backend on NetBSD. 
+
+--- configure.orig     2024-08-01 15:36:54.000000000 +0000
++++ configure
+@@ -70,8 +70,9 @@ case `uname` in
+       Linux)
+               alsa=yes
+               ldadd="-lrt -lm"
+-              user=sndiod
+-              so_link="libsndio.so libsndio.so.\${MAJ} libsndio.so.\${MAJ}.0"
++              libbsd=yes
++              user=_sndio
++              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 +96,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'
++              -D_OPENBSD_SOURCE -DHAVE_STRLCAT -DHAVE_STRLCPY \\\
++              -DHAVE_STRTONUM -DHAVE_SOCK_CLOEXEC -DHAVE_CLOCK_GETTIME'
+               ;;
+       OpenBSD)
+               sun=yes
+               rmidi=yes
+-              user=_sndiop
++              user=_sndio
++              so_link="libsndio.so.\${MAJ}"
+               defs='-DHAVE_ARC4RANDOM -DHAVE_GETPEEREID -DHAVE_ISSETUGID \\\
+               -DHAVE_STRLCAT -DHAVE_STRLCPY -DHAVE_STRTONUM \\\
+               -DHAVE_SOCK_CLOEXEC -DHAVE_CLOCK_GETTIME'
+@@ -114,8 +119,8 @@ case `uname` in
+               oss=yes
+               umidi=yes
+               user=_sndio
+-              so_ldflags="-Wl,-soname=libsndio.so.\${MAJ}.\${MIN}"
+-              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_STRTONUM \\\
+               -DHAVE_SOCK_CLOEXEC -DHAVE_CLOCK_GETTIME'
Index: pkgsrc/audio/sndio/patches/patch-libsndio_sio__oss.c
diff -u /dev/null pkgsrc/audio/sndio/patches/patch-libsndio_sio__oss.c:1.1
--- /dev/null   Sat Nov 15 21:38:43 2025
+++ pkgsrc/audio/sndio/patches/patch-libsndio_sio__oss.c        Sat Nov 15 21:38:43 2025
@@ -0,0 +1,43 @@
+$NetBSD: patch-libsndio_sio__oss.c,v 1.1 2025/11/15 21:38:43 vins Exp $
+
+Add missing bits for ossaudio(3) on NetBSD.
+
+--- libsndio/sio_oss.c.orig    2024-08-01 15:36:54.000000000 +0000
++++ libsndio/sio_oss.c
+@@ -37,6 +37,22 @@
+       sizeof(DEVPATH_PREFIX) - 1 +    \
+       sizeof(int) * 3)
+ 
++/*
++ * 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;
+@@ -288,11 +304,13 @@ sio_oss_getfd(const char *str, unsigned 
+       }
+ 
+       val = 1;
++#if !defined(__NetBSD__)
+       if (ioctl(fd, SNDCTL_DSP_LOW_WATER, &val) == -1) {
+               DPERROR("sio_oss_start: LOW_WATER");
+               close(fd);
+               return -1;
+       }
++#endif
+       return fd;
+ }
+ 



Home | Main Index | Thread Index | Old Index