Skip to content

Commit d2c1caa

Browse files
committed
Init commit (with example plugin)
0 parents  commit d2c1caa

7 files changed

Lines changed: 351 additions & 0 deletions

File tree

.github/FUNDING.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
github: timothyschoen

.github/workflows/cmake.yml

Lines changed: 256 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,256 @@
1+
name: CMake
2+
3+
on: [push, workflow_dispatch]
4+
5+
env:
6+
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
7+
BUILD_TYPE: Release
8+
CMAKE_BUILD_PARALLEL_LEVEL: 4
9+
10+
jobs:
11+
macos-universal-build:
12+
runs-on: macos-latest
13+
14+
steps:
15+
- uses: actions/checkout@v4
16+
with:
17+
submodules: recursive
18+
fetch-depth: 0
19+
20+
- name: ccache
21+
uses: hendrikmuhs/ccache-action@v1.2
22+
with:
23+
key: macos
24+
25+
- name: Build plugins
26+
run: |
27+
python3 ./build.py
28+
move Build Build-macOS-Universal
29+
30+
- name: Archive Artifacts
31+
uses: actions/upload-artifact@v4
32+
with:
33+
name: Build-macOS-Universal
34+
path: Build-macOS-Universal
35+
36+
macos-legacy-build:
37+
runs-on: macos-13
38+
39+
steps:
40+
- uses: actions/checkout@v4
41+
with:
42+
submodules: recursive
43+
fetch-depth: 0
44+
45+
- name: ccache
46+
uses: hendrikmuhs/ccache-action@v1.2
47+
with:
48+
key: macos-legacy
49+
50+
- name: Build plugins
51+
run: |
52+
python3 ./build.py
53+
move Build Build-macOS-Legacy
54+
55+
- name: Archive Artifacts
56+
uses: actions/upload-artifact@v4
57+
with:
58+
name: Build-macOS-Legacy
59+
path: Build-macOS-Legacy
60+
61+
windows-64-build:
62+
runs-on: windows-2022
63+
steps:
64+
- uses: actions/checkout@v4
65+
with:
66+
submodules: recursive
67+
fetch-depth: 0
68+
69+
- name: Build plugins
70+
run: |
71+
python3 ./build.py
72+
move Build Build-Win64
73+
74+
- name: Archive Artifacts
75+
uses: actions/upload-artifact@v4
76+
with:
77+
name: Build-Win64
78+
path: Build-Win64
79+
80+
windows-32-build:
81+
runs-on: windows-2022
82+
83+
steps:
84+
- uses: actions/checkout@v4
85+
with:
86+
submodules: recursive
87+
fetch-depth: 0
88+
89+
- name: Build plugins
90+
run: |
91+
python3 ./build.py
92+
move Build Build-Win32
93+
94+
- name: Archive Artifacts
95+
uses: actions/upload-artifact@v4
96+
with:
97+
name: Build-Win32
98+
path: Build-Win32
99+
100+
linux-x64-build:
101+
name: ${{ matrix.name }}
102+
runs-on: ubuntu-latest
103+
container:
104+
image: ${{ matrix.os }}
105+
options: --privileged
106+
volumes:
107+
- /sys/fs/cgroup:/sys/fs/cgroup
108+
109+
strategy:
110+
fail-fast: false
111+
matrix:
112+
include:
113+
- name: Ubuntu-22.04-x64
114+
os: ubuntu:22.04
115+
pacman: apt
116+
- name: Ubuntu-24.04-x64
117+
os: ubuntu:24.04
118+
pacman: apt
119+
- name: Debian-x64
120+
os: debian
121+
pacman: apt
122+
- name: Fedora-41-x64
123+
os: fedora:41
124+
pacman: dnf
125+
- name: Fedora-42-x64
126+
os: fedora:42
127+
pacman: dnf
128+
- name: OpenSUSE-Tumbleweed-x64
129+
os: opensuse/tumbleweed
130+
pacman: zypper
131+
- name: Arch-x64
132+
os: archlinux
133+
pacman: pacman
134+
135+
steps:
136+
- name: Install Dependencies (dnf)
137+
if: ${{ matrix.pacman == 'dnf' }}
138+
run: dnf install -y git cmake alsa-lib-devel libXinerama-devel freetype-devel curl libcurl-devel wget bzip2 gcc-c++ libXi-devel libXcomposite-devel freeglut-devel libXrandr-devel libXcursor-devel xz ccache python python3-pip jack-audio-connection-kit-devel libatomic unzip
139+
140+
- name: Install Dependencies (apt)
141+
if: ${{ matrix.pacman == 'apt' }}
142+
run: apt update && DEBIAN_FRONTEND=noninteractive TZ="Europe/Amsterdam" apt install -y cmake git wget bzip2 build-essential libasound2-dev libjack-jackd2-dev curl libcurl4-openssl-dev libfreetype6-dev libx11-dev libxi-dev libxcomposite-dev libxcursor-dev libxcursor-dev libxext-dev libxrandr-dev libxinerama-dev ccache python3 python3-pip freeglut3-dev unzip
143+
144+
- name: Install Dependencies (zypper)
145+
if: ${{ matrix.pacman == 'zypper' }}
146+
run: zypper refresh && zypper install -y git rsync wget bzip2 xz tar cmake alsa-devel libXinerama-devel libXi-devel libcurl-devel libXcomposite-devel freeglut-devel libXrandr-devel libXcursor-devel freetype2-devel gcc gcc-c++ curl ccache python3 libjack-devel gawk unzip
147+
148+
- name: Install Dependencies (pacman)
149+
if: ${{ matrix.pacman == 'pacman' }}
150+
run: pacman -Sy && pacman -S --noconfirm cmake wget bzip2 git alsa-lib freetype2 libx11 libxcursor libxi libxext libxinerama libxrandr libxrender webkit2gtk cmake make gcc pkgconf python python-pip curl ccache freeglut mesa glfw-x11 glew jack2 openssl unzip && pacman --noconfirm -Syu
151+
152+
- uses: actions/checkout@v4
153+
with:
154+
submodules: recursive
155+
fetch-depth: 0
156+
157+
- name: Build plugins
158+
run: |
159+
python3 ./build.py
160+
move Build Build-${{ matrix.name }}
161+
162+
- name: Archive Artifacts
163+
uses: actions/upload-artifact@v4
164+
with:
165+
name: Build-${{ matrix.name }}
166+
path: Build-${{ matrix.name }}
167+
168+
linux-arm-build:
169+
name: ${{ matrix.name }}
170+
runs-on: ubuntu-24.04-arm
171+
container:
172+
image: ${{ matrix.os }}
173+
options: --privileged
174+
volumes:
175+
- /sys/fs/cgroup:/sys/fs/cgroup
176+
177+
strategy:
178+
fail-fast: false
179+
matrix:
180+
include:
181+
- name: Ubuntu-22.04-aarch64
182+
os: ubuntu:22.04
183+
pacman: apt
184+
- name: Ubuntu-24.04-aarch64
185+
os: ubuntu:24.04
186+
pacman: apt
187+
- name: Debian-aarch64
188+
os: debian
189+
pacman: apt
190+
- name: Fedora-41-aarch64
191+
os: fedora:41
192+
pacman: dnf
193+
- name: Fedora-42-aarch64
194+
os: fedora:42
195+
pacman: dnf
196+
197+
steps:
198+
- name: Install Dependencies (dnf)
199+
if: ${{ matrix.pacman == 'dnf' }}
200+
run: dnf install -y git cmake alsa-lib-devel libXinerama-devel freetype-devel curl libcurl-devel wget bzip2 gcc-c++ libXi-devel libXcomposite-devel freeglut-devel libXrandr-devel libXcursor-devel xz ccache python python3-pip jack-audio-connection-kit-devel libatomic unzip
201+
202+
- name: Install Dependencies (apt)
203+
if: ${{ matrix.pacman == 'apt' }}
204+
run: apt update && DEBIAN_FRONTEND=noninteractive TZ="Europe/Amsterdam" apt install -y cmake git wget bzip2 build-essential libasound2-dev libjack-jackd2-dev curl libcurl4-openssl-dev libfreetype6-dev libx11-dev libxi-dev libxcomposite-dev libxcursor-dev libxcursor-dev libxext-dev libxrandr-dev libxinerama-dev ccache python3 python3-pip freeglut3-dev unzip
205+
206+
- uses: actions/checkout@v4
207+
with:
208+
submodules: recursive
209+
fetch-depth: 0
210+
211+
- name: Update cmake
212+
working-directory: ${{github.workspace}}
213+
run: ./.github/scripts/install-cmake.sh
214+
215+
- name: ccache
216+
uses: hendrikmuhs/ccache-action@v1.2
217+
with:
218+
key: ${{ matrix.name }}
219+
220+
- name: Configure
221+
working-directory: ${{github.workspace}}
222+
run: mkdir build && cd build && CXX=g++ cmake -DNANOVG_GLES_IMPLEMENTATION=1 -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache .. -G "Unix Makefiles"
223+
224+
- name: Build
225+
working-directory: ${{github.workspace}}/build
226+
run: cmake --build . --config $BUILD_TYPE
227+
228+
- name: Prepare Artefacts
229+
working-directory: ${{github.workspace}}
230+
run: ./.github/scripts/package-Linux.sh plugdata-${{ matrix.name }}.tar.xz
231+
232+
- name: Upload to Cloud Storage
233+
if: github.ref == 'refs/heads/develop'
234+
run: |
235+
curl "https://awscli.amazonaws.com/awscli-exe-linux-aarch64.zip" -o "awscliv2.zip"
236+
unzip awscliv2.zip
237+
./aws/install
238+
aws configure set aws_access_key_id ${{ secrets.AWS_ACCESS_KEY }}
239+
aws configure set aws_secret_access_key ${{ secrets.AWS_SECRET_KEY }}
240+
aws configure set default.region eu-north-1
241+
aws s3 cp ./plugdata-${{ matrix.name }}.tar.xz s3://plugdata-nightly/
242+
aws s3 cp ./plugdata-${{ matrix.name }}.tar.xz.txt s3://plugdata-nightly/
243+
244+
- name: Archive Artifacts
245+
uses: actions/upload-artifact@v4
246+
with:
247+
name: plugdata-${{ matrix.name }}
248+
path: plugdata-${{ matrix.name }}.tar.xz
249+
250+
- name: Release Artifacts
251+
uses: softprops/action-gh-release@v1
252+
if: startsWith(github.ref, 'refs/tags/')
253+
with:
254+
prerelease: true
255+
draft: true
256+
files: plugdata-${{ matrix.name }}

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "plugdata"]
2+
path = plugdata
3+
url = https://github.com/plugdata-team/plugdata.git

