nixpkgs/pkgs/applications/audio/midisheetmusic/default.nix

63 lines
2.0 KiB
Nix
Raw Normal View History

{ lib, stdenv, fetchurl
2018-10-06 19:43:32 +01:00
, mono, dotnetPackages, makeWrapper
, gtk2, cups, timidity }:
let
version = "2.6";
in stdenv.mkDerivation {
2019-08-13 22:52:01 +01:00
pname = "midisheetmusic";
inherit version;
2018-10-06 19:43:32 +01:00
src = fetchurl {
url = "mirror://sourceforge/midisheetmusic/MidiSheetMusic-${version}-linux-src.tar.gz";
sha256 = "05c6zskj50g29f51lx8fvgzsi3f31z01zj6ssjjrgr7jfs7ak70p";
};
checkInputs = (with dotnetPackages; [ NUnitConsole ]);
nativeBuildInputs = [ mono makeWrapper ];
buildPhase = ''
for i in Classes/MidiPlayer.cs Classes/MidiSheetMusic.cs
do
substituteInPlace $i --replace "/usr/bin/timidity" "${timidity}/bin/timidity"
done
./build.sh
'';
# include missing file with unit tests for building
# switch from mono nunit dll to standalone dll otherwise mono compiler barks
# run via nunit3 console, because mono nunit console wants access $HOME
checkPhase = ''
substituteInPlace UnitTestDLL.csproj \
--replace "</Compile>" '</Compile><Compile Include="Classes\UnitTest.cs"/>' \
--replace nunit.framework.dll "${dotnetPackages.NUnit}/lib/dotnet/NUnit/nunit.framework.dll"
./build_unit_test.sh
nunit3-console bin/Debug/UnitTest.dll
'';
# 2 tests of 47 are still failing
doCheck = false;
installPhase = ''
mkdir -p $out/share/applications $out/share/pixmaps $out/bin
cp deb/midisheetmusic.desktop $out/share/applications
cp NotePair.png $out/share/pixmaps/midisheetmusic.png
cp bin/Debug/MidiSheetMusic.exe $out/bin/.MidiSheetMusic.exe
makeWrapper ${mono}/bin/mono $out/bin/midisheetmusic.mono.exe \
2021-01-15 13:21:58 +00:00
--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ gtk2 cups ]} \
--prefix PATH : ${lib.makeBinPath [ timidity ]} \
2018-10-06 19:43:32 +01:00
--add-flags $out/bin/.MidiSheetMusic.exe
'';
meta = with lib; {
2018-10-06 19:43:32 +01:00
description = "Convert MIDI Files to Piano Sheet Music for two hands";
homepage = "http://midisheetmusic.com";
2018-10-06 19:43:32 +01:00
license = licenses.gpl2;
maintainers = [ maintainers.gnidorah ];
platforms = platforms.linux;
};
}