From 7a687b7dbe4c09fc72e6f6e4beab2d0596e8bde7 Mon Sep 17 00:00:00 2001 From: Reed Date: Wed, 1 Jun 2022 18:15:40 -0400 Subject: [PATCH] shairport-sync: add dbus, mpris, and metadata flags --- pkgs/servers/shairport-sync/default.nix | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/pkgs/servers/shairport-sync/default.nix b/pkgs/servers/shairport-sync/default.nix index ed3c0dcc7f9d..dbe478568ac6 100644 --- a/pkgs/servers/shairport-sync/default.nix +++ b/pkgs/servers/shairport-sync/default.nix @@ -1,6 +1,12 @@ -{ lib, stdenv, fetchFromGitHub, autoreconfHook, openssl, avahi, alsa-lib -, libdaemon, popt, pkg-config, libconfig, libpulseaudio, soxr }: +{ lib, stdenv, fetchFromGitHub +, autoreconfHook, pkg-config +, openssl, avahi, alsa-lib, glib, libdaemon, popt, libconfig, libpulseaudio, soxr +, enableDbus ? stdenv.isLinux +, enableMetadata ? false +, enableMpris ? stdenv.isLinux +}: +with lib; stdenv.mkDerivation rec { version = "3.3.9"; pname = "shairport-sync"; @@ -23,7 +29,12 @@ stdenv.mkDerivation rec { libconfig libpulseaudio soxr - ]; + ] ++ optional stdenv.isLinux glib; + + prePatch = '' + 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 + ''; enableParallelBuilding = true; @@ -32,7 +43,10 @@ stdenv.mkDerivation rec { "--with-avahi" "--with-ssl=openssl" "--with-soxr" "--without-configfiles" "--sysconfdir=/etc" - ]; + ] + ++ optional enableDbus "--with-dbus-interface" + ++ optional enableMetadata "--with-metadata" + ++ optional enableMpris "--with-mpris-interface"; meta = with lib; { inherit (src.meta) homepage;