-
-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
110 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
{ lib, fetchFromGitHub, substituteAll, makeWrapper, python39, fluidsynth, soundfont-fluid, wrapGAppsHook, abcmidi, abcm2ps, ghostscript }: | ||
|
||
# requires python39 due to https://stackoverflow.com/a/71902541 https://github.com/jwdj/EasyABC/issues/52 | ||
python39.pkgs.buildPythonApplication { | ||
pname = "easyabc"; | ||
version = "1.3.8.6"; | ||
|
||
src = fetchFromGitHub { | ||
owner = "jwdj"; | ||
repo = "easyabc"; | ||
rev = "6461b2c14280cb64224fc5299c31cfeef9b7d43c"; | ||
hash = "sha256-leC3A4HQMeJNeZXArb3YAYr2mddGPcws618NrRh2Q1Y="; | ||
}; | ||
|
||
nativeBuildInputs = [ wrapGAppsHook ]; | ||
|
||
propagatedBuildInputs = with python39.pkgs; [ | ||
cx_Freeze | ||
wxPython_4_2 | ||
pygame | ||
]; | ||
|
||
# apparently setup.py only supports Windows and Darwin | ||
# everything is very non-standard in this project | ||
dontBuild = true; | ||
format = "other"; | ||
|
||
# https://discourse.nixos.org/t/packaging-mcomix3-python-gtk-missing-gsettings-schemas-issue/10190/2 | ||
strictDeps = false; | ||
|
||
patches = [ | ||
(substituteAll { | ||
src = ./hardcoded-paths.patch; | ||
fluidsynth = "${fluidsynth}/lib/libfluidsynth.so"; | ||
soundfont = "${soundfont-fluid}/share/soundfonts/FluidR3_GM2-2.sf2"; | ||
ghostscript = "${ghostscript}/bin/gs"; | ||
}) | ||
]; | ||
|
||
installPhase = '' | ||
runHook preInstall | ||
mkdir -p $out/share/easyabc | ||
mv * $out/share/easyabc | ||
ln -s ${abcmidi}/bin/abc2midi $out/share/easyabc/bin/abc2midi | ||
ln -s ${abcmidi}/bin/midi2abc $out/share/easyabc/bin/midi2abc | ||
ln -s ${abcmidi}/bin/abc2abc $out/share/easyabc/bin/abc2abc | ||
ln -s ${abcm2ps}/bin/abcm2ps $out/share/easyabc/bin/abcm2ps | ||
makeWrapper ${python39.interpreter} $out/bin/easyabc \ | ||
--set PYTHONPATH "$PYTHONPATH:$out/share/easyabc" \ | ||
--add-flags "-O $out/share/easyabc/easy_abc.py" | ||
runHook postInstall | ||
''; | ||
|
||
meta = { | ||
description = "ABC music notation editor"; | ||
homepage = "https://easyabc.sourceforge.net/"; | ||
license = lib.licenses.gpl2Plus; | ||
platforms = lib.platforms.linux; | ||
maintainers = with lib.maintainers; [ mausch ]; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
--- | ||
easy_abc.py | 4 ++++ | ||
fluidsynth.py | 2 ++ | ||
2 files changed, 6 insertions(+) | ||
|
||
diff --git a/easy_abc.py b/easy_abc.py | ||
index 5be3e6a..40c999a 100644 | ||
--- a/easy_abc.py | ||
+++ b/easy_abc.py | ||
@@ -3960,6 +3960,8 @@ class MainFrame(wx.Frame): | ||
else: | ||
default_soundfont_path = '/usr/share/sounds/sf2/FluidR3_GM.sf2' | ||
|
||
+ default_soundfont_path = '@soundfont@' | ||
+ | ||
soundfont_path = settings.get('soundfont_path', default_soundfont_path) | ||
self.uses_fluidsynth = False | ||
if fluidsynth_available and soundfont_path and os.path.exists(soundfont_path): | ||
@@ -8367,6 +8369,8 @@ class MainFrame(wx.Frame): | ||
gs_path = '/usr/bin/pstopdf' | ||
settings['gs_path'] = gs_path | ||
|
||
+ settings['gs_path'] = '@ghostscript@' | ||
+ | ||
# 1.3.6.1 [SS] 2015-01-12 2015-01-22 | ||
gs_path = settings['gs_path'] #eliminate trailing \n | ||
if gs_path and (os.path.exists(gs_path) == False): | ||
diff --git a/fluidsynth.py b/fluidsynth.py | ||
index 529ebbf..b5d9377 100644 | ||
--- a/fluidsynth.py | ||
+++ b/fluidsynth.py | ||
@@ -44,6 +44,8 @@ if platform.system() == 'Windows': | ||
else: | ||
lib_locations = ['./libfluidsynth.so.3', 'libfluidsynth.so.3', './libfluidsynth.so.2', 'libfluidsynth.so.2'] | ||
|
||
+lib_locations = ['@fluidsynth@'] | ||
+ | ||
i = 0 | ||
while i < len(lib_locations): | ||
try: | ||
-- | ||
2.38.5 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters