(define-public libuv-static (package/inherit libuv (arguments '(#:tests? #f #:make-flags (list "CFLAGS=-fPIC"))) (version "1.9.1"))) (define-public mruby-zest (package (name "mruby-zest") (version "3.0.5-ba39aabd") (source (origin (method git-fetch) (uri (git-reference ;; this is a meta repo that packs the mruby dependencies ;; as submodules (url "https://github.com/mruby-zest/mruby-zest-build.git") ;; ghaction branch - suggested by the developer to avoid ;; automatic downloading of some unneeded and ;; hard-to-package dependencies used only for debugging (commit "ba39aabd8d4ddc5f14137083b6f9a96c536f5f12") (recursive? #t))) (file-name (git-file-name name version)) (sha256 (base32 "1vqzdds30sr982dp7fclg4r19l44rv8pbz6h4a8vcginj494gvjn")))) (build-system gnu-build-system) (arguments `(#:tests? #f ; no check target #:make-flags (list (string-append "CC=gcc")) #:phases (modify-phases %standard-phases (add-after 'unpack 'use-installed-libuv (lambda* (#:key inputs outputs #:allow-other-keys) (let* ((libuv (assoc-ref inputs "libuv-static"))) (copy-file (string-append libuv "/lib/libuv.a") "deps/libuv.a") (substitute* "Makefile" (("\\.\\./\\.\\./deps/\\$\\(UV_DIR\\)/include") (string-append libuv "/include"))) (substitute* "Makefile" (("\\./deps/\\$\\(UV_DIR\\)/\\.libs/libuv\\.a") (string-append libuv "/lib/libuv.a")))))) (add-after 'unpack 'disable-unused-deps (lambda _ (substitute* "build_config.rb" (("conf\\.gem 'deps/mruby-file-stat'") "#")) (substitute* "deps/mruby-dir-glob/mrbgem.rake" (("spec\\.add_dependency 'mruby-file-stat'") "#")) #t)) (replace 'configure (lambda _ (invoke "make" "builddep"))) (add-before 'install 'pack (lambda _ (setenv "CC" "gcc") (invoke "make" "pack"))) (replace 'install (lambda* (#:key inputs outputs #:allow-other-keys) (let* ((out (assoc-ref outputs "out")) (lib (string-append out "/lib/zynfusion"))) (mkdir-p lib) (copy-recursively "package" lib) #t))) (add-after 'install 'rename-to-zyn-fusion (lambda* (#:key inputs outputs #:allow-other-keys) (let* ((out (assoc-ref %outputs "out")) (lib (string-append out "/lib/zynfusion"))) (rename-file (string-append lib "/zest") (string-append lib "/zyn-fusion")) #t)))))) (inputs `(("libx11" ,libx11) ("cairo" ,cairo) ("mesa" ,mesa) ("libuv-static" ,libuv-static) ("ruby" ,ruby) ("mruby" ,mruby))) (native-inputs `(("pkg-config" ,pkg-config) ("bison" ,bison) ("autoconf" ,autoconf) ("automake" ,automake) ("libtool" ,libtool) ("python-2" ,python-2))) (home-page "https://github.com/mruby-zest/mruby-zest") (synopsis "Widget classes for ZynFusion") (description "MRuby-Zest is a set of widgets needed to create the 'ZynFusion' user interface of ZynAddSubFX.") (license license:lgpl2.1+))) (define-public zynaddsubfx (package (name "zynaddsubfx") (version "3.0.5") (source (origin (method url-fetch) (uri (string-append "mirror://sourceforge/zynaddsubfx/zynaddsubfx/" version "/zynaddsubfx-" version ".tar.bz2")) (sha256 (base32 "0qwzg14h043rmyf9jqdylxhyfy4sl0vsr0gjql51wjhid0i34ivl")))) (build-system cmake-build-system) (arguments `(#: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))))) (inputs `(("liblo" ,liblo) ("ntk" ,ntk) ("mesa" ,mesa) ("alsa-lib" ,alsa-lib) ("jack" ,jack-1) ("fftw" ,fftw) ("minixml" ,minixml) ("libxpm" ,libxpm) ("zlib" ,zlib))) (native-inputs `(("pkg-config" ,pkg-config))) (home-page "http://zynaddsubfx.sf.net/") (synopsis "Software synthesizer") (description "ZynAddSubFX is a feature heavy realtime software synthesizer. It offers three synthesizer engines, multitimbral and polyphonic synths, microtonal capabilities, custom envelopes, effects, etc.") (license license:gpl2+))) (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)) ;; Modify zest path so that the ZynFusion UI can be found (add-after 'unpack 'patch-zest-path (lambda* (#:key inputs outputs #:allow-other-keys) (let ((zest (assoc-ref inputs "mruby-zest")) (out (assoc-ref %outputs "out"))) (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\""))) #t))) ;; Rename to ZynFusion so it can co-exist with the older UI (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.")))