2023-03-04 12:14:45 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, autoreconfHook
|
|
|
|
, pkg-config
|
2023-05-24 13:37:59 +00:00
|
|
|
, openssl
|
2023-03-04 12:14:45 +00:00
|
|
|
, 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
|
|
|
|
2023-05-24 13:37:59 +00:00
|
|
|
let
|
|
|
|
inherit (lib) optional optionals;
|
|
|
|
in
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "shairport-sync";
|
2023-10-09 19:29:22 +00:00
|
|
|
version = "4.3.1";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
repo = "shairport-sync";
|
|
|
|
owner = "mikebrady";
|
2023-07-15 17:15:38 +00:00
|
|
|
rev = "refs/tags/${version}";
|
2023-10-09 19:29:22 +00:00
|
|
|
hash = "sha256-Yj0SKMKACj2B/ADPkUzO4EvaYZX39erKmjaTsr5UN0s=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
autoreconfHook
|
|
|
|
pkg-config
|
|
|
|
# For glib we want the `dev` output for the same library we are
|
|
|
|
# also linking against, since pkgsHostTarget.glib.dev exposes
|
|
|
|
# some extra tools that are built for build->host execution.
|
|
|
|
# To achieve this, we coerce the output to a string to prevent
|
|
|
|
# mkDerivation's splicing logic from kicking in.
|
|
|
|
"${glib.dev}"
|
2023-10-19 13:55:26 +00:00
|
|
|
] ++ optional enableAirplay2 [
|
|
|
|
unixtools.xxd
|
2023-07-15 17:15:38 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
makeFlags = [
|
|
|
|
# Workaround for https://github.com/mikebrady/shairport-sync/issues/1705
|
|
|
|
"AR=${stdenv.cc.bintools.targetPrefix}ar"
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-05-24 13:37:59 +00:00
|
|
|
buildInputs = [
|
|
|
|
openssl
|
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
|
|
|
|
]
|
|
|
|
++ 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-05-24 13:37:59 +00:00
|
|
|
configureFlags = [
|
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
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
strictDeps = true;
|
|
|
|
|
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;
|
|
|
|
};
|
|
|
|
}
|