2021-02-17 17:02:09 +00:00
|
|
|
{ lib
|
2021-08-22 07:53:02 +00:00
|
|
|
, multiStdenv
|
2021-02-17 17:02:09 +00:00
|
|
|
, fetchFromGitHub
|
2021-05-03 20:48:10 +00:00
|
|
|
, substituteAll
|
2021-02-17 17:02:09 +00:00
|
|
|
, meson
|
|
|
|
, ninja
|
|
|
|
, pkg-config
|
|
|
|
, wine
|
|
|
|
, boost
|
|
|
|
, libxcb
|
2021-08-22 07:53:02 +00:00
|
|
|
, pkgsi686Linux
|
2021-02-17 17:02:09 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
# Derived from subprojects/bitsery.wrap
|
|
|
|
bitsery = rec {
|
|
|
|
version = "5.2.0";
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "fraillt";
|
|
|
|
repo = "bitsery";
|
|
|
|
rev = "v${version}";
|
2021-03-09 03:18:52 +00:00
|
|
|
hash = "sha256-Bxdtjn2v2lP2lCnvjzmct6QHT7FpwmXoSZtd2oEFS4w=";
|
2021-02-17 17:02:09 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
# Derived from subprojects/function2.wrap
|
|
|
|
function2 = rec {
|
|
|
|
version = "4.1.0";
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Naios";
|
|
|
|
repo = "function2";
|
|
|
|
rev = version;
|
2021-03-09 03:18:52 +00:00
|
|
|
hash = "sha256-JceZU8ZvtYhFheh8BjMvjjZty4hcYxHEK+IIo5X4eSk=";
|
2021-02-17 17:02:09 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
# Derived from subprojects/tomlplusplus.wrap
|
|
|
|
tomlplusplus = rec {
|
|
|
|
version = "2.1.0";
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "marzer";
|
|
|
|
repo = "tomlplusplus";
|
|
|
|
rev = "v${version}";
|
2021-03-09 03:18:52 +00:00
|
|
|
hash = "sha256-i6yAEqwkinkPEzzb6ynXytS1SEOUDwi8SixMf62NVzs=";
|
2021-02-17 17:02:09 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
# Derived from vst3.wrap
|
|
|
|
vst3 = rec {
|
2021-04-18 02:13:31 +00:00
|
|
|
version = "3.7.2_build_28-patched";
|
2021-02-17 17:02:09 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "robbert-vdh";
|
|
|
|
repo = "vst3sdk";
|
2021-04-18 02:13:31 +00:00
|
|
|
rev = "v${version}";
|
2021-02-17 17:02:09 +00:00
|
|
|
fetchSubmodules = true;
|
2021-04-18 02:13:31 +00:00
|
|
|
sha256 = "sha256-39pvfcg4fvf7DAbAPzEHA1ja1LFL6r88nEwNYwaDC8w=";
|
2021-02-17 17:02:09 +00:00
|
|
|
};
|
|
|
|
};
|
2021-08-22 07:53:02 +00:00
|
|
|
in multiStdenv.mkDerivation rec {
|
2021-02-17 17:02:09 +00:00
|
|
|
pname = "yabridge";
|
2021-08-22 07:53:02 +00:00
|
|
|
version = "3.5.2";
|
2021-02-17 17:02:09 +00:00
|
|
|
|
2021-03-12 07:09:13 +00:00
|
|
|
# NOTE: Also update yabridgectl's cargoHash when this is updated
|
2021-02-17 17:02:09 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "robbert-vdh";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2021-08-22 07:53:02 +00:00
|
|
|
hash = "sha256-SLiksc8lQo2A5sefKbcaJyhi8vPdp2p2Jbc7bvM0sDw=";
|
2021-02-17 17:02:09 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
# Unpack subproject sources
|
|
|
|
postUnpack = ''(
|
|
|
|
cd "$sourceRoot/subprojects"
|
|
|
|
cp -R --no-preserve=mode,ownership ${bitsery.src} bitsery-${bitsery.version}
|
|
|
|
tar -xf bitsery-patch-${bitsery.version}.tar.xz
|
|
|
|
cp -R --no-preserve=mode,ownership ${function2.src} function2-${function2.version}
|
|
|
|
tar -xf function2-patch-${function2.version}.tar.xz
|
|
|
|
cp -R --no-preserve=mode,ownership ${tomlplusplus.src} tomlplusplus
|
|
|
|
cp -R --no-preserve=mode,ownership ${vst3.src} vst3
|
|
|
|
)'';
|
|
|
|
|
2021-05-03 20:48:10 +00:00
|
|
|
patches = [
|
|
|
|
# Hard code wine path so wine version is correct in logs
|
|
|
|
(substituteAll {
|
|
|
|
src = ./hardcode-wine.patch;
|
|
|
|
inherit wine;
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2021-02-17 17:02:09 +00:00
|
|
|
postPatch = ''
|
|
|
|
patchShebangs .
|
|
|
|
'';
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
meson
|
|
|
|
ninja
|
|
|
|
pkg-config
|
|
|
|
wine
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
boost
|
|
|
|
libxcb
|
|
|
|
];
|
|
|
|
|
|
|
|
# Meson is no longer able to pick up Boost automatically.
|
|
|
|
# https://github.com/NixOS/nixpkgs/issues/86131
|
|
|
|
BOOST_INCLUDEDIR = "${lib.getDev boost}/include";
|
|
|
|
BOOST_LIBRARYDIR = "${lib.getLib boost}/lib";
|
|
|
|
|
|
|
|
mesonFlags = [
|
|
|
|
"--cross-file" "cross-wine.conf"
|
2021-08-22 07:53:02 +00:00
|
|
|
"-Dwith-bitbridge=true"
|
2021-02-17 17:02:09 +00:00
|
|
|
|
|
|
|
# Requires CMake and is unnecessary
|
|
|
|
"-Dtomlplusplus:GENERATE_CMAKE_CONFIG=disabled"
|
|
|
|
|
|
|
|
# tomlplusplus examples and tests don't build with winegcc
|
|
|
|
"-Dtomlplusplus:BUILD_EXAMPLES=disabled"
|
|
|
|
"-Dtomlplusplus:BUILD_TESTS=disabled"
|
|
|
|
];
|
|
|
|
|
2021-08-22 07:53:02 +00:00
|
|
|
preConfigure = ''
|
|
|
|
sed -i "214s|xcb.*|xcb_32bit_dep = winegcc.find_library('xcb', dirs: [ '${lib.getLib pkgsi686Linux.xorg.libxcb}/lib', ])|" meson.build
|
|
|
|
sed -i "192 i '${lib.getLib pkgsi686Linux.boost}/lib'," meson.build
|
|
|
|
'';
|
|
|
|
|
2021-02-17 17:02:09 +00:00
|
|
|
installPhase = ''
|
2021-05-29 03:34:57 +00:00
|
|
|
runHook preInstall
|
2021-02-17 17:02:09 +00:00
|
|
|
mkdir -p "$out/bin" "$out/lib"
|
2021-08-22 07:53:02 +00:00
|
|
|
cp yabridge-group*.exe{,.so} "$out/bin"
|
|
|
|
cp yabridge-host*.exe{,.so} "$out/bin"
|
2021-02-17 17:02:09 +00:00
|
|
|
cp libyabridge-vst2.so "$out/lib"
|
|
|
|
cp libyabridge-vst3.so "$out/lib"
|
2021-05-29 03:34:57 +00:00
|
|
|
runHook postInstall
|
2021-02-17 17:02:09 +00:00
|
|
|
'';
|
|
|
|
|
2021-05-03 20:48:10 +00:00
|
|
|
# Hard code wine path in wrapper scripts generated by winegcc
|
|
|
|
postFixup = ''
|
|
|
|
for exe in "$out"/bin/*.exe; do
|
|
|
|
substituteInPlace "$exe" \
|
|
|
|
--replace 'WINELOADER="wine"' 'WINELOADER="${wine}/bin/wine"'
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
2021-02-17 17:02:09 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Yet Another VST bridge, run Windows VST2 plugins under Linux";
|
|
|
|
homepage = "https://github.com/robbert-vdh/yabridge";
|
|
|
|
license = licenses.gpl3Plus;
|
2021-05-28 09:39:13 +00:00
|
|
|
maintainers = with maintainers; [ kira-bruneau ];
|
2021-02-17 17:02:09 +00:00
|
|
|
platforms = [ "x86_64-linux" ];
|
|
|
|
};
|
|
|
|
}
|