Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at 16.09 65 lines 1.7 kB view raw
1{ composableDerivation, stdenv, fetchurl, alsaLib, libjack2, ncurses }: 2 3let inherit (composableDerivation) edf; in 4 5composableDerivation.composableDerivation {} { 6 7 name = "timidity-2.14.0"; 8 9 src = fetchurl { 10 url = mirror://sourceforge/timidity/TiMidity++-2.14.0.tar.bz2; 11 sha256 = "0xk41w4qbk23z1fvqdyfblbz10mmxsllw0svxzjw5sa9y11vczzr"; 12 }; 13 14 mergeAttrBy.audioModes = a : b : "${a},${b}"; 15 16 preConfigure = '' 17 configureFlags="$configureFlags --enable-audio=$audioModes" 18 ''; 19 20 # configure still has many more options... 21 flags = { 22 oss = { 23 audioModes = "oss"; 24 }; 25 alsa = { 26 audioModes = "alsa"; 27 buildInputs = [alsaLib]; 28 # this is better than /dev/dsp ! 29 configureFlags = ["--with-default-output-mode=alsa"]; 30 }; 31 jack = { 32 audioModes = "jack"; 33 buildInputs = [libjack2]; 34 NIX_LDFLAGS = ["-ljack -L${libjack2}/lib"]; 35 }; 36 } // edf { name = "ncurses"; enable = { buildInputs = [ncurses]; };}; 37 38 cfg = { 39 ncursesSupport = true; 40 41 ossSupport = true; 42 alsaSupport = true; 43 jackSupport = true; 44 }; 45 46 instruments = fetchurl { 47 url = http://www.csee.umbc.edu/pub/midia/instruments.tar.gz; 48 sha256 = "0lsh9l8l5h46z0y8ybsjd4pf6c22n33jsjvapfv3rjlfnasnqw67"; 49 }; 50 51 # the instruments could be compressed (?) 52 postInstall = '' 53 mkdir -p $out/share/timidity/; 54 cp ${./timidity.cfg} $out/share/timidity/timidity.cfg 55 tar --strip-components=1 -xf $instruments -C $out/share/timidity/ 56 ''; 57 58 meta = with stdenv.lib; { 59 homepage = http://sourceforge.net/projects/timidity/; 60 license = licenses.gpl2; 61 description = "A software MIDI renderer"; 62 maintainers = [ maintainers.marcweber ]; 63 platforms = platforms.linux; 64 }; 65}