17 # Enabling JACK requires a JACK server at runtime, no fallback mechanism
24 assert lib.assertOneOf "type" type [
35 mainProgram = "${type}plug";
37 stdenv.mkDerivation rec {
38 pname = "${lib.strings.toLower type}plug";
39 version = "unstable-2021-12-17";
41 src = fetchFromGitHub {
44 rev = "a488abedf1783c61cb4f0caa689f1b01bf9aa17d";
45 fetchSubmodules = true;
46 sha256 = "1a5zw0rglqgc5wq1n0s5bxx7y59dsg6qy02236fakl34bvbk60yz";
50 "-DADLplug_CHIP=${chip}"
51 "-DADLplug_USE_SYSTEM_FMT=ON"
52 "-DADLplug_Jack=${if withJack then "ON" else "OFF"}"
55 NIX_LDFLAGS = toString (
56 lib.optionals stdenv.hostPlatform.isDarwin [
57 # Framework that JUCE needs which don't get linked properly
58 "-framework CoreAudioKit"
59 "-framework QuartzCore"
60 "-framework AudioToolbox"
62 ++ lib.optionals stdenv.hostPlatform.isLinux [
63 # JUCE dlopen's these at runtime
82 ++ lib.optionals stdenv.hostPlatform.isLinux [
91 ++ lib.optional withJack jack;
93 postInstall = lib.optionalString stdenv.hostPlatform.isDarwin ''
94 mkdir -p $out/{Applications,Library/Audio/Plug-Ins/{VST,Components}}
96 mv $out/bin/${mainProgram}.app $out/Applications/
97 ln -s $out/{Applications/${mainProgram}.app/Contents/MacOS,bin}/${mainProgram}
99 mv vst2/${mainProgram}.vst $out/Library/Audio/Plug-Ins/VST/
100 mv au/${mainProgram}.component $out/Library/Audio/Plug-Ins/Components/
105 description = "${chip} FM Chip Synthesizer";
106 homepage = src.meta.homepage;
107 license = licenses.boost;
108 platforms = platforms.all;
109 maintainers = with maintainers; [ OPNA2608 ];