2021-06-10 05:10:52 +01:00
|
|
|
{ lib, stdenv, fetchurl, makeWrapper, python3, alsa-utils, timidity }:
|
2016-05-02 20:04:07 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2020-12-13 10:04:09 +00:00
|
|
|
version = "20.12";
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "mma";
|
2016-05-02 20:04:07 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
2018-06-28 19:43:35 +01:00
|
|
|
url = "https://www.mellowood.ca/mma/mma-bin-${version}.tar.gz";
|
2020-12-13 10:04:09 +00:00
|
|
|
sha256 = "18k0hwlqky5x4y461fxmw77gvz7z8jyrvxicrqphsgvwwinzy732";
|
2016-05-02 20:04:07 +01:00
|
|
|
};
|
|
|
|
|
2021-02-07 09:17:39 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
2021-06-10 05:10:52 +01:00
|
|
|
buildInputs = [ python3 alsa-utils timidity ];
|
2016-05-02 20:04:07 +01:00
|
|
|
|
|
|
|
patchPhase = ''
|
2021-06-10 05:10:52 +01:00
|
|
|
sed -i 's@/usr/bin/aplaymidi@/${alsa-utils}/bin/aplaymidi@g' mma-splitrec
|
|
|
|
sed -i 's@/usr/bin/aplaymidi@/${alsa-utils}/bin/aplaymidi@g' util/mma-splitrec.py
|
|
|
|
sed -i 's@/usr/bin/arecord@/${alsa-utils}/bin/arecord@g' mma-splitrec
|
|
|
|
sed -i 's@/usr/bin/arecord@/${alsa-utils}/bin/arecord@g' util/mma-splitrec.py
|
2016-05-02 20:04:07 +01:00
|
|
|
sed -i 's@/usr/bin/timidity@/${timidity}/bin/timidity@g' mma-splitrec
|
|
|
|
sed -i 's@/usr/bin/timidity@/${timidity}/bin/timidity@g' util/mma-splitrec.py
|
2018-08-09 22:07:38 +01:00
|
|
|
find . -type f | xargs sed -i 's@/usr/bin/env python@${python3.interpreter}@g'
|
2020-12-13 10:04:09 +00:00
|
|
|
find . -type f | xargs sed -i 's@/usr/bin/python3@${python3.interpreter}@g'
|
2016-05-02 20:04:07 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/{bin,share/mma,share/man/man1,share/man/man8}
|
|
|
|
mkdir -p $out/etc
|
|
|
|
|
|
|
|
cp mma.py $out/bin/mma
|
|
|
|
cp mma-gb $out/bin/mma-gb
|
|
|
|
cp mma-libdoc $out/bin/mma-libdoc
|
|
|
|
cp mma-renum $out/bin/mma-renum
|
|
|
|
cp mma-splitrec $out/bin/mma-splitrec
|
|
|
|
cp util/mma-mnx.py $out/bin/mma-mnx
|
|
|
|
cp util/mma-rm2std.py $out/bin/mma-rm2std
|
|
|
|
cp util/mmatabs.py $out/bin/mmatabs
|
|
|
|
cp util/mup2mma.py $out/bin/mup2mma
|
|
|
|
cp util/pg2mma.py $out/bin/pg2mma
|
|
|
|
cp util/synthsplit.py $out/bin/mma-synthsplit
|
|
|
|
cp -r {docs,egs,includes,lib,MMA,text} $out/share/mma
|
|
|
|
rmdir $out/share/mma/includes/aria
|
|
|
|
|
|
|
|
cp util/README.* $out/share/mma/docs
|
|
|
|
mv $out/share/mma/docs/man/mma-libdoc.8 $out/share/man/man8
|
|
|
|
mv $out/share/mma/docs/man/mma-renum.1 $out/share/man/man1
|
|
|
|
mv $out/share/mma/docs/man/mma.1 $out/share/man/man1
|
|
|
|
mv $out/share/mma/docs/man/mma-gb.1 $out/share/man/man1
|
|
|
|
rm -rf $out/share/mma/docs/man
|
|
|
|
find $out -type f | xargs sed -i "s@/usr/share/mma@$out/share/mma@g"
|
|
|
|
'';
|
|
|
|
|
|
|
|
preFixup = ''
|
|
|
|
PYTHONPATH=$out/share/mma/:$PYTHONPATH
|
|
|
|
for f in $out/bin/*; do
|
|
|
|
wrapProgram $f \
|
|
|
|
--prefix PYTHONPATH : $PYTHONPATH
|
|
|
|
done
|
|
|
|
cd $out/share/mma/
|
|
|
|
$out/bin/mma -G
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Creates MIDI tracks for a soloist to perform over from a user supplied file containing chords";
|
2020-03-27 23:05:50 +00:00
|
|
|
homepage = "https://www.mellowood.ca/mma/index.html";
|
2021-01-15 13:21:58 +00:00
|
|
|
license = lib.licenses.gpl2;
|
|
|
|
maintainers = [ lib.maintainers.magnetophon ];
|
|
|
|
platforms = lib.platforms.linux;
|
2016-05-02 20:04:07 +01:00
|
|
|
};
|
|
|
|
}
|