1 { lib, stdenv, fetchurl
2 , mono, dotnetPackages, makeWrapper
3 , gtk2, cups, timidity }:
7 in stdenv.mkDerivation {
8 pname = "midisheetmusic";
12 url = "mirror://sourceforge/midisheetmusic/MidiSheetMusic-${version}-linux-src.tar.gz";
13 sha256 = "05c6zskj50g29f51lx8fvgzsi3f31z01zj6ssjjrgr7jfs7ak70p";
16 nativeCheckInputs = (with dotnetPackages; [ NUnitConsole ]);
17 nativeBuildInputs = [ mono makeWrapper ];
20 for i in Classes/MidiPlayer.cs Classes/MidiSheetMusic.cs
22 substituteInPlace $i --replace "/usr/bin/timidity" "${timidity}/bin/timidity"
28 # include missing file with unit tests for building
29 # switch from mono nunit dll to standalone dll otherwise mono compiler barks
30 # run via nunit3 console, because mono nunit console wants access $HOME
32 substituteInPlace UnitTestDLL.csproj \
33 --replace "</Compile>" '</Compile><Compile Include="Classes\UnitTest.cs"/>' \
34 --replace nunit.framework.dll "${dotnetPackages.NUnit}/lib/dotnet/NUnit/nunit.framework.dll"
36 nunit3-console bin/Debug/UnitTest.dll
39 # 2 tests of 47 are still failing
43 mkdir -p $out/share/applications $out/share/pixmaps $out/bin
45 cp deb/midisheetmusic.desktop $out/share/applications
46 cp NotePair.png $out/share/pixmaps/midisheetmusic.png
47 cp bin/Debug/MidiSheetMusic.exe $out/bin/.MidiSheetMusic.exe
49 makeWrapper ${mono}/bin/mono $out/bin/midisheetmusic.mono.exe \
50 --prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ gtk2 cups ]} \
51 --prefix PATH : ${lib.makeBinPath [ timidity ]} \
52 --add-flags $out/bin/.MidiSheetMusic.exe
56 description = "Convert MIDI Files to Piano Sheet Music for two hands";
57 mainProgram = "midisheetmusic.mono.exe";
58 homepage = "http://midisheetmusic.com";
59 license = licenses.gpl2;
61 platforms = platforms.linux;