1 { lib, stdenv, fetchurl, makeWrapper, python3, alsa-utils, timidity }:
3 stdenv.mkDerivation rec {
8 url = "https://www.mellowood.ca/mma/mma-bin-${version}.tar.gz";
9 sha256 = "sha256-5YzdaZ499AGiKAPUsgBCj3AQ9s0WlfgAbHhOQSOLLO8=";
12 nativeBuildInputs = [ makeWrapper ];
13 buildInputs = [ python3 alsa-utils timidity ];
16 sed -i 's@/usr/bin/aplaymidi@/${alsa-utils}/bin/aplaymidi@g' mma-splitrec
17 sed -i 's@/usr/bin/aplaymidi@/${alsa-utils}/bin/aplaymidi@g' util/mma-splitrec.py
18 sed -i 's@/usr/bin/arecord@/${alsa-utils}/bin/arecord@g' mma-splitrec
19 sed -i 's@/usr/bin/arecord@/${alsa-utils}/bin/arecord@g' util/mma-splitrec.py
20 sed -i 's@/usr/bin/timidity@/${timidity}/bin/timidity@g' mma-splitrec
21 sed -i 's@/usr/bin/timidity@/${timidity}/bin/timidity@g' util/mma-splitrec.py
22 find . -type f | xargs sed -i 's@/usr/bin/env python@${python3.interpreter}@g'
23 find . -type f | xargs sed -i 's@/usr/bin/python3@${python3.interpreter}@g'
27 mkdir -p $out/{bin,share/mma,share/man/man1,share/man/man8}
30 cp mma.py $out/bin/mma
31 cp mma-gb $out/bin/mma-gb
32 cp mma-libdoc $out/bin/mma-libdoc
33 cp mma-renum $out/bin/mma-renum
34 cp mma-splitrec $out/bin/mma-splitrec
35 cp util/mma-mnx.py $out/bin/mma-mnx
36 cp util/mma-rm2std.py $out/bin/mma-rm2std
37 cp util/mmatabs.py $out/bin/mmatabs
38 cp util/mup2mma.py $out/bin/mup2mma
39 cp util/pg2mma.py $out/bin/pg2mma
40 cp util/synthsplit.py $out/bin/mma-synthsplit
41 cp -r {docs,egs,includes,lib,MMA,text,plugins} $out/share/mma
43 cp util/README.* $out/share/mma/docs
44 mv $out/share/mma/docs/man/mma-libdoc.8 $out/share/man/man8
45 mv $out/share/mma/docs/man/mma-renum.1 $out/share/man/man1
46 mv $out/share/mma/docs/man/mma.1 $out/share/man/man1
47 mv $out/share/mma/docs/man/mma-gb.1 $out/share/man/man1
48 rm -rf $out/share/mma/docs/man
49 find $out -type f | xargs sed -i "s@/usr/share/mma@$out/share/mma@g"
53 PYTHONPATH=$out/share/mma/:$PYTHONPATH
54 for f in $out/bin/*; do
56 --prefix PYTHONPATH : $PYTHONPATH
64 "Creates MIDI tracks for a soloist to perform over from a user supplied file containing chords";
65 homepage = "https://www.mellowood.ca/mma/index.html";
66 license = lib.licenses.gpl2;
67 maintainers = [ lib.maintainers.magnetophon ];
68 platforms = lib.platforms.linux;