···11+{ stdenv, fetchurl, puredata }:
22+33+stdenv.mkDerivation rec {
44+ name = "mrpeach-${version}";
55+ version = "1.1";
66+77+ # this was to only usable url I could find:
88+ # - The main url changes hash: http://pure-data.cvs.sourceforge.net/viewvc/pure-data/externals/mrpeach/?view=tar
99+ # - There are lot's of places where this SW is available as part of a big pkg: pd-extended, pd-l2ork
1010+ # - It's just 211K
1111+1212+ src = fetchurl {
1313+ url = "http://slackonly.com/pub/korgie/sources/pd_mrpeach-2011.10.21.tar.gz";
1414+ sha256 = "12jqba3jsdrk20ib9wc2wiivki88ypcd4mkzgsri9siywbbz9w8x";
1515+ };
1616+1717+ buildInputs = [puredata ];
1818+1919+ patchPhase = ''
2020+ for D in net osc
2121+ do
2222+ sed -i "s@prefix = /usr/local@prefix = $out@g" $D/Makefile
2323+ for i in ${puredata}/include/pd/*; do
2424+ ln -s $i $D/
2525+ done
2626+ done
2727+ '';
2828+2929+ buildPhase = ''
3030+ for D in net osc
3131+ do
3232+ cd $D
3333+ make
3434+ cd ..
3535+ done
3636+ '';
3737+3838+ installPhase = ''
3939+ for D in net osc
4040+ do
4141+ cd $D
4242+ make install
4343+ cd ..
4444+ done
4545+ '';
4646+4747+ fixupPhase = ''
4848+ mv $out/lib/pd-externals/net $out
4949+ mv $out/lib/pd-externals/osc $out
5050+ rm -rf $out/lib
5151+ '';
5252+5353+ meta = {
5454+ description = "A collection of Pd objectclasses for OSC-messages";
5555+ homepage = http://puredata.info/downloads/osc;
5656+ license = stdenv.lib.licenses.gpl2;
5757+ maintainers = [ stdenv.lib.maintainers.magnetophon ];
5858+ platforms = stdenv.lib.platforms.linux;
5959+ };
6060+}