Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 33 additions & 38 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,27 +21,22 @@ jobs:
with:
submodules: recursive

- name: Checkout `vst3sdk`
shell: bash
run: |
git clone --depth=1 https://github.com/steinbergmedia/vst3sdk
cd vst3sdk
git submodule update --init base
git submodule update --init cmake
git submodule update --init public.sdk
git submodule update --init pluginterfaces
cd ..

- name: Install dependencies
shell: bash
run: |
# needed for baseview and other example-nih-plug deps
sudo apt-get install -y libgl-dev libx11-xcb-dev libxcb1-dev libxcb-dri2-0-dev libxcb-icccm4-dev libxcursor-dev libxkbcommon-dev libxcb-shape0-dev libxcb-xfixes0-dev

- name: Package `clap-wrapper`
shell: bash
run: |
# we test the packaged version to make sure everything needed is included
cargo package -p clap-wrapper

- name: Build `${{ matrix.package }}`
shell: bash
run: |
CLAP_WRAPPER_VST3_SDK="$(realpath vst3sdk)" CLAP_WRAPPER_VERBOSE=1 cargo build -p ${{ matrix.package }}
cargo build -p ${{ matrix.package }}

# bundle vst3
mkdir -p ${{ matrix.package }}.vst3/Contents/x86_64-linux/
Expand All @@ -57,7 +52,12 @@ jobs:
- name: Build `vst3-validator`
shell: bash
run: |
git clone --depth=1 https://github.com/steinbergmedia/vst3sdk
cd vst3sdk
git submodule update --init base
git submodule update --init cmake
git submodule update --init public.sdk
git submodule update --init pluginterfaces
cmake -DSMTG_ENABLE_VSTGUI_SUPPORT=OFF -DSMTG_ENABLE_VST3_PLUGIN_EXAMPLES=OFF -DSMTG_ENABLE_VST3_HOSTING_EXAMPLES=OFF -B cmake-build
cmake --build cmake-build --target validator
cd ..
Expand Down Expand Up @@ -86,21 +86,16 @@ jobs:
with:
submodules: recursive

- name: Checkout `vst3sdk`
- name: Package `clap-wrapper`
shell: bash
run: |
git clone --depth=1 https://github.com/steinbergmedia/vst3sdk
cd vst3sdk
git submodule update --init base
git submodule update --init cmake
git submodule update --init public.sdk
git submodule update --init pluginterfaces
cd ..
# we test the packaged version to make sure everything needed is included
cargo package -p clap-wrapper

- name: Build `${{ matrix.package }}`
shell: bash
run: |
CLAP_WRAPPER_VST3_SDK="$(realpath vst3sdk)" CLAP_WRAPPER_VERBOSE=1 cargo build -p ${{ matrix.package }}
cargo build -p ${{ matrix.package }}

# bundle vst3. we dont really have to do that as the dll file by itself can be used as a vst3,
# but the validator really wants it to be a vst3 bundle so we have no choice
Expand All @@ -118,8 +113,13 @@ jobs:
- name: Build `vst3-validator`
shell: bash
run: |
git clone --depth=1 https://github.com/steinbergmedia/vst3sdk
cd vst3sdk
cmake -DSMTG_ENABLE_VSTGUI_SUPPORT=OFF -DSMTG_ENABLE_VST3_PLUGIN_EXAMPLES=OFF -DSMTG_ENABLE_VST3_HOSTING_EXAMPLES=OFF -B cmake-build
git submodule update --init base
git submodule update --init cmake
git submodule update --init public.sdk
git submodule update --init pluginterfaces
cmake -DSMTG_ENABLE_VSTGUI_SUPPORT=OFF -DSMTG_ENABLE_VST3_PLUGIN_EXAMPLES=OFF -DSMTG_ENABLE_VST3_HOSTING_EXAMPLES=OFF -B cmake-build
cmake --build cmake-build --target validator
cd ..

Expand All @@ -131,7 +131,7 @@ jobs:
validate-macos:
strategy:
matrix:
runner: [macos-13]
runner: [macos-15]
package: [example-nih-plug, example-clack]
include:
- package: example-nih-plug
Expand All @@ -153,26 +153,16 @@ jobs:
with:
submodules: recursive

- name: Checkout `vst3sdk`
- name: Package `clap-wrapper`
shell: bash
run: |
git clone --depth=1 https://github.com/steinbergmedia/vst3sdk
cd vst3sdk
git submodule update --init base
git submodule update --init cmake
git submodule update --init public.sdk
git submodule update --init pluginterfaces
cd ..

- name: Checkout `AudioUnitSDK`
shell: bash
run: |
git clone --depth=1 https://github.com/apple/AudioUnitSDK
# we test the packaged version to make sure everything needed is included
cargo package -p clap-wrapper

- name: Build `${{ matrix.package }}`
shell: bash
run: |
CLAP_WRAPPER_VST3_SDK="$(realpath vst3sdk)" CLAP_WRAPPER_AUV2_SDK="$(realpath AudioUnitSDK)" CLAP_WRAPPER_VERBOSE=1 cargo build -p ${{ matrix.package }}
cargo build -p ${{ matrix.package }}

