2023-02-09 11:40:11 +00:00
|
|
|
{ lib,
|
|
|
|
stdenv,
|
|
|
|
multiStdenv,
|
|
|
|
fetchFromGitHub,
|
|
|
|
requireFile,
|
|
|
|
unzip,
|
|
|
|
wine,
|
|
|
|
cmake,
|
|
|
|
makeWrapper,
|
|
|
|
wrapQtAppsHook,
|
|
|
|
file,
|
|
|
|
libX11,
|
|
|
|
qt5
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
version = "1.3.3";
|
|
|
|
|
|
|
|
airwave-src = fetchFromGitHub {
|
|
|
|
owner = "phantom-code";
|
|
|
|
repo = "airwave";
|
|
|
|
rev = version;
|
|
|
|
sha256 = "1ban59skw422mak3cp57lj27hgq5d3a4f6y79ysjnamf8rpz9x4s";
|
|
|
|
};
|
|
|
|
|
|
|
|
vst-sdk = stdenv.mkDerivation rec {
|
2023-02-09 11:40:11 +00:00
|
|
|
name = "vstsdk369_01_03_2018_build_132";
|
2020-04-24 23:36:52 +00:00
|
|
|
src = requireFile {
|
|
|
|
name = "${name}.zip";
|
|
|
|
url = "http://www.steinberg.net/en/company/developers.html";
|
2023-02-09 11:40:11 +00:00
|
|
|
sha256 = "0r29fv6yhm2m5yznn8m4my7fq01w1lpphax4sshagy6b1dgjlv3w";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
nativeBuildInputs = [ unzip ];
|
|
|
|
installPhase = "cp -r . $out";
|
2021-01-17 00:15:33 +00:00
|
|
|
meta.license = lib.licenses.unfree;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
wine-wow64 = wine.override {
|
|
|
|
wineRelease = "stable";
|
|
|
|
wineBuild = "wineWow";
|
|
|
|
};
|
|
|
|
|
|
|
|
wine-xembed = wine-wow64.overrideDerivation (oldAttrs: {
|
|
|
|
patchFlags = [ "-p2" ];
|
|
|
|
patches = [ "${airwave-src}/fix-xembed-wine-windows.patch" ];
|
|
|
|
});
|
|
|
|
|
|
|
|
in
|
|
|
|
|
|
|
|
multiStdenv.mkDerivation {
|
2022-03-30 09:31:56 +00:00
|
|
|
pname = "airwave";
|
|
|
|
inherit version;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = airwave-src;
|
|
|
|
|
2023-02-09 11:40:11 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
|
|
|
makeWrapper
|
|
|
|
wrapQtAppsHook
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-02-09 11:40:11 +00:00
|
|
|
buildInputs = [
|
|
|
|
file
|
|
|
|
libX11
|
|
|
|
qt5.qtbase
|
|
|
|
wine-xembed
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
# Binaries not used directly should land in libexec/.
|
|
|
|
substituteInPlace src/common/storage.cpp --replace '"/bin"' '"/libexec"'
|
|
|
|
|
|
|
|
# For airwave-host-32.exe.so, point wineg++ to 32-bit versions of
|
|
|
|
# these libraries, as $NIX_LDFLAGS contains only 64-bit ones.
|
|
|
|
substituteInPlace src/host/CMakeLists.txt --replace '-m32' \
|
|
|
|
'-m32 -L${wine-xembed}/lib -L${wine-xembed}/lib/wine -L${multiStdenv.cc.libc.out}/lib/32'
|
|
|
|
'';
|
|
|
|
|
|
|
|
# libstdc++.so link gets lost in 64-bit executables during
|
|
|
|
# shrinking.
|
|
|
|
dontPatchELF = true;
|
|
|
|
|
|
|
|
# Cf. https://github.com/phantom-code/airwave/issues/57
|
|
|
|
hardeningDisable = [ "format" ];
|
|
|
|
|
|
|
|
cmakeFlags = [ "-DVSTSDK_PATH=${vst-sdk}/VST2_SDK" ];
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
mv $out/bin $out/libexec
|
|
|
|
mkdir $out/bin
|
|
|
|
mv $out/libexec/airwave-manager $out/bin
|
|
|
|
wrapProgram $out/libexec/airwave-host-32.exe --set WINELOADER ${wine-xembed}/bin/wine
|
|
|
|
wrapProgram $out/libexec/airwave-host-64.exe --set WINELOADER ${wine-xembed}/bin/wine64
|
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "WINE-based VST bridge for Linux VST hosts";
|
|
|
|
longDescription = ''
|
|
|
|
Airwave is a wine based VST bridge, that allows for the use of
|
|
|
|
Windows 32- and 64-bit VST 2.4 audio plugins with Linux VST
|
|
|
|
hosts. Due to the use of shared memory, only one extra copying
|
|
|
|
is made for each data transfer. Airwave also uses the XEMBED
|
|
|
|
protocol to correctly embed the plugin editor into the host
|
|
|
|
window.
|
|
|
|
'';
|
|
|
|
homepage = "https://github.com/phantom-code/airwave";
|
|
|
|
license = licenses.mit;
|
|
|
|
platforms = [ "x86_64-linux" ];
|
|
|
|
maintainers = with maintainers; [ michalrus ];
|
|
|
|
hydraPlatforms = [];
|
|
|
|
};
|
|
|
|
}
|