diff --git a/audio/sndio/Makefile b/audio/sndio/Makefile new file mode 100644 index 0000000..75fe3d2 --- /dev/null +++ b/audio/sndio/Makefile @@ -0,0 +1,34 @@ +# Created by: Tobias Kortkamp +# $FreeBSD$ + +PORTNAME= sndio +PORTVERSION= 1.1.0 +CATEGORIES= audio +MASTER_SITES= http://www.sndio.org/ + +MAINTAINER= t@tobik.me +COMMENT= Small audio and MIDI framework from the OpenBSD project + +LICENSE= ISCL + +HAS_CONFIGURE= yes +CONFIGURE_ARGS= --prefix=${PREFIX} --mandir=${PREFIX}/man + +USE_LDCONFIG= yes +USE_RC_SUBR= sndiod + +USERS= _sndio +GROUPS= _sndio + +# Parallel build leads to problems, but sndio is very quick to compile +# as is so not worth fixing +MAKE_JOBS_UNSAFE= yes + +post-install: + @${STRIP_CMD} \ + ${STAGEDIR}${PREFIX}/lib/libsndio.so.6.1 \ + ${STAGEDIR}${PREFIX}/bin/sndiod \ + ${STAGEDIR}${PREFIX}/bin/aucat \ + ${STAGEDIR}${PREFIX}/bin/midicat + +.include diff --git a/audio/sndio/distinfo b/audio/sndio/distinfo new file mode 100644 index 0000000..4293504 --- /dev/null +++ b/audio/sndio/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1465315037 +SHA256 (sndio-1.1.0.tar.gz) = fcd7f845ff70f38c2898d737450b8aa3e1bb0afb9d147e8429ef22c0b2c2db57 +SIZE (sndio-1.1.0.tar.gz) = 121018 diff --git a/audio/sndio/files/patch-configure b/audio/sndio/files/patch-configure new file mode 100644 index 0000000..90ba43d --- /dev/null +++ b/audio/sndio/files/patch-configure @@ -0,0 +1,15 @@ +--- configure.orig 2015-12-15 05:28:04 UTC ++++ configure +@@ -71,6 +71,12 @@ case `uname` in + defs='-DHAVE_ARC4RANDOM -DHAVE_ISSETUGID \\\ + -DHAVE_STRLCAT -DHAVE_STRLCPY -DHAVE_STRTONUM' + ;; ++ FreeBSD) ++ user=_sndio ++ so="$so libsndio.so" ++ defs='-DHAVE_ARC4RANDOM -DHAVE_ISSETUGID \\\ ++ -DHAVE_STRLCAT -DHAVE_STRLCPY -DHAVE_STRTONUM' ++ ;; + esac + + # shell word separator (none) diff --git a/audio/sndio/files/sndiod.in b/audio/sndio/files/sndiod.in new file mode 100755 index 0000000..8aec05f --- /dev/null +++ b/audio/sndio/files/sndiod.in @@ -0,0 +1,32 @@ +#!/bin/sh +# +# $FreeBSD$ +# +# PROVIDE: sndiod +# REQUIRE: NETWORKING sysctl +# BEFORE: DAEMON +# KEYWORD: shutdown + +# By default sndiod will use the audio device from +# hw.snd.default_unit. You can override this by setting sndiod_flags. +# +# To connect to a remote sndiod use e.g. +# sndiod_flags="-f snd@remotehost/0" +# +# To use /dev/dsp5 +# sndiod_flags="-f rsnd/5" + +. /etc/rc.subr + +name=sndiod +rcvar=sndiod_enable + +load_rc_config $name + +_sndiod_devnum=$($SYSCTL hw.snd.default_unit) +: ${sndiod_enable="NO"} +: ${sndiod_flags="-f rsnd/$_sndiod_devnum"} + +command="%%PREFIX%%/bin/sndiod" + +run_rc_command "$1" diff --git a/audio/sndio/pkg-descr b/audio/sndio/pkg-descr new file mode 100644 index 0000000..b0f4680 --- /dev/null +++ b/audio/sndio/pkg-descr @@ -0,0 +1,11 @@ +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. + +WWW: http://www.sndio.org/ diff --git a/audio/sndio/pkg-message b/audio/sndio/pkg-message new file mode 100644 index 0000000..6acd7e9 --- /dev/null +++ b/audio/sndio/pkg-message @@ -0,0 +1,22 @@ +sndio has no hardware support on FreeBSD currently, so this port is +only useful if you have a sndio server running on a Linux or OpenBSD +host. + +If you want local clients to auto-play to your remote server, enable +sndiod with: + + sysrc sndiod_enable=YES sndiod_flags="-f snd@remotehost/0" + service sndiod start + +Alternatively set the AUDIODEVICE environment variable so clients know +where to stream to + + export AUDIODEVICE=snd@remotehost/0 + +There is no direct sndio support in the official FreeBSD ports tree +yet. The fork at https://github.com/t6/freebsd-port-sndio contains +patches that enable sndio support in important ports. + +audio/pulseaudio-module-sndio is a PulseAudio module that allows you +to play to your sndio server. This is useful for ports that have +PulseAudio support but no direct sndio support. diff --git a/audio/sndio/pkg-plist b/audio/sndio/pkg-plist new file mode 100644 index 0000000..1425a6d --- /dev/null +++ b/audio/sndio/pkg-plist @@ -0,0 +1,35 @@ +bin/aucat +bin/midicat +bin/sndiod +include/sndio.h +lib/libsndio.so +lib/libsndio.so.6.1 +man/man1/aucat.1.gz +man/man1/midicat.1.gz +man/man3/mio_close.3.gz +man/man3/mio_eof.3.gz +man/man3/mio_nfds.3.gz +man/man3/mio_open.3.gz +man/man3/mio_pollfd.3.gz +man/man3/mio_read.3.gz +man/man3/mio_revents.3.gz +man/man3/mio_write.3.gz +man/man3/sio_close.3.gz +man/man3/sio_eof.3.gz +man/man3/sio_getcap.3.gz +man/man3/sio_getpar.3.gz +man/man3/sio_initpar.3.gz +man/man3/sio_nfds.3.gz +man/man3/sio_onmove.3.gz +man/man3/sio_onvol.3.gz +man/man3/sio_open.3.gz +man/man3/sio_pollfd.3.gz +man/man3/sio_read.3.gz +man/man3/sio_revents.3.gz +man/man3/sio_setpar.3.gz +man/man3/sio_setvol.3.gz +man/man3/sio_start.3.gz +man/man3/sio_stop.3.gz +man/man3/sio_write.3.gz +man/man7/sndio.7.gz +man/man8/sndiod.8.gz diff --git a/GIDs b/GIDs index 8d5b13e..dcdb24c 100644 --- a/GIDs +++ b/GIDs @@ -234,6 +234,7 @@ aox:*:666: riak:*:667: bnetd:*:700: fastnetmon:*:701: +_sndio:*:702: bopm:*:717: openxpki:*:777: zetacoin:*:780: diff --git a/UIDs b/UIDs index 5efcccc..71e45cf 100644 --- a/UIDs +++ b/UIDs @@ -242,6 +242,7 @@ riakcs:*:668:667::0:0:Riak CS user:/usr/local/lib/riak-cs:/bin/sh stanchion:*:669:667::0:0:Stanchion user:/usr/local/lib/stanchion:/bin/sh bnetd:*:700:700::0:0:Bnetd user:/nonexistent:/usr/sbin/nologin fastnetmon:*:701:701::0:0:FastNetMon user:/nonexistent:/usr/sbin/nologin +_sndio:*:702:702::0:0:sndio privsep:/var/empty:/usr/sbin/nologin bopm:*:717:717::0:0:Blitzed Open Proxy Monitor:/nonexistent:/bin/sh _dnscrypt-wrapper:*:718:65534::0:0:dnscrypt-wrapper user:/var/empty:/usr/sbin/nologin openxpki:*:777:777::0:0:OpenXPKI Owner:/nonexistent:/usr/sbin/nologin