easyabc: init at 1.3.8.6

authored by Mauricio Scheffer and committed by Anderson Torres 644fed22 989d3e91

+110
+65
pkgs/applications/audio/easyabc/default.nix
··· 1 + { lib, fetchFromGitHub, substituteAll, makeWrapper, python39, fluidsynth, soundfont-fluid, wrapGAppsHook, abcmidi, abcm2ps, ghostscript }: 2 + 3 + # requires python39 due to https://stackoverflow.com/a/71902541 https://github.com/jwdj/EasyABC/issues/52 4 + python39.pkgs.buildPythonApplication { 5 + pname = "easyabc"; 6 + version = "1.3.8.6"; 7 + 8 + src = fetchFromGitHub { 9 + owner = "jwdj"; 10 + repo = "easyabc"; 11 + rev = "6461b2c14280cb64224fc5299c31cfeef9b7d43c"; 12 + hash = "sha256-leC3A4HQMeJNeZXArb3YAYr2mddGPcws618NrRh2Q1Y="; 13 + }; 14 + 15 + nativeBuildInputs = [ wrapGAppsHook ]; 16 + 17 + propagatedBuildInputs = with python39.pkgs; [ 18 + cx_Freeze 19 + wxPython_4_2 20 + pygame 21 + ]; 22 + 23 + # apparently setup.py only supports Windows and Darwin 24 + # everything is very non-standard in this project 25 + dontBuild = true; 26 + format = "other"; 27 + 28 + # https://discourse.nixos.org/t/packaging-mcomix3-python-gtk-missing-gsettings-schemas-issue/10190/2 29 + strictDeps = false; 30 + 31 + patches = [ 32 + (substituteAll { 33 + src = ./hardcoded-paths.patch; 34 + fluidsynth = "${fluidsynth}/lib/libfluidsynth.so"; 35 + soundfont = "${soundfont-fluid}/share/soundfonts/FluidR3_GM2-2.sf2"; 36 + ghostscript = "${ghostscript}/bin/gs"; 37 + }) 38 + ]; 39 + 40 + installPhase = '' 41 + runHook preInstall 42 + 43 + mkdir -p $out/share/easyabc 44 + mv * $out/share/easyabc 45 + 46 + ln -s ${abcmidi}/bin/abc2midi $out/share/easyabc/bin/abc2midi 47 + ln -s ${abcmidi}/bin/midi2abc $out/share/easyabc/bin/midi2abc 48 + ln -s ${abcmidi}/bin/abc2abc $out/share/easyabc/bin/abc2abc 49 + ln -s ${abcm2ps}/bin/abcm2ps $out/share/easyabc/bin/abcm2ps 50 + 51 + makeWrapper ${python39.interpreter} $out/bin/easyabc \ 52 + --set PYTHONPATH "$PYTHONPATH:$out/share/easyabc" \ 53 + --add-flags "-O $out/share/easyabc/easy_abc.py" 54 + 55 + runHook postInstall 56 + ''; 57 + 58 + meta = { 59 + description = "ABC music notation editor"; 60 + homepage = "https://easyabc.sourceforge.net/"; 61 + license = lib.licenses.gpl2Plus; 62 + platforms = lib.platforms.linux; 63 + maintainers = with lib.maintainers; [ mausch ]; 64 + }; 65 + }
+43
pkgs/applications/audio/easyabc/hardcoded-paths.patch
··· 1 + --- 2 + easy_abc.py | 4 ++++ 3 + fluidsynth.py | 2 ++ 4 + 2 files changed, 6 insertions(+) 5 + 6 + diff --git a/easy_abc.py b/easy_abc.py 7 + index 5be3e6a..40c999a 100644 8 + --- a/easy_abc.py 9 + +++ b/easy_abc.py 10 + @@ -3960,6 +3960,8 @@ class MainFrame(wx.Frame): 11 + else: 12 + default_soundfont_path = '/usr/share/sounds/sf2/FluidR3_GM.sf2' 13 + 14 + + default_soundfont_path = '@soundfont@' 15 + + 16 + soundfont_path = settings.get('soundfont_path', default_soundfont_path) 17 + self.uses_fluidsynth = False 18 + if fluidsynth_available and soundfont_path and os.path.exists(soundfont_path): 19 + @@ -8367,6 +8369,8 @@ class MainFrame(wx.Frame): 20 + gs_path = '/usr/bin/pstopdf' 21 + settings['gs_path'] = gs_path 22 + 23 + + settings['gs_path'] = '@ghostscript@' 24 + + 25 + # 1.3.6.1 [SS] 2015-01-12 2015-01-22 26 + gs_path = settings['gs_path'] #eliminate trailing \n 27 + if gs_path and (os.path.exists(gs_path) == False): 28 + diff --git a/fluidsynth.py b/fluidsynth.py 29 + index 529ebbf..b5d9377 100644 30 + --- a/fluidsynth.py 31 + +++ b/fluidsynth.py 32 + @@ -44,6 +44,8 @@ if platform.system() == 'Windows': 33 + else: 34 + lib_locations = ['./libfluidsynth.so.3', 'libfluidsynth.so.3', './libfluidsynth.so.2', 'libfluidsynth.so.2'] 35 + 36 + +lib_locations = ['@fluidsynth@'] 37 + + 38 + i = 0 39 + while i < len(lib_locations): 40 + try: 41 + -- 42 + 2.38.5 43 +
+2
pkgs/top-level/all-packages.nix
··· 4823 4823 4824 4824 earlyoom = callPackage ../os-specific/linux/earlyoom { }; 4825 4825 4826 + easyabc = callPackage ../applications/audio/easyabc { }; 4827 + 4826 4828 easycrypt = callPackage ../applications/science/logic/easycrypt { }; 4827 4829 4828 4830 easycrypt-runtest = callPackage ../applications/science/logic/easycrypt/runtest.nix { };