diff options
-rw-r--r-- | .SRCINFO | 16 | ||||
-rw-r--r-- | .gitignore | 9 | ||||
-rw-r--r-- | PKGBUILD | 88 | ||||
-rw-r--r-- | generate-manifest-ttl.py | 38 |
4 files changed, 104 insertions, 47 deletions
@@ -1,24 +1,26 @@ pkgbase = ot-simian pkgdesc = Drum synthesizer inspired by the Simmons SDS-V - pkgver = 1.0.1 + pkgver = 1.1.0 pkgrel = 1 url = https://punklabs.com/ot-simian + arch = aarch64 arch = x86_64 groups = lv2-plugins groups = pro-audio groups = vst3-plugins license = GPL3 - makedepends = faust makedepends = dub + makedepends = faust makedepends = ldc - depends = glibc + makedepends = python depends = gcc-libs depends = libx11 optdepends = lv2-host: for LV2 plugin optdepends = vst3-host: for VST3 plugin - source = https://punklabs.com/content/projects/ot-simian/downloads/OneTrick-SIMIAN-1.0.1-Source.zip - source = Dplug::git+https://github.com/AuburnSounds/Dplug.git - sha256sums = 9bb042073a38a1c465ed4e7ed2347711c0ab83853abe341f2b8e2f652a17949e - sha256sums = SKIP + noextract = OneTrick-SIMIAN-1.1.0-Source.zip + source = https://punklabs.com/content/projects/ot-simian/downloads/OneTrick-SIMIAN-1.1.0-Source.zip + source = generate-manifest-ttl.py + sha256sums = ef84e856a3b9579cfa1b43c840d758d490accd0ef478cfd55318c2a60e897b66 + sha256sums = 261c2bfe8c692ce7df4d376b869cb832d5b3a668d3960cfef62f52d2a39d0f6f pkgname = ot-simian diff --git a/.gitignore b/.gitignore index df69c076a128..57e7fd90984f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,4 @@ -OneTrick-SIMIAN-*-Source.zip -ot-simian-* -pkg -src -Dplug +pkg/ +src/ +*.tar.* +*.zip @@ -1,59 +1,77 @@ -# Maintainer: Alexandros Theodotou <alex at zrythm dot org> +# Maintainer: OSAMC <https://github.com/osam-cologne/archlinux-proaudio> # Contributor: Christopher Arndt <aur -at- chrisarndt -dot- de> +# Contributor: Alexandros Theodotou <alex at zrythm dot org> pkgname=ot-simian -pkgver=1.0.1 +pkgver=1.1.0 pkgrel=1 pkgdesc='Drum synthesizer inspired by the Simmons SDS-V' -arch=(x86_64) +arch=(aarch64 x86_64) url='https://punklabs.com/ot-simian' license=(GPL3) -depends=(glibc gcc-libs libx11) -makedepends=(faust dub ldc) +depends=(gcc-libs libx11) +makedepends=(dub faust ldc python) optdepends=( 'lv2-host: for LV2 plugin' 'vst3-host: for VST3 plugin' ) groups=(lv2-plugins pro-audio vst3-plugins) source=("https://punklabs.com/content/projects/ot-simian/downloads/OneTrick-SIMIAN-${pkgver}-Source.zip" - 'Dplug::git+https://github.com/AuburnSounds/Dplug.git') -sha256sums=('9bb042073a38a1c465ed4e7ed2347711c0ab83853abe341f2b8e2f652a17949e' - 'SKIP') + 'generate-manifest-ttl.py') +sha256sums=('ef84e856a3b9579cfa1b43c840d758d490accd0ef478cfd55318c2a60e897b66' + '261c2bfe8c692ce7df4d376b869cb832d5b3a668d3960cfef62f52d2a39d0f6f') +noextract=("OneTrick-SIMIAN-${pkgver}-Source.zip") +_plugin_name="Punk Labs LLC OneTrick SIMIAN" +_lv2_name="$_plugin_name.lv2" +_lv2_libname="${_plugin_name// /}.so" +_vst3_libpath="$_plugin_name.vst3/Contents/$(uname -m)-linux" +_vst3_libname="$_plugin_name.so" -build() { - # FIXME: dplug-build should be packaged separately - cd Dplug/tools/dplug-build - dub --cache=local --compiler ldc2 #--skip-registry=all - cd "$srcdir"/plugin - ln -sf "$srcdir"/Dplug/tools/dplug-build/dplug-build +prepare() { + mkdir -p OneTrick-SIMIAN-${pkgver} + bsdtar -xf "$srcdir"/OneTrick-SIMIAN-${pkgver}-Source.zip -C OneTrick-SIMIAN-${pkgver} - faust --process-name processDrum -lang dlang -A "DSP/arch" \ - -a custom.d.template -o "DSP_Drum.d" --class-name DSP_Drum \ - "DSP/Simian.dsp" - faust --process-name processOutput -lang dlang -A "DSP/arch" \ - -a custom.d.template -o "DSP_Output.d" --class-name DSP_Output \ - "DSP/Simian.dsp" + cd "$srcdir"/OneTrick-SIMIAN-${pkgver} + # make dub build use LDFLAGS + if ! grep -q -- -Wl dub.json; then + sed -i -Ee 's@"lflags-linux-ldc": \[(.*)]@"lflags-linux-ldc": [ \1, "'$LDFLAGS'" ]@' dub.json + fi +} - # FIXME: second build fails with a bunch of conflicts. Need to investigate. - rm -rf .dub/build - # HACK: setting HOME to cause dub to write its cache to cwd - HOME=$(pwd) ./dplug-build --build release --config LV2 --config VST3 +build() { + cd "$srcdir"/OneTrick-SIMIAN-${pkgver} + # Generate D sources from FAUST .dsp files + faust \ + --process-name processDrum \ + -lang dlang \ + -A "OneTrick/DSP" \ + -a arch.fastmath.d.template \ + -o DSP/Generated/DSP_Drum.d \ + --class-name DSP_Drum "DSP/Main.dsp" + faust \ + --process-name processOutput \ + -lang dlang \ + -A "OneTrick/DSP" \ + -a arch.fastmath.d.template \ + -o "DSP/Generated/DSP_Output.d" \ + --class-name DSP_Output "DSP/Main.dsp" + # Build LV2 plugin + dub build --build=release-nobounds --arch=$CARCH --compiler=ldc2 --combined --config=LV2 + mkdir -p "$_lv2_name" + mv libonetrick_simian.so "$_lv2_name/$_lv2_libname" + python "$srcdir"/generate-manifest-ttl.py "$_lv2_name/$_lv2_libname" "$_lv2_name" "$_lv2_libname" + # Build VST3 plugin + dub build --build=release-nobounds --arch=$CARCH --compiler=ldc2 --combined --config=VST3 + mv libonetrick_simian.so "$_vst3_libname.so" } package() { - cd plugin - local plugin_name="Punk Labs LLC OneTrick SIMIAN" - + cd OneTrick-SIMIAN-${pkgver} # LV2 plugin bundle - local lv2_name="$plugin_name.lv2" - install -Dm644 "builds/Linux-64b-LV2/$lv2_name"/*.ttl \ - -t "$pkgdir/usr/lib/lv2/$lv2_name" - install -Dm755 "builds/Linux-64b-LV2/$lv2_name"/*.so \ - -t "$pkgdir/usr/lib/lv2/$lv2_name" + install -Dm644 "$_lv2_name"/*.ttl -t "$pkgdir/usr/lib/lv2/$_lv2_name" + install -Dm755 "$_lv2_name"/*.so -t "$pkgdir/usr/lib/lv2/$_lv2_name" # VST3 plugin bundle - local vst3_dir="$plugin_name.vst3/Contents/$(uname -m)-linux" - install -Dm755 "builds/Linux-64b-VST3/$vst3_dir/$plugin_name.so" \ - -t "$pkgdir/usr/lib/vst3/$vst3_dir" + install -Dm755 "$_vst3_libname.so" -t "$pkgdir/usr/lib/vst3/$_vst3_libpath" } diff --git a/generate-manifest-ttl.py b/generate-manifest-ttl.py new file mode 100644 index 000000000000..ca114eba29db --- /dev/null +++ b/generate-manifest-ttl.py @@ -0,0 +1,38 @@ +#!/usr/bin/env python + +import sys +from ctypes import byref, c_char_p, c_int, cdll, create_string_buffer +from os.path import join + + +def extractLV2ManifestFromBinary(binaryPath: str, outputDir: str, binaryName: str): + print("*** Extract LV2 manifest from binary...", file=sys.stderr); + lib = cdll.LoadLibrary(binaryPath) + + if not lib.GenerateManifestFromClient: + return "Couldn't find the symbol GenerateManifestFromClient in the plug-in" + + gen_manifest = lib.GenerateManifestFromClient + gen_manifest.restype = c_int + gen_manifest.argtypes =[c_char_p, c_int, c_char_p, c_int] + + # How much bytes do we need for the manifest? + c_binaryName = c_char_p(binaryName.encode("utf-8")) + manifestLen: int = gen_manifest(None, 0, c_binaryName, len(binaryName)); + + # Generate the manifest again, this time copy it in a properly sized buffer. + manifestBuf: c_char_p = create_string_buffer(manifestLen) + manifestLen = gen_manifest(manifestBuf, manifestLen, c_binaryName, len(binaryName)) + lv2Manifest: str = manifestBuf.value.decode("utf-8"); + + # write manifest + manifestPath: str = join(outputDir, "manifest.ttl") + + with open(manifestPath, "w") as fp: + fp.write(lv2Manifest) + + print( " => Written {} bytes to {}.".format(len(lv2Manifest), manifestPath), file=sys.stderr) + + +if __name__ == '__main__': + sys.exit(extractLV2ManifestFromBinary(*sys.argv[1:]) or 0) |