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