2023-03-04 12:14:45 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, autoreconfHook
|
|
|
|
, pkg-config
|
|
|
|
, openssl_1_1
|
|
|
|
, avahi
|
|
|
|
, alsa-lib
|
|
|
|
, libplist
|
|
|
|
, glib
|
|
|
|
, libdaemon
|
|
|
|
, libsodium
|
|
|
|
, libgcrypt
|
|
|
|
, ffmpeg
|
|
|
|
, libuuid
|
|
|
|
, unixtools
|
|
|
|
, popt
|
|
|
|
, libconfig
|
|
|
|
, libpulseaudio
|
|
|
|
, libjack2
|
|
|
|
, pipewire
|
|
|
|
, soxr
|
|
|
|
, enableAirplay2 ? false
|
|
|
|
, enableStdout ? true
|
|
|
|
, enableAlsa ? true
|
|
|
|
, enablePulse ? true
|
|
|
|
, enablePipe ? true
|
|
|
|
, enablePipewire ? true
|
|
|
|
, enableJack ? true
|
2022-06-26 10:26:21 +00:00
|
|
|
, enableMetadata ? false
|
|
|
|
, enableMpris ? stdenv.isLinux
|
2023-03-04 12:14:45 +00:00
|
|
|
, enableDbus ? stdenv.isLinux
|
|
|
|
, enableSoxr ? true
|
|
|
|
, enableLibdaemon ? false
|
2022-06-26 10:26:21 +00:00
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2023-03-04 12:14:45 +00:00
|
|
|
version = "4.1.1";
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "shairport-sync";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
rev = version;
|
|
|
|
repo = "shairport-sync";
|
|
|
|
owner = "mikebrady";
|
2023-03-04 12:14:45 +00:00
|
|
|
hash = "sha256-EKt5mH9GmzeR4zdPDFOt26T9STpG1khVrY4DFIv5Maw=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
nativeBuildInputs = [ autoreconfHook pkg-config ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-03-04 12:14:45 +00:00
|
|
|
buildInputs = with lib; [
|
|
|
|
openssl_1_1
|
2020-04-24 23:36:52 +00:00
|
|
|
avahi
|
|
|
|
popt
|
|
|
|
libconfig
|
2023-03-04 12:14:45 +00:00
|
|
|
]
|
|
|
|
++ optional enableLibdaemon libdaemon
|
|
|
|
++ optional enableAlsa alsa-lib
|
|
|
|
++ optional enablePulse libpulseaudio
|
|
|
|
++ optional enablePipewire pipewire
|
|
|
|
++ optional enableJack libjack2
|
|
|
|
++ optional enableSoxr soxr
|
|
|
|
++ optionals enableAirplay2 [
|
|
|
|
libplist
|
|
|
|
libsodium
|
|
|
|
libgcrypt
|
|
|
|
libuuid
|
|
|
|
ffmpeg
|
|
|
|
unixtools.xxd
|
|
|
|
]
|
|
|
|
++ optional stdenv.isLinux glib;
|
2022-06-26 10:26:21 +00:00
|
|
|
|
2023-03-04 12:14:45 +00:00
|
|
|
postPatch = ''
|
2022-06-26 10:26:21 +00:00
|
|
|
sed -i -e 's/G_BUS_TYPE_SYSTEM/G_BUS_TYPE_SESSION/g' dbus-service.c
|
|
|
|
sed -i -e 's/G_BUS_TYPE_SYSTEM/G_BUS_TYPE_SESSION/g' mpris-service.c
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2023-03-04 12:14:45 +00:00
|
|
|
configureFlags = with lib; [
|
2020-04-24 23:36:52 +00:00
|
|
|
"--without-configfiles"
|
|
|
|
"--sysconfdir=/etc"
|
2023-03-04 12:14:45 +00:00
|
|
|
"--with-ssl=openssl"
|
|
|
|
"--with-stdout"
|
|
|
|
"--with-avahi"
|
2022-06-26 10:26:21 +00:00
|
|
|
]
|
2023-03-04 12:14:45 +00:00
|
|
|
++ optional enablePulse "--with-pa"
|
|
|
|
++ optional enablePipewire "--with-pw"
|
|
|
|
++ optional enableAlsa "--with-alsa"
|
|
|
|
++ optional enableJack "--with-jack"
|
|
|
|
++ optional enableStdout "--with-stdout"
|
|
|
|
++ optional enablePipe "--with-pipe"
|
|
|
|
++ optional enableSoxr "--with-soxr"
|
|
|
|
++ optional enableDbus "--with-dbus-interface"
|
|
|
|
++ optional enableMetadata "--with-metadata"
|
|
|
|
++ optional enableMpris "--with-mpris-interface"
|
|
|
|
++ optional enableLibdaemon "--with-libdaemon"
|
|
|
|
++ optional enableAirplay2 "--with-airplay-2";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2023-03-04 12:14:45 +00:00
|
|
|
homepage = "https://github.com/mikebrady/shairport-sync";
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Airtunes server and emulator with multi-room capabilities";
|
|
|
|
license = licenses.mit;
|
2023-03-04 12:14:45 +00:00
|
|
|
maintainers = with maintainers; [ lnl7 jordanisaacs ];
|
2020-04-24 23:36:52 +00:00
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
}
|