[PATCH 3/3] gnu: Add zynfusion.

  • Open
  • quality assurance status badge
Details
One participant
  • Alexandros Theodotou
Owner
unassigned
Submitted by
Alexandros Theodotou
Severity
normal
A
A
Alexandros Theodotou wrote on 4 Apr 2020 23:14
(name . Guix patches)(address . guix-patches@gnu.org)
a704e345c488d12dfb6ae25cd757c0ab7ce187ac.camel@zrythm.org
Hi,

This patch adds zynfusion. The LV2 plugin seems to work well and its
LV2 presets also work.

Some problems that are still pending:
- the binary (standalone) version doesn't work (needs some rtpath-
related patch I'm not sure how to do)
- preset banks are not found by the plugin, even though I patched what
appears to be the paths it looks at

Feel free to edit it.

Thanks,
Alex
From 8bf94ba51559ae4357b6619d61ef13b48e886940 Mon Sep 17 00:00:00 2001
From: Alexandros Theodotou <alex@zrythm.org>
Date: Sat, 4 Apr 2020 22:06:27 +0100
Subject: [PATCH 3/3] gnu: Add zynfusion.

* gnu/packages/music.scm (zynfusion): New variable.
---
gnu/packages/music.scm | 69 ++++++++++++++++++++++++++++++++++++++++++
1 file changed, 69 insertions(+)

Toggle diff (86 lines)
diff --git a/gnu/packages/music.scm b/gnu/packages/music.scm
index 7d0cfe8665..2b5c6cc462 100644
--- a/gnu/packages/music.scm
+++ b/gnu/packages/music.scm
@@ -128,6 +128,7 @@
#:use-module (gnu packages rdf)
#:use-module (gnu packages readline)
#:use-module (gnu packages rsync)
+ #:use-module (gnu packages ruby)
#:use-module (gnu packages sdl)
#:use-module (gnu packages sqlite)
#:use-module (gnu packages tcl)
@@ -5383,3 +5384,71 @@ filtered, pitch shifted and ultimately disintegrated. This is an unofficial
port of the Regrader plugin created by Igorski. It is available as an LV2
plugin and a standalone JACK application.")
(license license:expat)))
+
+(define-public zynfusion
+ (package/inherit zynaddsubfx
+ (name "zynfusion")
+ (arguments
+ `(#:configure-flags
+ ;; Enable ZynFusion mode
+ '("-DGuiModule=zest" "-DDemoMode=false")
+ #:phases
+ (modify-phases %standard-phases
+ ;; Move SSE compiler optimization flags from generic target to
+ ;; athlon64 and core2 targets, because otherwise the build would fail
+ ;; on non-Intel machines.
+ (add-after 'unpack 'remove-sse-flags-from-generic-target
+ (lambda _
+ (substitute* "src/CMakeLists.txt"
+ (("-msse -msse2 -mfpmath=sse") "")
+ (("-march=(athlon64|core2)" flag)
+ (string-append flag " -msse -msse2 -mfpmath=sse")))
+ #t))
+ (add-after 'unpack 'patch-paths
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ (let ((zest (assoc-ref inputs "mruby-zest"))
+ (out (assoc-ref %outputs "out")))
+ ;; Patch zest path so that the ZynFusion UI can be found
+ (substitute* "src/Plugin/ZynAddSubFX/ZynAddSubFX-UI-Zest.cpp"
+ (("\\./libzest\\.so")
+ (string-append zest "/lib/zynfusion/libzest.so")))
+ (substitute* "src/main.cpp"
+ (("\\./zyn-fusion")
+ (string-append zest "/lib/zynfusion/zyn-fusion")))
+ (substitute* "src/main.cpp"
+ (("\\\"zyn-fusion\\\"")
+ (string-append "\"" zest "/lib/zynfusion/zyn-fusion\"")))
+ ;; Patch banks path FIXME banks are still not found
+ (substitute* "src/Misc/Config.cpp"
+ (("cfg.bankRootDirList\\[4\\] =.*$")
+ (string-append "cfg.bankRootDirList[4] = \""
+ out "/share/zynaddsubfx/banks\";\n")))
+ #t)))
+ ;; Rename to avoid clashes with the zynaddsubfx package
+ (add-after 'install 'rename-to-zyn-fusion
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ (let* ((out (assoc-ref %outputs "out"))
+ (bin (string-append out "/bin"))
+ (share (string-append out "/share")))
+ (rename-file (string-append bin "/zynaddsubfx")
+ (string-append bin "/zynfusion"))
+ (substitute* (find-files (string-append share "/applications")
+ "\\.desktop$")
+ (("Exec=zynaddsubfx")
+ "Exec=zynfusion"))
+ #t))))))
+ (inputs
+ `(("alsa-lib" ,alsa-lib)
+ ("cairo" ,cairo)
+ ("fftw" ,fftw)
+ ("jack" ,jack-1)
+ ("liblo" ,liblo)
+ ("libxpm" ,libxpm)
+ ("mesa" ,mesa)
+ ("minixml" ,minixml)
+ ("mruby-zest" ,mruby-zest)
+ ("ruby" ,ruby)
+ ("zlib" ,zlib)))
+ (description
+ "ZynFusion is an alternative, modern UI for the ZynAddSubFX
+synthesizer.")))
--
2.26.0
-----BEGIN PGP SIGNATURE-----

iQEzBAABCAAdFiEESBMjhK0999huJUuDAi6uQjE9cPMFAl6I+KQACgkQAi6uQjE9
cPPhtQf8CmCUug1Fpohi50P4SFkmJ6Vfgbo1HKFDDKWvEXlo6fM3EZqJL+RKY5G+
fUhlu0H3OFxipDEbhDrC1+kjwY4lL78LKtsDmZMGYWAtbRZY2BVjmkN26+nVHLAV
GoUnV/NwFszK5e7TheycIeSlzg4uqlP3fDFbaiB5Bvh2i3tireMRAgv8JOdk/LNY
zjtMnNIbEJOueqlxI5I5fhpu9MVerzNVJZkGvRg/1iC+oJm6pqkunjsYOzrGfacJ
lKqBkEFC2+XnFhHDF/Z4mdUMX1PzSw/q+oRBPDGS1l1a8B1tC/lVzo1vza/CuKP9
wh4guUOk70I3rhhTzfGGMNq2kzybLg==
=gvQl
-----END PGP SIGNATURE-----


?