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