-
Notifications
You must be signed in to change notification settings - Fork 0
Platform: LV2 Plugins
Currently, the LV2 plugins section on Patchstorage (https://patchstorage.com/platform/lv2-plugins/) is dedicated to linux-amd64
, rpi-aarch64
& patchbox-os-arm32
plugin builds. Let us know if you would like to see support for additional targets.
At this point in time, you need to use Patchstorage API to upload and update LV2 plugins on the site. To make your life easier, we have prepared a Python CLI utility. You can download it here - patchstorage-lv2-uploader.
For building plugins, please see patchstorage-lv2-builder.
More detailed instructions are down below.
patchstorage-lv2-builder helps you build your LV2 plugins for different platforms locally. It utilizes prebuilt Docker images and is derived from moddevices/mod-plugin-builder build system. Currently, the builder supports x86_64
, raspberrypi3_armv8
, raspberrypi4_aarch64
platforms.
The Docker builder images are available on https://hub.docker.com/repositories/patchstorage, and are pulled by the ./docker-init
script as shown in the Initial setup section.
- Linux or MacOS-based computer (or Linux running in a VM)
- The latest Docker Desktop or Docker Engine set up on your platform
- Docker Compose plugin
- git
-
Fork & clone https://github.com/patchstorage/patchstorage-lv2-builder
-
Initialize Git submodules and pull prebuilt Docker LV2 builder images:
cd patchstorage-lv2-builder git submodule init git submodule update ./docker-init
-
cd plugins/package
and make a subfolder for your LV2 plugin. Say we’ll be usingmy-plugin
name:mkdir my-plugin
-
cd my-plugin
and create a .mk file with exactly the same name as the folder nametouch my-plugin.mk
. Openmy-plugin.mk
in a text editor of your choice. -
Depending on the build system of your lv2 plugin, open one of the existing packages to base your .mk file on:
-
make
: abgate.mk -
cmake
: aether.mk - autotools: amsynth.mk
- waf: blop-lv2.mk
- dpf: shiro-plugins.mk
- For anything else - refer to the Buildroot documentation linked below.
All these .mk files conform to Buildroot package makefiles, you can find detailed documentation here.
-
-
Copy the contents of one of the example .mk file that matches your plugin the closest into your own opened .mk file. Then adjust the common variable name prefix to match your folder name, like replacing every
ABGATE_
occurrences withMY_PLUGIN_
, then adjust the values of the variables accordingly, such as the location of your source code repository. Usually, it’s a git repository URL. It should be accessible by the network, as the builder is running in a docker instance that doesn’t have access to the rest of your file system.The end result of the build must install whatever is necessary into
$(TARGET_DIR)/usr/lib/lv2/...
-
Once you’re done with the .mk file, it’s time to trigger the builds,
cd
to the base path ofpatchstorage-lv2-builder
, and run a command like:./docker-build-all my-plugin
It will build the plugin for every platform supported, and the results will end up in
docker-workdir/<platform>/my-plugin.lv2
. Keep an eye on the build messages being printed in case any errors occur that should be fixed. -
Once the plugin builds and loads and runs properly, submit a pull request to the main
patchstorage-lv2-builder
repository!
These are the steps to overwrite/add additional files (GUIs, *.ttls, etc.) to the package target directory from the patchstorage-lv2-data
submodule.
-
Update the builder repo and all the submodules.
git pull git submodule init git submodule update
-
Create a symbolic link from the
patchstorage-lv2-data/plugins/BUNDLE_NAME.lv2
to theplugins/package/BUNDLE_NAME
folder, e.g.cd plugins/package/aether/ ln -s ../../../patchstorage-lv2-data/plugins/aether.lv2 aether.lv2
-
Add an additional step to the *.mk file to copy/overwrite files in the package target directory.
nano aether.mk # Add a line like this to ..._INSTALL_TARGET_CMDS: cp -rL $($(PKG)_PKGDIR)/aether.lv2/* $(TARGET_DIR)/usr/lib/lv2/aether.lv2/
Note from the build root manual (https://buildroot.org/downloads/manual/manual.html):
LIBFOO_INSTALL_TARGET_CMDS lists the actions to be performed to install the package to the target directory, when the package is a target package. The package must install its files to the directory given by $(TARGET_DIR). Only the files required for execution of the package have to be installed. Header files, static libraries and documentation will be removed again when the target filesystem is finalized.
Here is an example commit implementing patchstorage-lv2-data
overwrite for the aether package - https://github.com/patchstorage/patchstorage-lv2-builder/commit/aa232e14486f2c7857c4d4d38fd663b068918d59.
patchstorage-lv2-uploader is a utility for uploading LV2 plugins to patchstorage.com.
Here is the map of the corresponding patchstorage-lv2-builder and Patchstorage targets.
Builder Target | Patchstorage Target |
---|---|
x86_64 | linux-amd64 |
raspberrypi4_aarch64 | rpi-aarch64 |
raspberrypi3_armv8 | patchbox-os-arm32 |
- Fork & clone https://github.com/patchstorage/patchstorage-lv2-uploader
- Open a terminal window and run
pip install requests click rdflib
- Move the plugin builds you want to upload to the
/plugins
directory. All plugin builds should be in their corresponding folders inside the corresponding Patchstorage target folder, e.g.,/patchstorage-lv2-uploader/plugins/rpi-aarch64/my-plugin.lv2/
- Run
python ./uploader.py prepare my-plugin.lv2
- this command will generate.tar.gz
andpatchstorage.json
files in the/dist
directory. Some information may be missing, so you must modifyplugins.json
orlicenses.json
files. - Check the
/dist
folder for the results, especially thepatchstorage.json
files. Make adjustments if needed. - Run
python ./uploader push my-plugin.lv2 --username <patchstorage_username>
command and follow the instructions. After uploading a plugin, please check the resulting entry on Patchstorage. - If you made any changes to the
plugins.json
orlicenses.json
files, create a pull request to this repo.