texstudio: 4.8.4 -> 4.8.5 (#365076)
[NixPkgs.git] / pkgs / applications / audio / moc / default.nix
blob581ace1d3c3c0b1ac57c12d49b35820c0ed4632a
2   lib,
3   stdenv,
4   fetchsvn,
5   fetchpatch2,
6   pkg-config,
7   autoreconfHook,
8   autoconf-archive,
9   ncurses,
10   db,
11   popt,
12   libtool,
13   libiconv,
14   CoreServices,
15   # Sound sub-systems
16   alsaSupport ? (!stdenv.hostPlatform.isDarwin),
17   alsa-lib,
18   pulseSupport ? true,
19   libpulseaudio,
20   jackSupport ? true,
21   libjack2,
22   ossSupport ? true,
23   # Audio formats
24   aacSupport ? true,
25   faad2,
26   libid3tag,
27   flacSupport ? true,
28   flac,
29   midiSupport ? true,
30   timidity,
31   modplugSupport ? true,
32   libmodplug,
33   mp3Support ? true,
34   libmad,
35   musepackSupport ? true,
36   libmpc,
37   libmpcdec,
38   taglib,
39   vorbisSupport ? true,
40   libvorbis,
41   speexSupport ? true,
42   speex,
43   ffmpegSupport ? true,
44   ffmpeg,
45   sndfileSupport ? true,
46   libsndfile,
47   wavpackSupport ? true,
48   wavpack,
49   # Misc
50   curlSupport ? true,
51   curl,
52   samplerateSupport ? true,
53   libsamplerate,
54   withDebug ? false,
57 stdenv.mkDerivation {
58   pname = "moc";
59   version = "2.6-alpha3-unstable-2019-09-14";
61   src = fetchsvn {
62     url = "svn://svn.daper.net/moc/trunk";
63     rev = "3005";
64     hash = "sha256-JksJxHQgQ8hPTFtLvEvZuFh2lflDNrEmDTMWWwVnjZQ=";
65   };
67   patches = [
68     # FFmpeg 6 support
69     (fetchpatch2 {
70       url = "https://cygwin.com/cgit/cygwin-packages/moc/plain/Support-for-recent-ffmpeg-change.patch?id=ab70f1306b8416852915be4347003aac3bdc216";
71       hash = "sha256-5hLEFBJ+7Nvxn6pNj4bngcg2qJsCzxiuP6yEj+7tvs0=";
72       stripLen = 1;
73     })
75     # FFmpeg 7 support
76     (fetchpatch2 {
77       url = "https://cygwin.com/cgit/cygwin-packages/moc/plain/ffmpeg-7.0.patch?id=ab70f1306b8416852915be4347003aac3bdc216e";
78       hash = "sha256-dYw6DNyw61MGfv+GdBz5Dtrr9fVph1tf7vxexWONwF8=";
79       stripLen = 1;
80     })
82     ./use-ax-check-compile-flag.patch
83   ] ++ lib.optional pulseSupport ./pulseaudio.patch;
85   postPatch = ''
86     rm m4/*
87   '';
89   nativeBuildInputs = [
90     pkg-config
91     autoreconfHook
92     autoconf-archive
93   ];
95   buildInputs =
96     [
97       ncurses
98       db
99       popt
100       libtool
101     ]
102     # Sound sub-systems
103     ++ lib.optional alsaSupport alsa-lib
104     ++ lib.optional pulseSupport libpulseaudio
105     ++ lib.optional jackSupport libjack2
106     # Audio formats
107     ++ lib.optional (aacSupport || mp3Support) libid3tag
108     ++ lib.optional aacSupport faad2
109     ++ lib.optional flacSupport flac
110     ++ lib.optional midiSupport timidity
111     ++ lib.optional modplugSupport libmodplug
112     ++ lib.optional mp3Support libmad
113     ++ lib.optionals musepackSupport [
114       libmpc
115       libmpcdec
116       taglib
117     ]
118     ++ lib.optional vorbisSupport libvorbis
119     ++ lib.optional speexSupport speex
120     ++ lib.optional ffmpegSupport ffmpeg
121     ++ lib.optional sndfileSupport libsndfile
122     ++ lib.optional wavpackSupport wavpack
123     # Misc
124     ++ lib.optional curlSupport curl
125     ++ lib.optional samplerateSupport libsamplerate
126     ++ lib.optionals stdenv.hostPlatform.isDarwin [
127       libiconv
128       CoreServices
129     ];
131   configureFlags = [
132     # Sound sub-systems
133     (lib.withFeature alsaSupport "alsa")
134     (lib.withFeature pulseSupport "pulse")
135     (lib.withFeature jackSupport "jack")
136     (lib.withFeature ossSupport "oss")
137     # Audio formats
138     (lib.withFeature aacSupport "aac")
139     (lib.withFeature flacSupport "flac")
140     (lib.withFeature midiSupport "timidity")
141     (lib.withFeature modplugSupport "modplug")
142     (lib.withFeature mp3Support "mp3")
143     (lib.withFeature musepackSupport "musepack")
144     (lib.withFeature vorbisSupport "vorbis")
145     (lib.withFeature speexSupport "speex")
146     (lib.withFeature ffmpegSupport "ffmpeg")
147     (lib.withFeature sndfileSupport "sndfile")
148     (lib.withFeature wavpackSupport "wavpack")
149     # Misc
150     (lib.withFeature curlSupport "curl")
151     (lib.withFeature samplerateSupport "samplerate")
152     ("--enable-debug=" + (if withDebug then "yes" else "no"))
153     "--disable-cache"
154     "--without-rcc"
155   ];
157   meta = with lib; {
158     description = "Terminal audio player designed to be powerful and easy to use";
159     homepage = "http://moc.daper.net/";
160     license = licenses.gpl2;
161     maintainers = with maintainers; [
162       aethelz
163       pSub
164       jagajaga
165     ];
166     platforms = platforms.unix;
167     mainProgram = "mocp";
168   };