2021-02-05 17:12:51 +00:00
|
|
|
{ lib, stdenv, fetchurl, pkg-config
|
2020-04-24 23:36:52 +00:00
|
|
|
, ncurses, db , popt, libtool
|
2022-04-27 09:35:20 +00:00
|
|
|
, libiconv, CoreServices
|
2020-04-24 23:36:52 +00:00
|
|
|
# Sound sub-systems
|
2022-04-27 09:35:20 +00:00
|
|
|
, alsaSupport ? (!stdenv.isDarwin), alsa-lib
|
2020-04-24 23:36:52 +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
|
2023-03-27 19:17:25 +00:00
|
|
|
, ffmpegSupport ? true, ffmpeg_4
|
2020-04-24 23:36:52 +00:00
|
|
|
, sndfileSupport ? true, libsndfile
|
|
|
|
, wavpackSupport ? true, wavpack
|
|
|
|
# Misc
|
|
|
|
, curlSupport ? true, curl
|
|
|
|
, samplerateSupport ? true, libsamplerate
|
|
|
|
, withDebug ? false
|
|
|
|
}:
|
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
pname = "moc";
|
|
|
|
version = "2.5.2";
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "http://ftp.daper.net/pub/soft/moc/stable/moc-${version}.tar.bz2";
|
|
|
|
sha256 = "026v977kwb0wbmlmf6mnik328plxg8wykfx9ryvqhirac0aq39pk";
|
|
|
|
};
|
|
|
|
|
|
|
|
patches = []
|
2022-08-12 12:06:08 +00:00
|
|
|
++ lib.optional ffmpegSupport ./moc-ffmpeg4.patch
|
|
|
|
++ lib.optional pulseSupport ./pulseaudio.patch;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
nativeBuildInputs = [ pkg-config ]
|
2022-08-12 12:06:08 +00:00
|
|
|
++ lib.optional pulseSupport autoreconfHook;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildInputs = [ ncurses db popt libtool ]
|
|
|
|
# Sound sub-systems
|
2022-08-12 12:06:08 +00:00
|
|
|
++ lib.optional alsaSupport alsa-lib
|
|
|
|
++ lib.optional pulseSupport libpulseaudio
|
|
|
|
++ lib.optional jackSupport libjack2
|
2020-04-24 23:36:52 +00:00
|
|
|
# Audio formats
|
2022-08-12 12:06:08 +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-17 00:15:33 +00:00
|
|
|
++ lib.optionals musepackSupport [ libmpc libmpcdec taglib ]
|
2022-08-12 12:06:08 +00:00
|
|
|
++ lib.optional vorbisSupport libvorbis
|
|
|
|
++ lib.optional speexSupport speex
|
2023-03-27 19:17:25 +00:00
|
|
|
++ lib.optional ffmpegSupport ffmpeg_4
|
2022-08-12 12:06:08 +00:00
|
|
|
++ lib.optional sndfileSupport libsndfile
|
|
|
|
++ lib.optional wavpackSupport wavpack
|
2020-04-24 23:36:52 +00:00
|
|
|
# Misc
|
2022-08-12 12:06:08 +00:00
|
|
|
++ lib.optional curlSupport curl
|
|
|
|
++ lib.optional samplerateSupport libsamplerate
|
2022-04-27 09:35:20 +00:00
|
|
|
++ lib.optionals stdenv.isDarwin [ libiconv CoreServices ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
configureFlags = [
|
|
|
|
# Sound sub-systems
|
2022-08-12 12:06:08 +00:00
|
|
|
(lib.withFeature alsaSupport "alsa")
|
|
|
|
(lib.withFeature pulseSupport "pulse")
|
|
|
|
(lib.withFeature jackSupport "jack")
|
|
|
|
(lib.withFeature ossSupport "oss")
|
2020-04-24 23:36:52 +00:00
|
|
|
# Audio formats
|
2022-08-12 12:06:08 +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")
|
2020-04-24 23:36:52 +00:00
|
|
|
# Misc
|
2022-08-12 12:06:08 +00:00
|
|
|
(lib.withFeature curlSupport "curl")
|
|
|
|
(lib.withFeature samplerateSupport "samplerate")
|
2020-04-24 23:36:52 +00:00
|
|
|
("--enable-debug=" + (if withDebug then "yes" else "no"))
|
|
|
|
"--disable-cache"
|
|
|
|
"--without-rcc"
|
|
|
|
];
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "An ncurses console audio player designed to be powerful and easy to use";
|
|
|
|
homepage = "http://moc.daper.net/";
|
|
|
|
license = licenses.gpl2;
|
|
|
|
maintainers = with maintainers; [ aethelz pSub jagajaga ];
|
2022-04-27 09:35:20 +00:00
|
|
|
platforms = platforms.unix;
|
2024-02-29 20:09:43 +00:00
|
|
|
mainProgram = "mocp";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|