# bundle vst3 and include the Info.plist stuff
# for more info on directory structure, see https://steinbergmedia.github.io/vst3_dev_portal/pages/Technical+Documentation/Locations+Format/Plugin+Format.html
Expand Down Expand Up @@ -208,8 +198,13 @@ jobs:
- name: Build `vst3-validator`
shell: bash
run: |
git clone --depth=1 https://github.com/steinbergmedia/vst3sdk
cd vst3sdk
cmake -DSMTG_ENABLE_VSTGUI_SUPPORT=OFF -DSMTG_ENABLE_VST3_PLUGIN_EXAMPLES=OFF -DSMTG_ENABLE_VST3_HOSTING_EXAMPLES=OFF -B cmake-build
git submodule update --init base
git submodule update --init cmake
git submodule update --init public.sdk
git submodule update --init pluginterfaces
cmake -DSMTG_ENABLE_VSTGUI_SUPPORT=OFF -DSMTG_ENABLE_VST3_PLUGIN_EXAMPLES=OFF -DSMTG_ENABLE_VST3_HOSTING_EXAMPLES=OFF -B cmake-build
cmake --build cmake-build --target validator
cd ..

Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
target
vst3sdk
.vscode
16 changes: 11 additions & 5 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
[submodule "clap-wrapper"]
path = external/clap-wrapper
url = https://github.com/free-audio/clap-wrapper
[submodule "clap"]
[submodule "clap-wrapper-vst3/external/vst3sdk"]
path = external/vst3sdk
url = https://github.com/steinbergmedia/vst3sdk
[submodule "clap-wrapper-auv2/external/AudioUnitSDK"]
path = external/AudioUnitSDK
url = https://github.com/apple/AudioUnitSDK
[submodule "clap-wrapper-auv2/external/clap"]
path = external/clap
url = https://github.com/free-audio/clap
[submodule "filesystem"]
[submodule "clap-wrapper-auv2/external/clap-wrapper"]
path = external/clap-wrapper
url = https://github.com/free-audio/clap-wrapper
[submodule "clap-wrapper-auv2/external/filesystem"]
path = external/filesystem
url = https://github.com/gulrak/filesystem
24 changes: 10 additions & 14 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

35 changes: 29 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ resolver = "3"
members = [
".",
"examples/example-clack",
"examples/example-nih-plug"
"examples/example-nih-plug",
]

[package]
name = "clap-wrapper"
version = "0.1.2"
version = "0.2.0"
edition = "2024"
authors = ["Quant1um"]
readme = "README.md"
Expand All @@ -17,10 +17,33 @@ license = "MIT OR Apache-2.0"
description = "An easy way to use clap-wrapper in your audio plugins!"
keywords = ["vst3", "auv2", "clap", "audio", "plugin"]

include = [
"src/**",
"build.rs",
"./README.md",

# Include external dependency licenses, just in case
"LICENSE*",

"external/clap/include/**",
"external/clap-wrapper/include/**",
"external/clap-wrapper/libs/**",
"external/clap-wrapper/src/**",
"external/filesystem/include/**",

"external/AudioUnitSDK/include/**",
"external/AudioUnitSDK/src/**",

"external/vst3sdk/pluginterfaces/**",
"external/vst3sdk/public.sdk/source/**",
"external/vst3sdk/base/**",
]

[build-dependencies]
cc = "1.2.19"
stdio-override = "0.2.0"
cc = "1.2.52"

[features]
default = ["parallel"]
parallel = ["cc/parallel"]
default = ["parallel", "vst3", "auv2"]
parallel = ["cc/parallel"]
vst3 = []
auv2 = []
24 changes: 13 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
An easy way to use [clap-wrapper](https://github.com/free-audio/clap-wrapper) in your Rust plugins!

## Usecases
- Adding VST3 or AUv2 support to existing Rust plugin frameworks that do not support them
- Using [nih-plug](https://github.com/robbert-vdh/nih-plug) with non-GPLv3 licensed VST3 SDK
- Adding VST3 or AUv2 support to existing Rust plugin frameworks that do not support them (e.g. [clack](https://github.com/prokopyl/clack))
- Making your own audio plugin framework without dealing with VST3 and AUv2 directly

## Features
Expand All @@ -27,25 +26,19 @@ Add this to your `Cargo.toml`:

```toml
[dependencies]
clap-wrapper = "0.1.2"
clap-wrapper = { version = "0.2.0", features = ["vst3", "auv2", "parallel"] } # these features are enabled by default
```

Then, in your `lib.rs`:
```rust
// exports `GetPluginFactoryAUV2` symbol if CLAP_WRAPPER_AUV2_SDK env variable is present
// exports `GetPluginFactoryAUV2` symbol.
clap_wrapper::export_auv2!();
// exports `GetPluginFactory` symbol and extra VST3 symbols if CLAP_WRAPPER_VST3_SDK env variable is present
// exports `GetPluginFactory` symbol and extra VST3 symbols.
clap_wrapper::export_vst3!();
```

This will export VST3 and AUv2 entrypoints that use the `clap_entry` symbol exported from your crate (as an example, `nih_plug::nih_export_clap` exports it).

To build the plugin with VST3 or AUv2 capabilities, add `CLAP_WRAPPER_VST3_SDK` and/or `CLAP_WRAPPER_AUV2_SDK` environment variables to your build command. For example:

```bash
CLAP_WRAPPER_VST3_SDK=/path/to/vst3sdk cargo build -p example-clap
```

Keep in mind, that `clap-wrapper-rs` only adds the necessary entrypoints that reexport the CLAP plugin you already have. You'd still have to use a crate like `nih-plug` to actually create the plugin.


Expand All @@ -56,6 +49,15 @@ Check out [Info.vst3.plist](examples/example-clack/Info.vst3.plist) and [Info.au

See [validate.yml](.github/workflows/validate.yml) for a complete example of how to build, bundle and validate a plugin.

## Changelog

- 0.2.0:
- Embedded VST3 and AUv2 SDKs directly into the crate, removing the need to download them separately. This is possible thanks to VST3 SDK's new MIT license.
- Added `vst3` and `auv2` features to enable/disable building those wrappers.
- Simplified build.rs by a lot.
- 0.1.2:
- Updated `clap-wrapper` to latest.

## License

Licensed under either of
Expand Down
Loading