pkgsrc-WIP-changes archive

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

add shairport-sync



Module Name:	pkgsrc-wip
Committed By:	nia <nia%netbsd.org@localhost>
Pushed By:	nee
Date:		Sun Apr 4 09:26:49 2021 +0200
Changeset:	6b61e1cb79431830ce515f9ad1dd13e2b57aaef5

Modified Files:
	Makefile
Added Files:
	shairport-sync/DESCR
	shairport-sync/Makefile
	shairport-sync/PLIST
	shairport-sync/TODO
	shairport-sync/distinfo
	shairport-sync/options.mk
	shairport-sync/patches/patch-Makefile.am
	shairport-sync/patches/patch-audio.c
	shairport-sync/patches/patch-audio__sun.c
	shairport-sync/patches/patch-common.c
	shairport-sync/patches/patch-configure.ac

Log Message:
add shairport-sync

Shairport Sync is an AirPlay audio player - it plays audio streamed from
iTunes, iOS, Apple TV and macOS devices and AirPlay sources such as Quicktime
Player and ForkedDaapd, among others.

Audio played by a Shairport Sync-powered device stays synchronised with the
source and hence with similar devices playing the same source. In this way,
synchronised multi-room audio is possible for players that support it.

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

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

diffstat:
 Makefile                                  |   1 +
 shairport-sync/DESCR                      |   7 +
 shairport-sync/Makefile                   |  56 +++++++
 shairport-sync/PLIST                      |   4 +
 shairport-sync/TODO                       |  13 ++
 shairport-sync/distinfo                   |  11 ++
 shairport-sync/options.mk                 |  58 +++++++
 shairport-sync/patches/patch-Makefile.am  |  17 ++
 shairport-sync/patches/patch-audio.c      |  26 +++
 shairport-sync/patches/patch-audio__sun.c | 265 ++++++++++++++++++++++++++++++
 shairport-sync/patches/patch-common.c     |  16 ++
 shairport-sync/patches/patch-configure.ac |  21 +++
 12 files changed, 495 insertions(+)

diffs:
diff --git a/Makefile b/Makefile
index d6a0c48ce2..87fa0d1406 100644
--- a/Makefile
+++ b/Makefile
@@ -5132,6 +5132,7 @@ SUBDIR+=	sflphoned
 SUBDIR+=	sgmltools-lite
 SUBDIR+=	shaarli
 SUBDIR+=	shadow
+SUBDIR+=	shairport-sync
 SUBDIR+=	shaper
 SUBDIR+=	sharif-univ-ttf
 SUBDIR+=	shed
