13 alsaSupport ? stdenv.hostPlatform.isLinux,
15 # simple fallback for everyone else
16 aoSupport ? !stdenv.hostPlatform.isLinux,
20 samplerateSupport ? jackSupport,
24 pulseaudioSupport ? config.pulseaudio or false,
28 mprisSupport ? stdenv.hostPlatform.isLinux,
41 libcdio-paranoia ? null,
44 discidSupport ? false,
54 modplugSupport ? true,
58 tremorSupport ? false,
62 wavpackSupport ? true,
68 faad2 ? null, # already handled by ffmpeg
70 mp4v2 ? null, # ffmpeg does support mp4 better
73 #, vtxSupport ? true, libayemu ? null
76 assert samplerateSupport -> jackSupport;
78 # vorbis and tremor are mutually exclusive
79 assert vorbisSupport -> !tremorSupport;
80 assert tremorSupport -> !vorbisSupport;
99 (mkFlag alsaSupport "CONFIG_ALSA=y" alsa-lib)
100 (mkFlag aoSupport "CONFIG_AO=y" libao)
101 (mkFlag jackSupport "CONFIG_JACK=y" libjack)
102 (mkFlag samplerateSupport "CONFIG_SAMPLERATE=y" libsamplerate)
103 (mkFlag ossSupport "CONFIG_OSS=y" alsa-oss)
104 (mkFlag pulseaudioSupport "CONFIG_PULSE=y" libpulseaudio)
105 (mkFlag sndioSupport "CONFIG_SNDIO=y" sndio)
106 (mkFlag mprisSupport "CONFIG_MPRIS=y" systemd)
108 #(mkFlag artsSupport "CONFIG_ARTS=y")
109 #(mkFlag roarSupport "CONFIG_ROAR=y")
110 #(mkFlag sunSupport "CONFIG_SUN=y")
111 #(mkFlag waveoutSupport "CONFIG_WAVEOUT=y")
114 (mkFlag cddbSupport "CONFIG_CDDB=y" libcddb)
115 (mkFlag cdioSupport "CONFIG_CDIO=y" [
119 (mkFlag cueSupport "CONFIG_CUE=y" libcue)
120 (mkFlag discidSupport "CONFIG_DISCID=y" libdiscid)
121 (mkFlag ffmpegSupport "CONFIG_FFMPEG=y" ffmpeg)
122 (mkFlag flacSupport "CONFIG_FLAC=y" flac)
123 (mkFlag madSupport "CONFIG_MAD=y" libmad)
124 (mkFlag mikmodSupport "CONFIG_MIKMOD=y" libmikmod)
125 (mkFlag modplugSupport "CONFIG_MODPLUG=y" libmodplug)
126 (mkFlag mpcSupport "CONFIG_MPC=y" libmpcdec)
127 (mkFlag tremorSupport "CONFIG_TREMOR=y" tremor)
128 (mkFlag vorbisSupport "CONFIG_VORBIS=y" libvorbis)
129 (mkFlag wavpackSupport "CONFIG_WAVPACK=y" wavpack)
130 (mkFlag opusSupport "CONFIG_OPUS=y" opusfile)
132 (mkFlag mp4Support "CONFIG_MP4=y" mp4v2)
133 (mkFlag aacSupport "CONFIG_AAC=y" faad2)
135 #(mkFlag vtxSupport "CONFIG_VTX=y" libayemu)
139 stdenv.mkDerivation rec {
143 src = fetchFromGitHub {
147 hash = "sha256-8hgibGtkiwzenMI9YImIApRmw2EzTwE6RhglALpUkp4=";
150 nativeBuildInputs = [ pkg-config ];
153 ++ lib.optionals stdenv.hostPlatform.isDarwin [
159 ++ lib.flatten (lib.concatMap (a: a.deps) opts);
161 prefixKey = "prefix=";
165 "HOSTCC=${stdenv.cc.targetPrefix}cc"
166 ] ++ lib.concatMap (a: a.flags) opts;
168 makeFlags = [ "LD=$(CC)" ];
171 description = "Small, fast and powerful console music player for Linux and *BSD";
172 homepage = "https://cmus.github.io/";
173 license = licenses.gpl2;
174 maintainers = [ maintainers.oxij ];
175 platforms = platforms.linux ++ platforms.darwin;