1 { lib, stdenv, fetchurl, pkg-config
2 , ncurses, db , popt, libtool
3 , libiconv, CoreServices
5 , alsaSupport ? (!stdenv.isDarwin), alsa-lib
6 , pulseSupport ? true, libpulseaudio, autoreconfHook
7 , jackSupport ? true, libjack2
10 , aacSupport ? true, faad2, libid3tag
11 , flacSupport ? true, flac
12 , midiSupport ? true, timidity
13 , modplugSupport ? true, libmodplug
14 , mp3Support ? true, libmad
15 , musepackSupport ? true, libmpc, libmpcdec, taglib
16 , vorbisSupport ? true, libvorbis
17 , speexSupport ? true, speex
18 , ffmpegSupport ? true, ffmpeg_4
19 , sndfileSupport ? true, libsndfile
20 , wavpackSupport ? true, wavpack
22 , curlSupport ? true, curl
23 , samplerateSupport ? true, libsamplerate
27 stdenv.mkDerivation rec {
33 url = "http://ftp.daper.net/pub/soft/moc/stable/moc-${version}.tar.bz2";
34 sha256 = "026v977kwb0wbmlmf6mnik328plxg8wykfx9ryvqhirac0aq39pk";
38 ++ lib.optional ffmpegSupport ./moc-ffmpeg4.patch
39 ++ lib.optional pulseSupport ./pulseaudio.patch;
41 nativeBuildInputs = [ pkg-config ]
42 ++ lib.optional pulseSupport autoreconfHook;
44 buildInputs = [ ncurses db popt libtool ]
46 ++ lib.optional alsaSupport alsa-lib
47 ++ lib.optional pulseSupport libpulseaudio
48 ++ lib.optional jackSupport libjack2
50 ++ lib.optional (aacSupport || mp3Support) libid3tag
51 ++ lib.optional aacSupport faad2
52 ++ lib.optional flacSupport flac
53 ++ lib.optional midiSupport timidity
54 ++ lib.optional modplugSupport libmodplug
55 ++ lib.optional mp3Support libmad
56 ++ lib.optionals musepackSupport [ libmpc libmpcdec taglib ]
57 ++ lib.optional vorbisSupport libvorbis
58 ++ lib.optional speexSupport speex
59 ++ lib.optional ffmpegSupport ffmpeg_4
60 ++ lib.optional sndfileSupport libsndfile
61 ++ lib.optional wavpackSupport wavpack
63 ++ lib.optional curlSupport curl
64 ++ lib.optional samplerateSupport libsamplerate
65 ++ lib.optionals stdenv.isDarwin [ libiconv CoreServices ];
69 (lib.withFeature alsaSupport "alsa")
70 (lib.withFeature pulseSupport "pulse")
71 (lib.withFeature jackSupport "jack")
72 (lib.withFeature ossSupport "oss")
74 (lib.withFeature aacSupport "aac")
75 (lib.withFeature flacSupport "flac")
76 (lib.withFeature midiSupport "timidity")
77 (lib.withFeature modplugSupport "modplug")
78 (lib.withFeature mp3Support "mp3")
79 (lib.withFeature musepackSupport "musepack")
80 (lib.withFeature vorbisSupport "vorbis")
81 (lib.withFeature speexSupport "speex")
82 (lib.withFeature ffmpegSupport "ffmpeg")
83 (lib.withFeature sndfileSupport "sndfile")
84 (lib.withFeature wavpackSupport "wavpack")
86 (lib.withFeature curlSupport "curl")
87 (lib.withFeature samplerateSupport "samplerate")
88 ("--enable-debug=" + (if withDebug then "yes" else "no"))
94 description = "An ncurses console audio player designed to be powerful and easy to use";
95 homepage = "http://moc.daper.net/";
96 license = licenses.gpl2;
97 maintainers = with maintainers; [ aethelz pSub jagajaga ];
98 platforms = platforms.unix;