Plugins/N-TILT.zip

48.4 KB
Binary file not shown.

build.py

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
import json
2+
import subprocess
3+
from pathlib import Path
4+
import platform
5+
import os
6+
import shutil
7+
8+
# Detect platform and choose CMake generator
9+
system = platform.system()
10+
if system == "Darwin": # macOS
11+
cmake_generator = ["-G", "Xcode"]
12+
elif system == "Windows":
13+
cmake_generator = ["-G", "Visual Studio 17 2022"] # You can adjust this if using another version
14+
else: # Assume Linux
15+
cmake_generator = ["-G", "Ninja"]
16+
17+
# Load config.json
18+
with open("config.json") as f:
19+
plugins_config = json.load(f)
20+
21+
plugdata_dir = Path("plugdata").resolve()
22+
builds_parent_dir = plugdata_dir.parent # Build folders go here
23+
24+
plugins_dir = os.path.join("plugdata", "Plugins")
25+
build_output_dir = os.path.join("Build")
26+
os.makedirs(build_output_dir, exist_ok=True)
27+
28+
if not plugdata_dir.is_dir():
29+
print(f"plugdata directory not found: {plugdata_dir}")
30+
exit(1)
31+
32+
for plugin in plugins_config:
33+
name = plugin["name"]
34+
zip_path = Path(plugin["path"]).resolve()
35+
formats = plugin.get("formats", [])
36+
is_fx = plugin.get("type", "").lower() == "fx"
37+
38+
if not zip_path.is_file():
39+
print(f"Missing zip file for {name}: {zip_path}")
40+
continue
41+
42+
build_dir = builds_parent_dir / f"Build-{name}"
43+
print(f"\nProcessing: {name}")
44+
45+
# Run cmake configuration inside plugdata
46+
cmake_configure = [
47+
"cmake",
48+
*cmake_generator,
49+
f"-B{build_dir}",
50+
f"-DCUSTOM_PLUGIN_NAME={name}",
51+
f"-DCUSTOM_PLUGIN_PATH={zip_path}",
52+
"-DENABLE_GEM=0",
53+
"-DENABLE_SFIZZ=0",
54+
]
55+
result_configure = subprocess.run(cmake_configure, cwd=plugdata_dir)
56+
if result_configure.returncode != 0:
57+
print(f"Failed cmake configure for {name}")
58+
continue
59+
60+
# Build all combinations of type + format
61+
for fmt in formats:
62+
target = f"plugdata_{'fx_' if is_fx else ''}{fmt}"
63+
cmake_build = [
64+
"cmake",
65+
"--build", str(build_dir),
66+
"--target", target
67+
]
68+
print(f"Building target: {target}")
69+
result_build = subprocess.run(cmake_build, cwd=plugdata_dir)
70+
if result_build.returncode != 0:
71+
print(f"Failed to build target: {target}")
72+
else:
73+
print(f"Successfully built: {target}")
74+
format_path = os.path.join(plugins_dir, fmt)
75+
76+
if os.path.isdir(format_path):
77+
target_dir = os.path.join(build_output_dir, fmt)
78+
79+
# Clear existing target folder if it exists, then copy
80+
if os.path.exists(target_dir):
81+
shutil.rmtree(target_dir)
82+
shutil.copytree(format_path, target_dir)

config.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[
2+
{
3+
"name": "N-TILT",
4+
"path": "Plugins/N-TILT.zip",
5+
"formats": ["VST3", "AU", "LV2"],
6+
"type": "fx"
7+
}
8+
]

plugdata

Submodule plugdata added at 25c12f8

0 commit comments

Comments
 (0)