diff --git a/shairport-sync/DESCR b/shairport-sync/DESCR
new file mode 100644
index 0000000000..69ee45d358
--- /dev/null
+++ b/shairport-sync/DESCR
@@ -0,0 +1,7 @@
+Shairport Sync is an AirPlay audio player - it plays audio streamed from
+iTunes, iOS, Apple TV and macOS devices and AirPlay sources such as Quicktime
+Player and ForkedDaapd, among others.
+
+Audio played by a Shairport Sync-powered device stays synchronised with the
+source and hence with similar devices playing the same source. In this way,
+synchronised multi-room audio is possible for players that support it.
diff --git a/shairport-sync/Makefile b/shairport-sync/Makefile
new file mode 100644
index 0000000000..2bf6a3eddc
--- /dev/null
+++ b/shairport-sync/Makefile
@@ -0,0 +1,56 @@
+# $NetBSD$
+
+DISTNAME=	shairport-sync-3.3.7
+CATEGORIES=	audio
+MASTER_SITES=	${MASTER_SITE_GITHUB:=mikebrady/}
+
+MAINTAINER=	nia%NetBSD.org@localhost
+HOMEPAGE=	https://github.com/mikebrady/shairport-sync
+COMMENT=	AirPlay audio player with multi-room audio synchronisation capability
+LICENSE=	mit # possibly others?
+
+USE_TOOLS+=	autoconf autoreconf automake
+USE_TOOLS+=	pkg-config
+USE_LANGUAGES=	c c++
+
+GNU_CONFIGURE=	yes
+
+CONFIGURE_ARGS+=	--with-ao
+CONFIGURE_ARGS+=	--with-libdaemon
+CONFIGURE_ARGS+=	--with-metadata
+CONFIGURE_ARGS+=	--with-pipe
+CONFIGURE_ARGS+=	--with-soxr
+CONFIGURE_ARGS+=	--with-stdout
+
+CONFIGURE_ARGS+=	--without-configfiles
+
+.include "../../mk/bsd.prefs.mk"
+
+.if ${OPSYS} == "NetBSD" || ${OPSYS} == "SunOS" || \
+    exists(/usr/include/sys/audioio.h)
+CONFIGURE_ARGS+=	--with-sun
+.endif
+
+.if ${OPSYS} != "Darwin"
+CPPFLAGS+=	-DCOMPILE_FOR_LINUX_AND_FREEBSD_AND_CYGWIN_AND_OPENBSD=1
+.endif
+
+INSTALLATION_DIRS+=	share/examples/${PKGBASE}
+
+CONF_FILES+=	${PREFIX}/share/examples/${PKGBASE}/${PKGBASE}.conf \
+		${PKG_SYSCONFDIR}/${PKGBASE}.conf
+
+pre-configure:
+	cd ${WRKSRC} && autoreconf -fi
+
+post-install:
+	${INSTALL_DATA} ${WRKSRC}/scripts/shairport-sync.conf \
+	    ${DESTDIR}${PREFIX}/share/examples/${PKGBASE}/${PKGBASE}.conf
+
+.include "options.mk"
+.include "../../audio/libao/buildlink3.mk"
+.include "../../audio/libsoxr/buildlink3.mk"
+.include "../../devel/libconfig/buildlink3.mk"
+.include "../../devel/libdaemon/buildlink3.mk"
+.include "../../devel/popt/buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/shairport-sync/PLIST b/shairport-sync/PLIST
new file mode 100644
index 0000000000..354aa44186
--- /dev/null
+++ b/shairport-sync/PLIST
@@ -0,0 +1,4 @@
+@comment $NetBSD$
+bin/shairport-sync
+man/man7/shairport-sync.7
+share/examples/shairport-sync/shairport-sync.conf
diff --git a/shairport-sync/TODO b/shairport-sync/TODO
new file mode 100644
index 0000000000..28d02a4509
--- /dev/null
+++ b/shairport-sync/TODO
@@ -0,0 +1,13 @@
+Needs a rc script, further testing, documentation and upstreaming of patches.
+
+I get this when attempting to connect with rtunes:
+
+         0.000097779 "rtp.c:506" Error 49 using send-to to the timing socket: "Can't assign requested address".
+         0.000097583 "rtp.c:506" Error 49 using send-to to the timing socket: "Can't assign requested address".
+         0.000097814 "rtp.c:506" Error 49 using send-to to the timing socket: "Can't assign requested address".
+         0.000103637 "rtp.c:506" Error 49 using send-to to the timing socket: "Can't assign requested address".
+         0.000101781 "rtp.c:506" Error 49 using send-to to the timing socket: "Can't assign requested address".
+         0.000104861 "rtp.c:506" Error 49 using send-to to the timing socket: "Can't assign requested address".
+         0.000096524 "rtp.c:506" Error 49 using send-to to the timing socket: "Can't assign requested address".
+
+etc
diff --git a/shairport-sync/distinfo b/shairport-sync/distinfo
new file mode 100644
index 0000000000..f0c868d73e
--- /dev/null
+++ b/shairport-sync/distinfo
@@ -0,0 +1,11 @@
+$NetBSD$
+
+SHA1 (shairport-sync-3.3.7.tar.gz) = 696527086bde03b1ea80d75bec3f030e711283e4
+RMD160 (shairport-sync-3.3.7.tar.gz) = 27c3c4782fa317aaac99ae244c5ca22c399a1d94
+SHA512 (shairport-sync-3.3.7.tar.gz) = e420b470ef33731986959d598c769addc999b2f45a6282f6a20a76f1174303fe91264f2b3cdc536fecbe3227e1b8d55636a06d123ac792b50053aea7a8cbb4e2
+Size (shairport-sync-3.3.7.tar.gz) = 419635 bytes
+SHA1 (patch-Makefile.am) = 7986bbcd9db23bbb46bb6f383bf20268fd0e56cd
+SHA1 (patch-audio.c) = 09efa3814893b878214505c7e95b6f323e317399
+SHA1 (patch-audio__sun.c) = b48b166b557bb61e89b7f91ba812ef9f3f76ff01
+SHA1 (patch-common.c) = 495e6e7cdf243daf18c695e052eef1bf0174c880
+SHA1 (patch-configure.ac) = 1f153a196620503ea1750944421a0bc2e0d1f312
diff --git a/shairport-sync/options.mk b/shairport-sync/options.mk
new file mode 100644
index 0000000000..f0ed317349
--- /dev/null
+++ b/shairport-sync/options.mk
@@ -0,0 +1,58 @@
+# $NetBSD: options.mk,v 1.8 2020/08/19 17:53:15 nia Exp $
+
+PKG_OPTIONS_VAR=	PKG_OPTIONS.shairport-sync
+
+PKG_OPTIONS_REQUIRED_GROUPS=	ssl
+PKG_OPTIONS_OPTIONAL_GROUPS=	dnssd
+PKG_OPTIONS_GROUP.ssl=		openssl mbedtls
+PKG_OPTIONS_GROUP.dnssd=	avahi dnssd
+
+.include "../../mk/bsd.fast.prefs.mk"
+
+PKG_SUPPORTED_OPTIONS+=		jack pulseaudio
+
+.if ${OPSYS} == "Linux"
+PKG_SUPPORTED_OPTIONS+=		alsa
+PKG_SUGGESTED_OPTIONS+=		alsa avahi
+.else
+PKG_SUGGESTED_OPTIONS+=		dnssd
+.endif
+
+PKG_SUGGESTED_OPTIONS+=		openssl
+
+.include "../../mk/bsd.options.mk"
+
+.if !empty(PKG_OPTIONS:Malsa)
+.  include "../../audio/alsa-lib/buildlink3.mk"
+CONFIGURE_ARGS+=	--with-alsa
+.endif
+
+.if !empty(PKG_OPTIONS:Mavahi)
+.  include "../../net/avahi/buildlink3.mk"
+CONFIGURE_ARGS+=	--with-avahi
+.endif
+
+.if !empty(PKG_OPTIONS:Mdnssd)
+.  include "../../net/mDNSResponder/buildlink3.mk"
+CONFIGURE_ARGS+=	--with-dns_sd
+.endif
+
+.if !empty(PKG_OPTIONS:Mjack)
+.  include "../../audio/jack/buildlink3.mk"
+CONFIGURE_ARGS+=	--with-jack
+.endif
+
+.if !empty(PKG_OPTIONS:Mpulseaudio)
+.  include "../../audio/pulseaudio/buildlink3.mk"
+CONFIGURE_ARGS+=	--with-pa
+.endif
+
+.if !empty(PKG_OPTIONS:Mopenssl)
+.  include "../../security/openssl/buildlink3.mk"
+CONFIGURE_ARGS+=	--with-ssl=openssl
+.endif
+
+.if !empty(PKG_OPTIONS:Mmbedtls)
+.  include "../../security/mbedtls/buildlink3.mk"
+CONFIGURE_ARGS+=	--with-ssl=mbedtls
+.endif
diff --git a/shairport-sync/patches/patch-Makefile.am b/shairport-sync/patches/patch-Makefile.am
new file mode 100644
index 0000000000..f05feefe82
--- /dev/null
+++ b/shairport-sync/patches/patch-Makefile.am
@@ -0,0 +1,17 @@
+$NetBSD$
+
+Add support for Sun/NetBSD audio.
+
+--- Makefile.am.orig	2020-12-01 12:16:11.000000000 +0000
++++ Makefile.am
+@@ -56,6 +56,10 @@ if USE_SNDIO
+ shairport_sync_SOURCES += audio_sndio.c
+ endif
+ 
++if USE_SUN
++shairport_sync_SOURCES += audio_sun.c
++endif
++
+ if USE_STDOUT
+ shairport_sync_SOURCES += audio_stdout.c
+ endif
diff --git a/shairport-sync/patches/patch-audio.c b/shairport-sync/patches/patch-audio.c
new file mode 100644
index 0000000000..bd8800aaf9
--- /dev/null
+++ b/shairport-sync/patches/patch-audio.c
@@ -0,0 +1,26 @@
+$NetBSD$
+
+Add support for Sun/NetBSD audio.
+
+--- audio.c.orig	2020-12-01 12:16:11.000000000 +0000
++++ audio.c
+@@ -37,6 +37,9 @@ extern audio_output audio_jack;
+ #ifdef CONFIG_SNDIO
+ extern audio_output audio_sndio;
+ #endif
++#ifdef CONFIG_SUN
++extern audio_output audio_sun;
++#endif
+ #ifdef CONFIG_AO
+ extern audio_output audio_ao;
+ #endif
+@@ -66,6 +69,9 @@ static audio_output *outputs[] = {
+ #ifdef CONFIG_SNDIO
+     &audio_sndio,
+ #endif
++#ifdef CONFIG_SUN
++    &audio_sun,
++#endif
+ #ifdef CONFIG_PA
+     &audio_pa,
+ #endif
diff --git a/shairport-sync/patches/patch-audio__sun.c b/shairport-sync/patches/patch-audio__sun.c
new file mode 100644
index 0000000000..0e4534d8c0
--- /dev/null
+++ b/shairport-sync/patches/patch-audio__sun.c
@@ -0,0 +1,265 @@
+$NetBSD$
+
+Add support for Sun/NetBSD audio.
+
+--- audio_sun.c.orig	2021-04-04 06:45:52.830430162 +0000
++++ audio_sun.c
+@@ -0,0 +1,258 @@
++/*
++ * sun output driver. This file is part of Shairport Sync.
++ * Copyright (c) 2013 Dimitri Sokolyuk <demon%dim13.org@localhost>
++ * Copyright (c) 2017 Tobias Kortkamp <t%tobik.me@localhost>
++ * Copyright (c) 2021 Nia Alarie <nia%NetBSD.org@localhost>
++ *
++ * Modifications for audio synchronisation
++ * and related work, copyright (c) Mike Brady 2014 -- 2017
++ * All rights reserved.
++ *
++ * Permission to use, copy, modify, and distribute this software for any
++ * purpose with or without fee is hereby granted, provided that the above
++ * copyright notice and this permission notice appear in all copies.
++ *
++ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
++ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
++ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
++ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
++ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
++ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
++ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
++ */
++
++#include "audio.h"
++#include "common.h"
++#include <pthread.h>
++#include <sys/audioio.h>
++#include <sys/ioctl.h>
++#include <sys/types.h>
++#ifdef __sun
++#include <sys/conf.h>
++#include <stropts.h>
++#endif
++#include <stdbool.h>
++#include <stdio.h>
++#include <string.h>
++#include <unistd.h>
++#include <fcntl.h>
++
++static void help(void);
++static int init(int, char **);
++static void deinit(void);
++static void start(int, int);
++static int play(void *, int);
++static void stop(void);
++static int delay(long *);
++static void flush(void);
++
++audio_output audio_sun = {.name = "sun",
++                            .help = &help,
++                            .init = &init,
++                            .deinit = &deinit,
++                            .prepare = NULL,
++                            .start = &start,
++                            .stop = &stop,
++                            .is_running = NULL,
++                            .flush = &flush,
++                            .delay = &delay,
++                            .play = &play,
++                            .volume = NULL,
++                            .parameters = NULL,
++                            .mute = NULL};
++
++static pthread_mutex_t sun_mutex = PTHREAD_MUTEX_INITIALIZER;
++static int framesize;
++static int fd;
++
++struct sun_format {
++  const char *name;
++  sps_format_t fmt;
++  unsigned int encoding;
++  unsigned int precision;
++};
++
++/* SunOS compatibility defines for NetBSD extensions. */
++
++#ifndef AUDIO_ENCODING_SLINEAR
++#define AUDIO_ENCODING_SLINEAR AUDIO_ENCODING_LINEAR
++#endif
++
++#ifndef AUDIO_ENCODING_ULINEAR
++#define AUDIO_ENCODING_ULINEAR AUDIO_ENCODING_LINEAR8
++#endif
++
++#ifndef AUDIO_ENCODING_SLINEAR_LE
++#define AUDIO_ENCODING_SLINEAR_LE AUDIO_ENCODING_LINEAR
++#endif
++
++#ifndef AUDIO_ENCODING_SLINEAR_BE
++#define AUDIO_ENCODING_SLINEAR_BE AUDIO_ENCODING_LINEAR
++#endif
++
++#ifndef AUDIO_GETBUFINFO
++#define AUDIO_GETBUFINFO AUDIO_GETINFO
++#endif
++
++#ifndef DEFAULT_DEV
++#define DEFAULT_DEV "/dev/audio"
++#endif
++
++static struct sun_format formats[] = {{"U8", SPS_FORMAT_U8, AUDIO_ENCODING_ULINEAR, 8},
++                                         {"S8", SPS_FORMAT_S8, AUDIO_ENCODING_SLINEAR, 16},
++                                         {"S16", SPS_FORMAT_S16, AUDIO_ENCODING_SLINEAR, 16},
++                                         {"S16_LE", SPS_FORMAT_S16_LE, AUDIO_ENCODING_SLINEAR_LE, 16},
++                                         {"S16_BE", SPS_FORMAT_S16_BE, AUDIO_ENCODING_SLINEAR_BE, 16},
++                                         {"S32", SPS_FORMAT_S16, AUDIO_ENCODING_SLINEAR, 32},
++                                         {"S32_LE", SPS_FORMAT_S32_LE, AUDIO_ENCODING_SLINEAR_LE, 32},
++                                         {"S32_BE", SPS_FORMAT_S32_BE, AUDIO_ENCODING_SLINEAR_BE, 32}};
++
++static void help() { printf("    -d output-device    set the output device [default*|...]\n"); }
++
++static int init(int argc, char **argv) {
++  struct audio_info info;
++  int found, opt;
++  unsigned int i;
++  const char *devname, *tmp;
++
++  // set up default values first
++
++  AUDIO_INITINFO(&info);
++  info.play.encoding = AUDIO_ENCODING_SLINEAR_LE;
++  info.play.sample_rate = 44100;
++  info.play.channels = 2;
++  info.play.precision = 16;
++
++  devname = DEFAULT_DEV;
++
++  config.audio_backend_buffer_desired_length = 1.0;
++  config.audio_backend_buffer_interpolation_threshold_in_seconds =
++      0.25; // below this, soxr interpolation will not occur -- it'll be basic interpolation
++            // instead.
++  config.audio_backend_latency_offset = 0;
++
++  // get settings from settings file
++
++  // do the "general" audio  options. Note, these options are in the "general" stanza!
++  parse_general_audio_options();
++
++  // get the specific settings
++
++  if (config.cfg != NULL) {
++    if (!config_lookup_string(config.cfg, "sun.device", &devname))
++      devname = DEFAULT_DEV;
++    if (config_lookup_string(config.cfg, "sun.format", &tmp)) {
++      for (i = 0, found = 0; i < sizeof(formats) / sizeof(formats[0]); i++) {
++        if (strcasecmp(formats[i].name, tmp) == 0) {
++          config.output_format = formats[i].fmt;
++          info.play.encoding = formats[i].encoding;
++          info.play.precision = formats[i].precision;
++          found = 1;
++          break;
++        }
++      }
++      if (!found)
++        die("Invalid output format \"%s\". Should be one of: U8, S8, S16, S16_LE, S16_BE, S32, S32_LE, S32_BE",
++            tmp);
++    }
++  }
++  optind = 1; // optind=0 is equivalent to optind=1 plus special behaviour
++  argv--;     // so we shift the arguments to satisfy getopt()
++  argc++;
++  while ((opt = getopt(argc, argv, "d:")) > 0) {
++    switch (opt) {
++    case 'd':
++      devname = optarg;
++      break;
++    default:
++      help();
++      die("Invalid audio option -%c specified", opt);
++    }
++  }
++  if (optind < argc)
++    die("Invalid audio argument: %s", argv[optind]);
++
++  pthread_mutex_lock(&sun_mutex);
++  debug(1, "Output device name is \"%s\".", devname);
++  fd = open(devname, O_WRONLY);
++  if (fd < 0)
++    die("sun: cannot open audio device");
++
++  if (ioctl(fd, AUDIO_SETINFO, &info) < 0)
++    die("sun: failed to set audio parameters");
++  if (ioctl(fd, AUDIO_GETINFO, &info) < 0)
++    die("sun: failed to get audio parameters");
++
++  framesize = (info.play.precision / 8) * info.play.channels;
++  config.output_rate = info.play.sample_rate;
++  config.audio_backend_buffer_desired_length = 1.0 * info.play.buffer_size / info.play.sample_rate;
++  config.audio_backend_latency_offset = 0;
++
++  pthread_mutex_unlock(&sun_mutex);
++  return 0;
++}
++
++static void deinit() {
++  pthread_mutex_lock(&sun_mutex);
++  close(fd);
++  pthread_mutex_unlock(&sun_mutex);
++}
++
++static void start(__attribute__((unused)) int sample_rate,
++                  __attribute__((unused)) int sample_format) {
++  struct audio_info tmpinfo;
++
++  AUDIO_INITINFO(&tmpinfo);
++  tmpinfo.play.pause = false;
++
++  pthread_mutex_lock(&sun_mutex);
++  if (ioctl(fd, AUDIO_SETINFO, &tmpinfo) < 0)
++      die("sun: unable to start");
++  pthread_mutex_unlock(&sun_mutex);
++}
++
++static int play(void *buf, int frames) {
++  if (frames > 0) {
++    pthread_mutex_lock(&sun_mutex);
++    if (write(fd, buf, frames * framesize) < 0)
++      die("sun: unable to write");
++    pthread_mutex_unlock(&sun_mutex);
++  }
++  return 0;
++}
++
++static void stop() {
++  struct audio_info tmpinfo;
++
++  AUDIO_INITINFO(&tmpinfo);
++  tmpinfo.play.pause = true;
++
++  pthread_mutex_lock(&sun_mutex);
++  (void)ioctl(fd, AUDIO_DRAIN, NULL);
++  if (ioctl(fd, AUDIO_SETINFO, &tmpinfo) < 0)
++      die("sun: unable to stop");
++  pthread_mutex_unlock(&sun_mutex);
++}
++
++static int delay(long *_delay) {
++  struct audio_info tmpinfo;
++
++  pthread_mutex_lock(&sun_mutex);
++  if (ioctl(fd, AUDIO_GETBUFINFO, &tmpinfo) < 0)
++    die("sun: unable to get audio buffer info");
++  *_delay = tmpinfo.play.seek / framesize;
++  pthread_mutex_unlock(&sun_mutex);
++  return 0;
++}
++
++static void flush() {
++  pthread_mutex_lock(&sun_mutex);
++#ifdef AUDIO_FLUSH
++  if (ioctl(fd, AUDIO_FLUSH, NULL) < 0)
++    die("sun: unable to flush");
++#else
++  if (ioctl(fd, I_FLUSH, FLUSHW) < 0)
++    die("sun: unable to flush");
++#endif
++  pthread_mutex_unlock(&sun_mutex);
++}
diff --git a/shairport-sync/patches/patch-common.c b/shairport-sync/patches/patch-common.c
new file mode 100644
index 0000000000..1ff735e54f
--- /dev/null
+++ b/shairport-sync/patches/patch-common.c
@@ -0,0 +1,16 @@
+$NetBSD$
+
+Add support for Sun/NetBSD audio.
+
+--- common.c.orig	2020-12-01 12:16:11.000000000 +0000
++++ common.c
+@@ -1465,6 +1465,9 @@ char *get_version_string() {
+ #ifdef CONFIG_SNDIO
+     strcat(version_string, "-sndio");
+ #endif
++#ifdef CONFIG_SUN
++    strcat(version_string, "-sun");
++#endif
+ #ifdef CONFIG_JACK
+     strcat(version_string, "-jack");
+ #endif
diff --git a/shairport-sync/patches/patch-configure.ac b/shairport-sync/patches/patch-configure.ac
new file mode 100644
index 0000000000..b85a42c0d7
--- /dev/null
+++ b/shairport-sync/patches/patch-configure.ac
@@ -0,0 +1,21 @@
+$NetBSD$
+
+Add support for Sun/NetBSD audio.
+
+--- configure.ac.orig	2020-12-01 12:16:11.000000000 +0000
++++ configure.ac
+@@ -261,6 +261,14 @@ AC_ARG_WITH(sndio, [  --with-sndio = cho
+   AC_CHECK_LIB([sndio], [sio_open], , AC_MSG_ERROR(SNDIO support requires the sndio library -- libsndio-dev suggested))], )
+ AM_CONDITIONAL([USE_SNDIO], [test "x$REQUESTED_SNDIO" = "x1"])
+ 
++# Look for SUN flag
++AC_ARG_WITH(sun, [  --with-sun = choose SUN/NETBSD API support], [
++  AC_MSG_RESULT(>>Including a SUN/NETBSD back end)
++  REQUESTED_SUN=1
++  AC_DEFINE([CONFIG_SUN], 1, [Needed by the compiler.])
++  AC_CHECK_HEADER([sys/audioio.h], , AC_MSG_ERROR(SUN support requires the sys/audioio.h header))], )
++AM_CONDITIONAL([USE_SUN], [test "x$REQUESTED_SUN" = "x1"])
++
+ # Look for AO flag
+ AC_ARG_WITH(ao, [  --with-ao = choose AO (Audio Output?) API support. N.B. no synchronisation -- so underflow or overflow is inevitable!], [
+   AC_MSG_RESULT(>>Including an AO back end. N.B. no synchronisation -- so underflow or overflow is inevitable!)


Home | Main Index | Thread Index | Old Index