23 , enableAirplay2 ? false
28 , enablePipewire ? true
30 , enableMetadata ? false
31 , enableMpris ? stdenv.isLinux
32 , enableDbus ? stdenv.isLinux
34 , enableLibdaemon ? false
38 inherit (lib) optional optionals;
41 stdenv.mkDerivation rec {
42 pname = "shairport-sync";
45 src = fetchFromGitHub {
46 repo = "shairport-sync";
48 rev = "refs/tags/${version}";
49 hash = "sha256:1y8dh1gdffq38hgy6x1228l51l6p56iaiqlflw7w1dcbgw15llcd";
55 # For glib we want the `dev` output for the same library we are
56 # also linking against, since pkgsHostTarget.glib.dev exposes
57 # some extra tools that are built for build->host execution.
58 # To achieve this, we coerce the output to a string to prevent
59 # mkDerivation's splicing logic from kicking in.
61 ] ++ optional enableAirplay2 [
71 ++ optional enableLibdaemon libdaemon
72 ++ optional enableAlsa alsa-lib
73 ++ optional enablePulse libpulseaudio
74 ++ optional enablePipewire pipewire
75 ++ optional enableJack libjack2
76 ++ optional enableSoxr soxr
77 ++ optionals enableAirplay2 [
84 ++ optional stdenv.isLinux glib;
87 sed -i -e 's/G_BUS_TYPE_SYSTEM/G_BUS_TYPE_SESSION/g' dbus-service.c
88 sed -i -e 's/G_BUS_TYPE_SYSTEM/G_BUS_TYPE_SESSION/g' mpris-service.c
91 enableParallelBuilding = true;
94 "--without-configfiles"
100 ++ optional enablePulse "--with-pa"
101 ++ optional enablePipewire "--with-pw"
102 ++ optional enableAlsa "--with-alsa"
103 ++ optional enableJack "--with-jack"
104 ++ optional enableStdout "--with-stdout"
105 ++ optional enablePipe "--with-pipe"
106 ++ optional enableSoxr "--with-soxr"
107 ++ optional enableDbus "--with-dbus-interface"
108 ++ optional enableMetadata "--with-metadata"
109 ++ optional enableMpris "--with-mpris-interface"
110 ++ optional enableLibdaemon "--with-libdaemon"
111 ++ optional enableAirplay2 "--with-airplay-2";
116 homepage = "https://github.com/mikebrady/shairport-sync";
117 description = "Airtunes server and emulator with multi-room capabilities";
118 license = lib.licenses.mit;
119 mainProgram = "shairport-sync";
120 maintainers = with lib.maintainers; [ lnl7 jordanisaacs ];
121 platforms = lib.platforms.unix;