forked from mirrors/nixpkgs
mpd: fix build on darwin
* disable systemd * disable alsaLib * disable ffado * compile with gccApple * disable libmad
This commit is contained in:
parent
481be8185f
commit
5c8a44fd18
|
@ -18,8 +18,7 @@
|
|||
, samplerateSupport ? true, libsamplerate
|
||||
, mmsSupport ? true, libmms
|
||||
, mpg123Support ? true, mpg123
|
||||
, aacSupport ? true, faad2
|
||||
}:
|
||||
, aacSupport ? true, faad2 }:
|
||||
|
||||
let
|
||||
|
||||
|
@ -28,17 +27,20 @@ let
|
|||
mkFlag = c: f: if c then "--enable-${f}" else "--disable-${f}";
|
||||
|
||||
in stdenv.mkDerivation rec {
|
||||
name = "mpd-0.17.3";
|
||||
name = "mpd-0.17.4";
|
||||
src = fetchurl {
|
||||
url = "mirror://sourceforge/musicpd/${name}.tar.bz2";
|
||||
sha256 = "1iilimlyhw22lpbqiab4qprznxg9c4d68fkrr9jww765b4c7x1ip";
|
||||
url = "http://www.musicpd.org/download/mpd/stable/${name}.tar.gz";
|
||||
sha256 = "06diyprg65xx0c0bgxdwlgrc5bhwy6cf39rabwnv9ikhimh94ir3";
|
||||
};
|
||||
|
||||
buildInputs = [ pkgconfig glib systemd ]
|
||||
++ opt alsaSupport alsaLib
|
||||
buildInputs = [ pkgconfig glib ]
|
||||
++ opt (!stdenv.isDarwin) systemd
|
||||
++ opt (!stdenv.isDarwin && alsaSupport) alsaLib
|
||||
++ opt flacSupport flac
|
||||
++ opt vorbisSupport libvorbis
|
||||
++ opt madSupport libmad
|
||||
# using libmad to decode mp3 files on darwin is causing a segfault -- there
|
||||
# is probably a solution, but I'm disabling it for now
|
||||
++ opt (!stdenv.isDarwin && madSupport) libmad
|
||||
++ opt id3tagSupport libid3tag
|
||||
++ opt mikmodSupport libmikmod
|
||||
++ opt shoutSupport libshout
|
||||
|
@ -47,7 +49,7 @@ in stdenv.mkDerivation rec {
|
|||
++ opt soupSupport libsoup
|
||||
++ opt bzip2Support bzip2
|
||||
++ opt audiofileSupport audiofile
|
||||
++ opt ffadoSupport ffado
|
||||
++ opt (!stdenv.isDarwin && ffadoSupport) ffado
|
||||
++ opt ffmpegSupport ffmpeg
|
||||
++ opt fluidsynthSupport fluidsynth
|
||||
++ opt samplerateSupport libsamplerate
|
||||
|
@ -56,45 +58,47 @@ in stdenv.mkDerivation rec {
|
|||
++ opt aacSupport faad2
|
||||
++ opt zipSupport zziplib;
|
||||
|
||||
configureFlags = [
|
||||
"--with-systemdsystemunitdir=$(out)/etc/systemd/system"
|
||||
(mkFlag alsaSupport "alsa")
|
||||
(mkFlag flacSupport "flac")
|
||||
(mkFlag vorbisSupport "vorbis")
|
||||
(mkFlag vorbisSupport "vorbis-encoder")
|
||||
(mkFlag madSupport "mad")
|
||||
(mkFlag mikmodSupport "mikmod")
|
||||
(mkFlag id3tagSupport "id3")
|
||||
(mkFlag shoutSupport "shout")
|
||||
(mkFlag sqliteSupport "sqlite")
|
||||
(mkFlag curlSupport "curl")
|
||||
(mkFlag soupSupport "soup")
|
||||
(mkFlag audiofileSupport "audiofile")
|
||||
(mkFlag bzip2Support "bzip2")
|
||||
(mkFlag ffadoSupport "ffado")
|
||||
(mkFlag ffmpegSupport "ffmpeg")
|
||||
(mkFlag fluidsynthSupport "fluidsynth")
|
||||
(mkFlag zipSupport "zzip")
|
||||
(mkFlag samplerateSupport "lsr")
|
||||
(mkFlag mmsSupport "mms")
|
||||
(mkFlag mpg123Support "mpg123")
|
||||
(mkFlag aacSupport "aac")
|
||||
];
|
||||
configureFlags =
|
||||
[ (mkFlag (!stdenv.isDarwin && alsaSupport) "alsa")
|
||||
(mkFlag flacSupport "flac")
|
||||
(mkFlag vorbisSupport "vorbis")
|
||||
(mkFlag vorbisSupport "vorbis-encoder")
|
||||
(mkFlag (!stdenv.isDarwin && madSupport) "mad")
|
||||
(mkFlag mikmodSupport "mikmod")
|
||||
(mkFlag id3tagSupport "id3")
|
||||
(mkFlag shoutSupport "shout")
|
||||
(mkFlag sqliteSupport "sqlite")
|
||||
(mkFlag curlSupport "curl")
|
||||
(mkFlag soupSupport "soup")
|
||||
(mkFlag audiofileSupport "audiofile")
|
||||
(mkFlag bzip2Support "bzip2")
|
||||
(mkFlag (!stdenv.isDarwin && ffadoSupport) "ffado")
|
||||
(mkFlag ffmpegSupport "ffmpeg")
|
||||
(mkFlag fluidsynthSupport "fluidsynth")
|
||||
(mkFlag zipSupport "zzip")
|
||||
(mkFlag samplerateSupport "lsr")
|
||||
(mkFlag mmsSupport "mms")
|
||||
(mkFlag mpg123Support "mpg123")
|
||||
(mkFlag aacSupport "aac")
|
||||
"--enable-debugging" ]
|
||||
++ opt (!stdenv.isDarwin)
|
||||
"--with-systemdsystemunitdir=$(out)/etc/systemd/system";
|
||||
|
||||
NIX_LDFLAGS = ''
|
||||
${if shoutSupport then "-lshout" else ""}
|
||||
'';
|
||||
|
||||
meta = {
|
||||
meta = with stdenv.lib; {
|
||||
description = "A flexible, powerful daemon for playing music";
|
||||
homepage = http://mpd.wikia.com/wiki/Music_Player_Daemon_Wiki;
|
||||
license = licenses.gpl2;
|
||||
maintainers = with maintainers; [ astsmtl ];
|
||||
platforms = platforms.unix;
|
||||
|
||||
longDescription = ''
|
||||
Music Player Daemon (MPD) is a flexible, powerful daemon for playing
|
||||
music. Through plugins and libraries it can play a variety of sound
|
||||
files while being controlled by its network protocol.
|
||||
'';
|
||||
homepage = http://mpd.wikia.com/wiki/Music_Player_Daemon_Wiki;
|
||||
license = "GPLv2";
|
||||
maintainers = with stdenv.lib.maintainers; [ astsmtl ];
|
||||
platforms = with stdenv.lib.platforms; linux;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -5902,7 +5902,13 @@ let
|
|||
|
||||
mod_wsgi = callPackage ../servers/http/apache-modules/mod_wsgi { };
|
||||
|
||||
mpd = callPackage ../servers/mpd { };
|
||||
mpd = callPackage ../servers/mpd {
|
||||
# resolve the "stray '@' in program" errors
|
||||
stdenv = if stdenv.isDarwin
|
||||
then overrideGCC stdenv gccApple
|
||||
else stdenv;
|
||||
};
|
||||
|
||||
mpd_clientlib = callPackage ../servers/mpd/clientlib.nix { };
|
||||
|
||||
miniHttpd = callPackage ../servers/http/mini-httpd {};
|
||||
|
|
Loading…
Reference in a new issue