Skip to content

Dplug LV2 Guide

Ethan Reker edited this page Sep 23, 2019 · 1 revision

How to build a LV2 Plugin with Dplug?

These steps outline how to build an LV2 plugin using Dplug. LV2 is licensed under the ISC license which is a very permissive open source license. LV2 plugins built with Dplug can be distributed without any licensing constraints.

Step 1. Modifying dub.json

Add a dependency on dplug:lv2 to dub.json

eg:

    "dependencies":
    {
        "dplug:lv2": "~>9.0"
    }

Step 2. LV2 Configuration

Add a configuration with a name starting with LV2 in your plugin project

"configurations": [
    {
        "name": "LV2-ULTRA-EDITION",
        "versions": ["LV2"],
        "targetType": "dynamicLibrary",
        "lflags-osx-ldc": [ "-exported_symbols_list", "module-lv2.lst", "-dead_strip" ]
    }
]

You can find module-lv2.lst in the given example in the distort or clipit examples.

Step 3. LV2 Entry points

If you use mixin(pluginEntryPoints!MyPluginClient); you don't have anything to do.

Else, add the LV2 entry points in your main source file:

    version(LV2)
    {
        import dplug.lv2;
        mixin(LV2EntryPoint!MyClient);
    }

Step 4. Building with dplug-build

Build with the right configuration:

$ dplug-build -c LV2-ULTRA-EDITION -a x86_64