2019-05-03 13:38:25 +03:00
|
|
|
{ stdenv, fetchurl, pkgconfig
|
|
|
|
, ncurses, db , popt, libtool
|
|
|
|
# Sound sub-systems
|
|
|
|
, alsaSupport ? true, alsaLib
|
|
|
|
, pulseSupport ? true, libpulseaudio, autoreconfHook
|
|
|
|
, jackSupport ? true, libjack2
|
|
|
|
, ossSupport ? true
|
|
|
|
# Audio formats
|
|
|
|
, aacSupport ? true, faad2, libid3tag
|
|
|
|
, flacSupport ? true, flac
|
|
|
|
, midiSupport ? true, timidity
|
|
|
|
, modplugSupport ? true, libmodplug
|
|
|
|
, mp3Support ? true, libmad
|
|
|
|
, musepackSupport ? true, libmpc, libmpcdec, taglib
|
|
|
|
, vorbisSupport ? true, libvorbis
|
|
|
|
, speexSupport ? true, speex
|
2020-06-07 15:39:09 +03:00
|
|
|
, ffmpegSupport ? true, ffmpeg_3
|
2019-05-03 13:38:25 +03:00
|
|
|
, sndfileSupport ? true, libsndfile
|
|
|
|
, wavpackSupport ? true, wavpack
|
|
|
|
# Misc
|
|
|
|
, withffmpeg4 ? false, ffmpeg_4
|
|
|
|
, curlSupport ? true, curl
|
|
|
|
, samplerateSupport ? true, libsamplerate
|
|
|
|
, withDebug ? false
|
2014-07-23 00:06:44 +04:00
|
|
|
}:
|
2013-12-15 01:16:18 +04:00
|
|
|
|
2019-05-03 13:38:25 +03:00
|
|
|
let
|
|
|
|
opt = stdenv.lib.optional;
|
|
|
|
mkFlag = c: f: if c then "--with-${f}" else "--without-${f}";
|
|
|
|
|
|
|
|
in stdenv.mkDerivation rec {
|
|
|
|
|
2019-08-15 15:41:18 +03:00
|
|
|
pname = "moc";
|
2016-12-11 21:50:37 +03:00
|
|
|
version = "2.5.2";
|
2013-12-15 01:16:18 +04:00
|
|
|
|
|
|
|
src = fetchurl {
|
2014-09-05 00:28:41 +04:00
|
|
|
url = "http://ftp.daper.net/pub/soft/moc/stable/moc-${version}.tar.bz2";
|
2016-12-11 21:50:37 +03:00
|
|
|
sha256 = "026v977kwb0wbmlmf6mnik328plxg8wykfx9ryvqhirac0aq39pk";
|
2013-12-15 01:16:18 +04:00
|
|
|
};
|
|
|
|
|
2019-05-03 13:38:25 +03:00
|
|
|
patches = []
|
|
|
|
++ opt withffmpeg4 ./moc-ffmpeg4.patch
|
|
|
|
++ opt pulseSupport ./pulseaudio.patch;
|
|
|
|
|
|
|
|
nativeBuildInputs = [ pkgconfig ]
|
|
|
|
++ opt pulseSupport autoreconfHook;
|
|
|
|
|
|
|
|
buildInputs = [ ncurses db popt libtool ]
|
|
|
|
# Sound sub-systems
|
|
|
|
++ opt alsaSupport alsaLib
|
|
|
|
++ opt pulseSupport libpulseaudio
|
|
|
|
++ opt jackSupport libjack2
|
|
|
|
# Audio formats
|
|
|
|
++ opt (aacSupport || mp3Support) libid3tag
|
|
|
|
++ opt aacSupport faad2
|
|
|
|
++ opt flacSupport flac
|
|
|
|
++ opt midiSupport timidity
|
|
|
|
++ opt modplugSupport libmodplug
|
|
|
|
++ opt mp3Support libmad
|
2019-11-10 04:13:39 +03:00
|
|
|
++ stdenv.lib.optionals musepackSupport [ libmpc libmpcdec taglib ]
|
2019-05-03 13:38:25 +03:00
|
|
|
++ opt vorbisSupport libvorbis
|
|
|
|
++ opt speexSupport speex
|
2020-06-07 15:39:09 +03:00
|
|
|
++ opt (ffmpegSupport && !withffmpeg4) ffmpeg_3
|
2019-05-03 13:38:25 +03:00
|
|
|
++ opt (ffmpegSupport && withffmpeg4) ffmpeg_4
|
|
|
|
++ opt sndfileSupport libsndfile
|
|
|
|
++ opt wavpackSupport wavpack
|
|
|
|
# Misc
|
|
|
|
++ opt curlSupport curl
|
|
|
|
++ opt samplerateSupport libsamplerate;
|
2016-11-17 23:35:05 +03:00
|
|
|
|
2019-05-03 13:38:25 +03:00
|
|
|
configureFlags = [
|
|
|
|
# Sound sub-systems
|
|
|
|
(mkFlag alsaSupport "alsa")
|
|
|
|
(mkFlag pulseSupport "pulse")
|
|
|
|
(mkFlag jackSupport "jack")
|
|
|
|
(mkFlag ossSupport "oss")
|
|
|
|
# Audio formats
|
|
|
|
(mkFlag aacSupport "aac")
|
|
|
|
(mkFlag flacSupport "flac")
|
|
|
|
(mkFlag midiSupport "timidity")
|
|
|
|
(mkFlag modplugSupport "modplug")
|
|
|
|
(mkFlag mp3Support "mp3")
|
|
|
|
(mkFlag musepackSupport "musepack")
|
|
|
|
(mkFlag vorbisSupport "vorbis")
|
|
|
|
(mkFlag speexSupport "speex")
|
|
|
|
(mkFlag ffmpegSupport "ffmpeg")
|
|
|
|
(mkFlag sndfileSupport "sndfile")
|
|
|
|
(mkFlag wavpackSupport "wavpack")
|
|
|
|
# Misc
|
|
|
|
(mkFlag curlSupport "curl")
|
|
|
|
(mkFlag samplerateSupport "samplerate")
|
|
|
|
("--enable-debug=" + (if withDebug then "yes" else "no"))
|
|
|
|
"--disable-cache"
|
|
|
|
"--without-rcc"
|
2014-07-23 00:06:44 +04:00
|
|
|
];
|
2013-12-15 01:16:18 +04:00
|
|
|
|
2014-09-05 00:28:41 +04:00
|
|
|
meta = with stdenv.lib; {
|
2014-08-24 18:21:08 +04:00
|
|
|
description = "An ncurses console audio player designed to be powerful and easy to use";
|
2020-04-01 04:11:51 +03:00
|
|
|
homepage = "http://moc.daper.net/";
|
2014-09-05 00:28:41 +04:00
|
|
|
license = licenses.gpl2;
|
2019-05-03 13:38:25 +03:00
|
|
|
maintainers = with maintainers; [ aethelz pSub jagajaga ];
|
2014-09-05 00:28:41 +04:00
|
|
|
platforms = platforms.linux;
|
2013-12-15 01:16:18 +04:00
|
|
|
};
|
|
|
|
}
|