From 22fb22e7439d98474048041abbd506f7975c3c4e Mon Sep 17 00:00:00 2001 From: Michael Kuryshev Date: Sun, 19 Jul 2015 17:13:01 +0300 Subject: [PATCH 1/2] mpd: disable libjack2 and libpulseaudio on darwin --- pkgs/servers/mpd/default.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/servers/mpd/default.nix b/pkgs/servers/mpd/default.nix index c7380b023067..71d8c80d4ecb 100644 --- a/pkgs/servers/mpd/default.nix +++ b/pkgs/servers/mpd/default.nix @@ -60,8 +60,8 @@ in stdenv.mkDerivation rec { ++ opt mpg123Support mpg123 ++ opt aacSupport faad2 ++ opt zipSupport zziplib - ++ opt pulseaudioSupport libpulseaudio - ++ opt jackSupport libjack2 + ++ opt (!stdenv.isDarwin && pulseaudioSupport) libpulseaudio + ++ opt (!stdenv.isDarwin && jackSupport) libjack2 ++ opt gmeSupport game-music-emu ++ opt icuSupport icu ++ opt clientSupport mpd_clientlib @@ -87,8 +87,8 @@ in stdenv.mkDerivation rec { (mkFlag mmsSupport "mms") (mkFlag mpg123Support "mpg123") (mkFlag aacSupport "aac") - (mkFlag pulseaudioSupport "pulse") - (mkFlag jackSupport "jack") + (mkFlag (!stdenv.isDarwin && pulseaudioSupport) "pulse") + (mkFlag (!stdenv.isDarwin && jackSupport) "jack") (mkFlag stdenv.isDarwin "osx") (mkFlag icuSupport "icu") (mkFlag gmeSupport "gme") From 3be214d32466f7eb96f94cc3e287abce266e523f Mon Sep 17 00:00:00 2001 From: Michael Kuryshev Date: Sun, 19 Jul 2015 17:26:06 +0300 Subject: [PATCH 2/2] mpd: reenable c++ exceptions in configure resolves #8880 --- .../mpd/darwin-enable-cxx-exceptions.patch | 142 ++++++++++++++++++ pkgs/servers/mpd/default.nix | 2 + 2 files changed, 144 insertions(+) create mode 100644 pkgs/servers/mpd/darwin-enable-cxx-exceptions.patch diff --git a/pkgs/servers/mpd/darwin-enable-cxx-exceptions.patch b/pkgs/servers/mpd/darwin-enable-cxx-exceptions.patch new file mode 100644 index 000000000000..db330a913cbd --- /dev/null +++ b/pkgs/servers/mpd/darwin-enable-cxx-exceptions.patch @@ -0,0 +1,142 @@ +diff -Naur mpd-0.19.9.orig/configure mpd-0.19.9/configure +--- mpd-0.19.9.orig/configure 2015-01-26 19:47:27.000000000 +0000 ++++ mpd-0.19.9/configure 2015-01-26 19:47:27.000000000 +0000 +@@ -17113,138 +17113,6 @@ + done + + +-if test x$no_exceptions = xyes; then +- +- +- +- +-for flag in -fno-exceptions; do +- as_CACHEVAR=`$as_echo "ax_cv_check_cxxflags__$flag" | $as_tr_sh` +-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C++ compiler accepts $flag" >&5 +-$as_echo_n "checking whether C++ compiler accepts $flag... " >&6; } +-if eval \${$as_CACHEVAR+:} false; then : +- $as_echo_n "(cached) " >&6 +-else +- +- ax_check_save_flags=$CXXFLAGS +- CXXFLAGS="$CXXFLAGS $flag" +- cat confdefs.h - <<_ACEOF >conftest.$ac_ext +-/* end confdefs.h. */ +- +-int +-main () +-{ +- +- ; +- return 0; +-} +-_ACEOF +-if ac_fn_cxx_try_compile "$LINENO"; then : +- eval "$as_CACHEVAR=yes" +-else +- eval "$as_CACHEVAR=no" +-fi +-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +- CXXFLAGS=$ax_check_save_flags +-fi +-eval ac_res=\$$as_CACHEVAR +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +-$as_echo "$ac_res" >&6; } +-if test x"`eval 'as_val=${'$as_CACHEVAR'};$as_echo "$as_val"'`" = xyes; then : +- if ${CXXFLAGS+:} false; then : +- case " $CXXFLAGS " in +- *" $flag "*) +- { { $as_echo "$as_me:${as_lineno-$LINENO}: : CXXFLAGS already contains \$flag"; } >&5 +- (: CXXFLAGS already contains $flag) 2>&5 +- ac_status=$? +- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 +- test $ac_status = 0; } +- ;; +- *) +- { { $as_echo "$as_me:${as_lineno-$LINENO}: : CXXFLAGS=\"\$CXXFLAGS \$flag\""; } >&5 +- (: CXXFLAGS="$CXXFLAGS $flag") 2>&5 +- ac_status=$? +- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 +- test $ac_status = 0; } +- CXXFLAGS="$CXXFLAGS $flag" +- ;; +- esac +-else +- CXXFLAGS="$flag" +-fi +- +-else +- : +-fi +- +-done +- +- +- +- +- +-for flag in -fno-rtti; do +- as_CACHEVAR=`$as_echo "ax_cv_check_cxxflags__$flag" | $as_tr_sh` +-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C++ compiler accepts $flag" >&5 +-$as_echo_n "checking whether C++ compiler accepts $flag... " >&6; } +-if eval \${$as_CACHEVAR+:} false; then : +- $as_echo_n "(cached) " >&6 +-else +- +- ax_check_save_flags=$CXXFLAGS +- CXXFLAGS="$CXXFLAGS $flag" +- cat confdefs.h - <<_ACEOF >conftest.$ac_ext +-/* end confdefs.h. */ +- +-int +-main () +-{ +- +- ; +- return 0; +-} +-_ACEOF +-if ac_fn_cxx_try_compile "$LINENO"; then : +- eval "$as_CACHEVAR=yes" +-else +- eval "$as_CACHEVAR=no" +-fi +-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +- CXXFLAGS=$ax_check_save_flags +-fi +-eval ac_res=\$$as_CACHEVAR +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +-$as_echo "$ac_res" >&6; } +-if test x"`eval 'as_val=${'$as_CACHEVAR'};$as_echo "$as_val"'`" = xyes; then : +- if ${CXXFLAGS+:} false; then : +- case " $CXXFLAGS " in +- *" $flag "*) +- { { $as_echo "$as_me:${as_lineno-$LINENO}: : CXXFLAGS already contains \$flag"; } >&5 +- (: CXXFLAGS already contains $flag) 2>&5 +- ac_status=$? +- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 +- test $ac_status = 0; } +- ;; +- *) +- { { $as_echo "$as_me:${as_lineno-$LINENO}: : CXXFLAGS=\"\$CXXFLAGS \$flag\""; } >&5 +- (: CXXFLAGS="$CXXFLAGS $flag") 2>&5 +- ac_status=$? +- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 +- test $ac_status = 0; } +- CXXFLAGS="$CXXFLAGS $flag" +- ;; +- esac +-else +- CXXFLAGS="$flag" +-fi +- +-else +- : +-fi +- +-done +- +-fi + + + diff --git a/pkgs/servers/mpd/default.nix b/pkgs/servers/mpd/default.nix index 71d8c80d4ecb..7f088331b1df 100644 --- a/pkgs/servers/mpd/default.nix +++ b/pkgs/servers/mpd/default.nix @@ -38,6 +38,8 @@ in stdenv.mkDerivation rec { sha256 = "0vzj365s4j0pw5w37lfhx3dmpkdp85driravsvx8rlrw0lii91a7"; }; + patches = stdenv.lib.optionals stdenv.isDarwin ./darwin-enable-cxx-exceptions.patch; + buildInputs = [ pkgconfig glib boost ] ++ opt stdenv.isLinux systemd ++ opt (stdenv.isLinux && alsaSupport) alsaLib