2020-06-27 03:24:35 +01:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, callPackage
|
|
|
|
|
|
|
|
# Required build tools
|
|
|
|
, cmake
|
|
|
|
, makeWrapper
|
|
|
|
, pkg-config
|
|
|
|
|
|
|
|
# Required dependencies
|
|
|
|
, fftw
|
|
|
|
, liblo
|
|
|
|
, minixml
|
|
|
|
, zlib
|
|
|
|
|
|
|
|
# Optional dependencies
|
|
|
|
, alsaSupport ? true
|
2021-06-10 03:57:09 +01:00
|
|
|
, alsa-lib
|
2020-06-27 03:24:35 +01:00
|
|
|
, dssiSupport ? false
|
|
|
|
, dssi
|
|
|
|
, ladspaH
|
|
|
|
, jackSupport ? true
|
|
|
|
, libjack2
|
|
|
|
, lashSupport ? false
|
|
|
|
, lash
|
|
|
|
, ossSupport ? true
|
|
|
|
, portaudioSupport ? true
|
|
|
|
, portaudio
|
|
|
|
|
|
|
|
# Optional GUI dependencies
|
|
|
|
, guiModule ? "off"
|
|
|
|
, cairo
|
|
|
|
, fltk13
|
|
|
|
, libGL
|
|
|
|
, libjpeg
|
|
|
|
, libX11
|
|
|
|
, libXpm
|
|
|
|
, ntk
|
|
|
|
|
|
|
|
# Test dependencies
|
|
|
|
, cxxtest
|
2014-01-19 12:01:49 +00:00
|
|
|
}:
|
2011-04-07 23:24:56 +01:00
|
|
|
|
2020-06-27 03:24:35 +01:00
|
|
|
assert builtins.any (g: guiModule == g) [ "fltk" "ntk" "zest" "off" ];
|
|
|
|
|
|
|
|
let
|
|
|
|
guiName = {
|
|
|
|
"fltk" = "FLTK";
|
|
|
|
"ntk" = "NTK";
|
|
|
|
"zest" = "Zyn-Fusion";
|
|
|
|
}.${guiModule};
|
|
|
|
mruby-zest = callPackage ./mruby-zest { };
|
|
|
|
in stdenv.mkDerivation rec {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "zynaddsubfx";
|
2019-05-04 19:38:05 +01:00
|
|
|
version = "3.0.5";
|
2011-04-07 23:24:56 +01:00
|
|
|
|
2020-06-27 03:24:35 +01:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = pname;
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
|
|
|
sha256 = "1vh1gszgjxwn8m32rk5222z1j2cnjax0bqpag7b47v6i36p2q4x8";
|
|
|
|
fetchSubmodules = true;
|
2011-04-07 23:24:56 +01:00
|
|
|
};
|
|
|
|
|
2020-06-27 03:24:35 +01:00
|
|
|
postPatch = ''
|
2017-12-11 07:00:51 +00:00
|
|
|
substituteInPlace src/Misc/Config.cpp --replace /usr $out
|
|
|
|
'';
|
|
|
|
|
2020-06-27 03:24:35 +01:00
|
|
|
nativeBuildInputs = [ cmake makeWrapper pkg-config ];
|
|
|
|
|
|
|
|
buildInputs = [ fftw liblo minixml zlib ]
|
2021-06-10 03:57:09 +01:00
|
|
|
++ lib.optionals alsaSupport [ alsa-lib ]
|
2020-06-27 03:24:35 +01:00
|
|
|
++ lib.optionals dssiSupport [ dssi ladspaH ]
|
|
|
|
++ lib.optionals jackSupport [ libjack2 ]
|
|
|
|
++ lib.optionals lashSupport [ lash ]
|
|
|
|
++ lib.optionals portaudioSupport [ portaudio ]
|
|
|
|
++ lib.optionals (guiModule == "fltk") [ fltk13 libjpeg libXpm ]
|
|
|
|
++ lib.optionals (guiModule == "ntk") [ ntk cairo libXpm ]
|
|
|
|
++ lib.optionals (guiModule == "zest") [ libGL libX11 ];
|
|
|
|
|
|
|
|
cmakeFlags = [ "-DGuiModule=${guiModule}" ]
|
|
|
|
# OSS library is included in glibc.
|
|
|
|
# Must explicitly disable if support is not wanted.
|
|
|
|
++ lib.optional (!ossSupport) "-DOssEnable=OFF"
|
|
|
|
# Find FLTK without requiring an OpenGL library in buildInputs
|
|
|
|
++ lib.optional (guiModule == "fltk") "-DFLTK_SKIP_OPENGL=ON";
|
|
|
|
|
|
|
|
doCheck = true;
|
|
|
|
checkInputs = [ cxxtest ];
|
|
|
|
|
|
|
|
# When building with zest GUI, patch plugins
|
|
|
|
# and standalone executable to properly locate zest
|
2021-08-18 01:14:20 +01:00
|
|
|
postFixup = lib.optionalString (guiModule == "zest") ''
|
2020-06-27 03:24:35 +01:00
|
|
|
patchelf --set-rpath "${mruby-zest}:$(patchelf --print-rpath "$out/lib/lv2/ZynAddSubFX.lv2/ZynAddSubFX_ui.so")" \
|
|
|
|
"$out/lib/lv2/ZynAddSubFX.lv2/ZynAddSubFX_ui.so"
|
|
|
|
|
|
|
|
patchelf --set-rpath "${mruby-zest}:$(patchelf --print-rpath "$out/lib/vst/ZynAddSubFX.so")" \
|
|
|
|
"$out/lib/vst/ZynAddSubFX.so"
|
|
|
|
|
|
|
|
wrapProgram "$out/bin/zynaddsubfx" \
|
|
|
|
--prefix PATH : ${mruby-zest} \
|
|
|
|
--prefix LD_LIBRARY_PATH : ${mruby-zest}
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "High quality software synthesizer (${guiName} GUI)";
|
|
|
|
homepage =
|
|
|
|
if guiModule == "zest"
|
|
|
|
then "https://zynaddsubfx.sourceforge.io/zyn-fusion.html"
|
|
|
|
else "https://zynaddsubfx.sourceforge.io";
|
2016-02-20 21:51:26 +00:00
|
|
|
|
2011-04-07 23:24:56 +01:00
|
|
|
license = licenses.gpl2;
|
2021-05-22 15:47:40 +01:00
|
|
|
maintainers = with maintainers; [ goibhniu kira-bruneau ];
|
2011-04-07 23:24:56 +01:00
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|