diff options
author | Cillian de Róiste <goibhniu@fsfe.org> | 2012-08-27 23:48:44 +0200 |
---|---|---|
committer | Cillian de Róiste <goibhniu@fsfe.org> | 2012-08-27 23:48:44 +0200 |
commit | 0a6c7e432b44375dc1d1b6ad60b2ca8435fd7a4a (patch) | |
tree | a139191cc7932cd85bf5c009098070845fce87fe /pkgs/applications/audio/linuxsampler | |
parent | 0f1326cde9cc8cae509a4d225f37f072b0314601 (diff) |
Patch linuxsampler so that it can load SFZ state when used as an LV2 plugin: http://tracker.ardour.org/view.php?id=4462
Diffstat (limited to 'pkgs/applications/audio/linuxsampler')
-rw-r--r-- | pkgs/applications/audio/linuxsampler/default.nix | 10 | ||||
-rw-r--r-- | pkgs/applications/audio/linuxsampler/linuxsampler_lv2_sfz_fix.diff | 50 |
2 files changed, 57 insertions, 3 deletions
diff --git a/pkgs/applications/audio/linuxsampler/default.nix b/pkgs/applications/audio/linuxsampler/default.nix index 1ef081c84d071..c74cd2b0d7d48 100644 --- a/pkgs/applications/audio/linuxsampler/default.nix +++ b/pkgs/applications/audio/linuxsampler/default.nix @@ -11,9 +11,12 @@ stdenv.mkDerivation rec { sha256 = "0zsrvs9dwwhjx733m45vfi11yjkqv33z8qxn2i9qriq5zs1f0kd7"; }; - patchPhase = "sed -e 's/which/type -P/g' -i scripts/generate_parser.sh"; + patches = ./linuxsampler_lv2_sfz_fix.diff; - preConfigure = "make -f Makefile.cvs"; + preConfigure = '' + sed -e 's/which/type -P/g' -i scripts/generate_parser.sh + make -f Makefile.cvs + ''; buildInputs = [ alsaLib asio autoconf automake bison jackaudio libgig libsndfile @@ -34,7 +37,8 @@ stdenv.mkDerivation rec { have questions on the subject, that are not yet covered by the FAQ, please contact us. ''; - license = licenses.gpl2; + license = licenses.proprietary; maintainers = [ maintainers.goibhniu ]; + platforms = platforms.linux; }; } diff --git a/pkgs/applications/audio/linuxsampler/linuxsampler_lv2_sfz_fix.diff b/pkgs/applications/audio/linuxsampler/linuxsampler_lv2_sfz_fix.diff new file mode 100644 index 0000000000000..114726db19d63 --- /dev/null +++ b/pkgs/applications/audio/linuxsampler/linuxsampler_lv2_sfz_fix.diff @@ -0,0 +1,50 @@ +Index: linuxsampler-r2359/src/hostplugins/lv2/PluginLv2.cpp +=================================================================== +--- linuxsampler-r2359/src/hostplugins/lv2/PluginLv2.cpp (revision 2359) ++++ linuxsampler-r2359/src/hostplugins/lv2/PluginLv2.cpp (working copy) +@@ -18,6 +18,8 @@ + * MA 02110-1301 USA * + ***************************************************************************/ + ++#define _BSD_SOURCE 1 /* for realpath() */ ++ + #include <algorithm> + #include <cassert> + #include <cstdio> +@@ -118,6 +120,23 @@ + dmsg(2, ("linuxsampler: Deactivate\n")); + } + ++ static String RealPath(const String& path) ++ { ++ String out = path; ++ char* cpath = NULL; ++#ifdef _WIN32 ++ cpath = (char*)malloc(MAX_PATH); ++ GetFullPathName(path.c_str(), MAX_PATH, cpath, NULL); ++#else ++ cpath = realpath(path.c_str(), NULL); ++#endif ++ if (cpath) { ++ out = cpath; ++ free(cpath); ++ } ++ return out; ++ } ++ + String PluginLv2::PathToState(const String& path) { + if (MapPath) { + char* cstr = MapPath->abstract_path(MapPath->handle, path.c_str()); +@@ -131,9 +150,10 @@ + String PluginLv2::PathFromState(const String& path) { + if (MapPath) { + char* cstr = MapPath->absolute_path(MapPath->handle, path.c_str()); +- const String abstract_path(cstr); ++ // Resolve symbolic links so SFZ sample paths load correctly ++ const String absolute_path(RealPath(cstr)); + free(cstr); +- return abstract_path; ++ return absolute_path; + } + return path; + } |