diff options
Diffstat (limited to 'audio/yabridge')
-rw-r--r-- | audio/yabridge/README | 36 | ||||
-rw-r--r-- | audio/yabridge/fix-libdbus-connection.patch | 48 | ||||
-rw-r--r-- | audio/yabridge/slack-desc | 19 | ||||
-rw-r--r-- | audio/yabridge/yabridge.SlackBuild | 239 | ||||
-rw-r--r-- | audio/yabridge/yabridge.info | 14 |
5 files changed, 356 insertions, 0 deletions
diff --git a/audio/yabridge/README b/audio/yabridge/README new file mode 100644 index 0000000000..d246b25773 --- /dev/null +++ b/audio/yabridge/README @@ -0,0 +1,36 @@ +Yet Another way to use Windows VST plugins on Linux. Yabridge seamlessly +supports using both 32-bit and 64-bit Windows VST2 and VST3 plugins in a +64-bit Linux VST host as if they were native VST2 and VST3 plugins, with +optional support for plugin groups to enable inter-plugin communication +for VST2 plugins and quick startup times. Its modern concurrent +architecture and focus on transparency allows yabridge to be both fast +and highly compatible, while also staying easy to debug and maintain. + +This script will build yabridge bitbridge both 64bit and 32bit +on Slackware64 and only 32bit plugin host on Slackware32 with +yabridgectl helper tool for all versions of Slackware. +This program depends on any 64+32 (Slackware64 multilib) or +a 32 (Slackware32) version of wine with esync and/or fsync. +No ARM support yet. + +Make sure you have configured you're system with real-time priority. +visit https://docs.slackware.com and search: minimizing_latency +Don't forget WINEESYNC=1 or WINEFSYNC=1 environment variables or +you will have problems with performance and xruns. +You can set them in /etc/profile like this: +export WINEFSYNC=1 +export WINEESYNC=1 + +build options +ARG_CLAP="false" +ARG_VST3="true" +ARG_WINEDBG="false" + +Read the documentation in /usr/doc/yabridge-* + +OPTIONAL DEPENDENCIES NEEDED FOR COMPILING +clap + +OPTIONAL DEPENDENCIES +winetricks: For correct fonts displayed by plugins +rtirq: For better latency of audio peripherals diff --git a/audio/yabridge/fix-libdbus-connection.patch b/audio/yabridge/fix-libdbus-connection.patch new file mode 100644 index 0000000000..4acbee2927 --- /dev/null +++ b/audio/yabridge/fix-libdbus-connection.patch @@ -0,0 +1,48 @@ +commit 8d508dc2fefe9745ffa9cb14e1d7519a7852aa95 +Author: Robbert van der Helm <mail@robbertvanderhelm.nl> +Date: Sun Apr 7 22:49:00 2024 +0200 + + Fix segfault destroying libdbus connection + +diff --git a/CHANGELOG.md b/CHANGELOG.md +index a1739b3d..429880a6 100644 +--- a/CHANGELOG.md ++++ b/CHANGELOG.md +@@ -6,6 +6,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), + and this project adheres to [Semantic + Versioning](https://semver.org/spec/v2.0.0.html). + ++## [Unreleased] ++ ++### Fixed ++ ++- Fixed a potential segfault when unloading yabridge. ++ + ## [5.1.0] - 2023-12-23 + + ### Added +diff --git a/src/common/notifications.cpp b/src/common/notifications.cpp +index 403103bf..654b6c83 100644 +--- a/src/common/notifications.cpp ++++ b/src/common/notifications.cpp +@@ -57,9 +57,19 @@ std::mutex libdbus_mutex; + LIBDBUS_FUNCTIONS + #undef X + ++/** ++ * The deleter used for `libdbus_connection`. `libdbus_connection` can't ++ * directly reference `libdbus_connection_unref` directly because it will not ++ * yet have been initialized until just before `libdbus_connection` gets ++ * initialized. ++ */ ++static void close_dbus_connection(DBusConnection* connection) { ++ libdbus_connection_unref(connection); ++} ++ + std::unique_ptr<DBusConnection, void (*)(DBusConnection*)> libdbus_connection( + nullptr, +- libdbus_connection_unref); ++ close_dbus_connection); + + /** + * Try to set up D-Bus. Returns `false` if a function could not be resolved or diff --git a/audio/yabridge/slack-desc b/audio/yabridge/slack-desc new file mode 100644 index 0000000000..4d6fe7fbd3 --- /dev/null +++ b/audio/yabridge/slack-desc @@ -0,0 +1,19 @@ +# HOW TO EDIT THIS FILE: +# The "handy ruler" below makes it easier to edit a package description. +# Line up the first '|' above the ':' following the base package name, and +# the '|' on the right side marks the last column you can put a character in. +# You must make exactly 11 lines for the formatting to be correct. It's also +# customary to leave one space after the ':' except on otherwise blank lines. + + |-----handy-ruler------------------------------------------------------| +yabridge: yabridge (Yet Another way to use Windows VST plugins on Linux) +yabridge: +yabridge: Yabridge seamlessly supports using both 32-bit and 64-bit Windows VST2 +yabridge: and VST3 plugins in a 64-bit Linux VST host as if they were +yabridge: native VST2 and VST3 plugins, with optional support for plugin groups +yabridge: to enable inter-plugin communication for VST2 plugins and quick +yabridge: startup times. Its modern concurrent architecture and focus on +yabridge: transparency allows yabridge to be both fast and highly compatible, +yabridge: while also staying easy to debug and maintain. +yabridge: +yabridge: diff --git a/audio/yabridge/yabridge.SlackBuild b/audio/yabridge/yabridge.SlackBuild new file mode 100644 index 0000000000..f54428d010 --- /dev/null +++ b/audio/yabridge/yabridge.SlackBuild @@ -0,0 +1,239 @@ +#!/bin/bash + +# Slackware build script for yabridge + +# Copyright 2022 Martin Bångens Sweden +# All rights reserved. +# +# Redistribution and use of this script, with or without modification, is +# permitted provided that the following conditions are met: +# +# 1. Redistributions of this script must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +cd $(dirname $0) || exit 1 ; CWD=$(pwd) + +PRGNAM=yabridge +VERSION=${VERSION:-5.1.0} +BUILD=${BUILD:-2} +TAG=${TAG:-_SBo} +PKGTYPE=${PKGTYPE:-tgz} +ARG_CLAP=${ARG_CLAP:-NO} +ARG_VST3=${ARG_VST3:-YES} +ARG_WINEDBG=${ARG_WINEDBG:-NO} +#false/true +if [ -z "$ARCH" ]; then + case "$( uname -m )" in + i?86) ARCH=i586 ;; + arm*) ARCH=arm ;; + *) ARCH=$( uname -m ) ;; + esac +fi + +if [[ "$ARG_CLAP" = "YES" || "$ARG_CLAP" = "true" ]]; then + ARG_CLAP="true" +else + ARG_CLAP="false" +fi + +if [[ "$ARG_VST3" = "YES" || "$ARG_VST3" = "true" ]]; then + ARG_VST3="true" +else + ARG_VST3="false" +fi + +if [[ "$ARG_WINEDBG" = "YES" || "$ARG_WINEDBG" = "true" ]]; then + BUILDTYPE="debug" + ARG_WINEDBG="true" +else + BUILDTYPE="release" + ARG_WINEDBG="false" +fi + +# If the variable PRINT_PACKAGE_NAME is set, then this script will report what +# the name of the created package would be, and then exit. This information +# could be useful to other scripts. +if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then + echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE" + exit 0 +fi + +if [ $ARCH = "arm" ]; then + echo "This script only supports x86 for now but Slackware ARM and ARM64 is happening FIXME" + exit 1 +fi + +which wine &>/dev/null +WINE_IN_PATH=$? +which wine64 &>/dev/null +WINE64_IN_PATH=$? + +if [ "$ARCH" = "i586" ] || [ "$ARCH" = "i686" ]; then + LIBDIRSUFFIX="" + if (($WINE_IN_PATH)); then + echo "This script look for wine in PATH and needs it for compiling and using yabridge on i586" + exit 1 + fi +elif [ $ARCH = "x86_64" ]; then + LIBDIRSUFFIX="64" + if (($WINE_IN_PATH)) || (($WINE64_IN_PATH)); then + echo "This script look for wine and wine64 in PATH and needs them both for compiling and using yabridge on x86_64" + exit 1 + fi +fi + +export PATH="/opt/rust16/bin:$PATH" +if [ -z "$LD_LIBRARY_PATH" ]; then + export LD_LIBRARY_PATH="/opt/rust16/lib$LIBDIRSUFFIX" +else + export LD_LIBRARY_PATH="/opt/rust16/lib$LIBDIRSUFFIX:$LD_LIBRARY_PATH" +fi + +TMP=${TMP:-/tmp/SBo} +PKG=$TMP/package-$PRGNAM +OUTPUT=${OUTPUT:-/tmp} + +set -e + +rm -rf $PKG +mkdir -p $TMP $PKG $OUTPUT +cd $TMP +rm -rf $PRGNAM-$VERSION +tar xvf $CWD/$PRGNAM-$VERSION.tar.gz +cd $PRGNAM-$VERSION +echo -e "\Unpacking documentation, cargo dependencies and vstsdk meson.build" +tar xvf $CWD/yabridge-html-docs-plus-build-files-$VERSION.tar.gz +chown -R root:root . +find -L . \ + \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \ + -o -perm 511 \) -exec chmod 755 {} \; -o \ + \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ + -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; + +patch -p1 < $CWD/fix-libdbus-connection.patch + +#Build only capitalized +sed -i "s|bitsery_dep = dependency('bitsery', version : '>=5.2.0')|bitsery_dep = dependency('Bitsery', version : '>=5.2.0')|g" meson.build +sed -i "s|bitsery_dep = dependency('bitsery', 'Bitsery', version : '>=5.2.0')|bitsery_dep = dependency('Bitsery', version : '>=5.2.0')|g" meson.build + +mkdir subprojects/vst3 +tar xvzf $CWD/vst3sdk-3.7.7.tar.gz --strip-components=1 -C subprojects/vst3 +cp yabridge-html-docs-plus-build-files-$VERSION/meson.build subprojects/vst3 + +if [ "$ARCH" = "i586" ] || [ "$ARCH" = "i686" ]; then + meson setup \ + build \ + --cross-file=cross-wine.conf \ + --buildtype=$BUILDTYPE \ + --unity=on \ + --unity-size=1000 \ + --wrap-mode=nodownload \ + -Dbitbridge=true \ + -Dclap=$ARG_CLAP \ + -Dvst3=$ARG_VST3 \ + -Dwinedbg=$ARG_WINEDBG \ + -Dsystem-asio=true \ + -Dbuild.cpp_args='-m32' \ + -Dbuild.cpp_link_args='-m32' +elif [ "$ARCH" = "x86_64" ]; then + meson setup \ + build \ + --cross-file=cross-wine.conf \ + --buildtype=$BUILDTYPE \ + --unity=on \ + --unity-size=1000 \ + --wrap-mode=nodownload \ + -Dbitbridge=true \ + -Dclap=$ARG_CLAP \ + -Dvst3=$ARG_VST3 \ + -Dwinedbg=$ARG_WINEDBG \ + -Dsystem-asio=true +else + echo "Unsupported architecture" +fi + +# Build yabridge +# The unity build takes can take up to 2 GB of RAM per target, so if the +# system does not have enough RAM to build everything at once we'll limit the +# number of concurrent jobs +# NOTE: The `LANG=C` is needed because apparently the `pt_BR.UTF-8` locale +# changes `Mem:` to `Mem.:`, so who knows what other locales might do +total_memory=$(env LANG=C free --gibi --si | awk '/^Mem:/ { print $2 }') +num_jobs=$((total_memory / 4)) +echo -e "\n$total_memory gigabytes of RAM detected, limiting the number of build jobs to $num_jobs\n" +ninja -C build -j"$num_jobs" + +cd ./tools/yabridgectl + +# Offline build +# This makes cargo target the locale identical copy of reflink in vendor source directory +sed -i 's|{ git = "https://github.com/nicokoch/reflink", rev = "e8d93b465f5d9ad340cd052b64bbc77b8ee107e2" }|"0.1.3"|g' Cargo.toml +sed -i 's|git+https://github.com/nicokoch/reflink?rev=e8d93b465f5d9ad340cd052b64bbc77b8ee107e2#e8d93b465f5d9ad340cd052b64bbc77b8ee107e2|registry+https://github.com/rust-lang/crates.io-index|g' Cargo.lock +CARGO_HOME=../../yabridge-html-docs-plus-build-files-$VERSION/cargo/CARGO_HOME cargo build --release --locked --all-features --offline --target-dir=target + +cd ../../build + +install -dm755 "$PKG/usr/bin" +if [ "$ARCH" = "i586" ] || [ "$ARCH" = "i686" ]; then + install yabridge-host-32.exe{,.so} "$PKG/usr/bin" + install -dm755 "$PKG/usr/lib" + install libyabridge-vst2.so "$PKG/usr/lib" + install libyabridge-chainloader-vst2.so "$PKG/usr/lib" + if [ $ARG_VST3 = "true" ]; then + install libyabridge-vst3.so "$PKG/usr/lib" + install libyabridge-chainloader-vst3.so "$PKG/usr/lib" + fi + if [ $ARG_CLAP = "true" ]; then + install libyabridge-clap.so "$PKG/usr/lib" + install libyabridge-chainloader-clap.so "$PKG/usr/lib" + fi +elif [ "$ARCH" = "x86_64" ]; then + install yabridge-host.exe{,.so} "$PKG/usr/bin" + install yabridge-host-32.exe{,.so} "$PKG/usr/bin" + install -dm755 "$PKG/usr/lib64" + install libyabridge-vst2.so "$PKG/usr/lib64" + install libyabridge-chainloader-vst2.so "$PKG/usr/lib64" + if [ $ARG_VST3 = "true" ]; then + install libyabridge-vst3.so "$PKG/usr/lib64" + install libyabridge-chainloader-vst3.so "$PKG/usr/lib64" + fi + if [ $ARG_CLAP = "true" ]; then + install libyabridge-clap.so "$PKG/usr/lib64" + install libyabridge-chainloader-clap.so "$PKG/usr/lib64" + fi +fi + +install ../tools/yabridgectl/target/release/yabridgectl "$PKG/usr/bin" + +cd .. + +find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \ + | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true + +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION + cp -a \ + README.md \ + docs/architecture.md \ + COPYING \ + CHANGELOG.md \ + $PKG/usr/doc/$PRGNAM-$VERSION +cp tools/yabridgectl/README.md $PKG/usr/doc/$PRGNAM-$VERSION/README-yabridgectl.md +cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild +cp -a yabridge-html-docs-plus-build-files-$VERSION/html/* $PKG/usr/doc/$PRGNAM-$VERSION + +mkdir -p $PKG/install +cat $CWD/slack-desc > $PKG/install/slack-desc + +cd $PKG +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE diff --git a/audio/yabridge/yabridge.info b/audio/yabridge/yabridge.info new file mode 100644 index 0000000000..c68975b20a --- /dev/null +++ b/audio/yabridge/yabridge.info @@ -0,0 +1,14 @@ +PRGNAM="yabridge" +VERSION="5.1.0" +HOMEPAGE="https://github.com/robbert-vdh/yabridge" +DOWNLOAD="https://github.com/robbert-vdh/yabridge/archive/5.1.0/yabridge-5.1.0.tar.gz \ + https://github.com/noisecode3/vst3sdk/archive/3.7.7/vst3sdk-3.7.7.tar.gz \ + https://github.com/noisecode3/yabridge-html-docs-plus-build-files/archive/v5.1.0/yabridge-html-docs-plus-build-files-5.1.0.tar.gz" +MD5SUM="2383d67c9089a4fda8ae311baaa8fe3b \ + f9e2185ea8cdfbdc4d99c4a5f5e4d426 \ + a58876a05ac16ada09f750a4b8564443" +DOWNLOAD_x86_64="UNSUPPORTED" +MD5SUM_x86_64="" +REQUIRES="wine-staging asio bitsery function2 ghc_filesystem tomlplusplus rust16" +MAINTAINER="Martin Bångens" +EMAIL="marbangens@gmail.com" |