2021-01-09 07:15:41 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, meson
|
|
|
|
, ninja
|
|
|
|
, pkg-config
|
|
|
|
, wine
|
|
|
|
, boost
|
|
|
|
, libxcb
|
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
# Derived from subprojects/bitsery.wrap
|
|
|
|
bitsery = rec {
|
|
|
|
version = "5.2.0";
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "fraillt";
|
|
|
|
repo = "bitsery";
|
|
|
|
rev = "v${version}";
|
2021-02-26 16:03:54 +00:00
|
|
|
hash = "sha256-Bxdtjn2v2lP2lCnvjzmct6QHT7FpwmXoSZtd2oEFS4w=";
|
2021-01-09 07:15:41 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
# Derived from subprojects/function2.wrap
|
|
|
|
function2 = rec {
|
|
|
|
version = "4.1.0";
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Naios";
|
|
|
|
repo = "function2";
|
|
|
|
rev = version;
|
2021-02-26 16:03:54 +00:00
|
|
|
hash = "sha256-JceZU8ZvtYhFheh8BjMvjjZty4hcYxHEK+IIo5X4eSk=";
|
2021-01-09 07:15:41 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
# Derived from subprojects/tomlplusplus.wrap
|
|
|
|
tomlplusplus = rec {
|
|
|
|
version = "2.1.0";
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "marzer";
|
|
|
|
repo = "tomlplusplus";
|
|
|
|
rev = "v${version}";
|
2021-02-26 16:03:54 +00:00
|
|
|
hash = "sha256-i6yAEqwkinkPEzzb6ynXytS1SEOUDwi8SixMf62NVzs=";
|
2021-01-09 07:15:41 +00:00
|
|
|
};
|
|
|
|
};
|
2021-02-14 17:41:07 +00:00
|
|
|
|
|
|
|
# Derived from vst3.wrap
|
|
|
|
vst3 = rec {
|
|
|
|
version = "e2fbb41f28a4b311f2fc7d28e9b4330eec1802b6";
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "robbert-vdh";
|
|
|
|
repo = "vst3sdk";
|
|
|
|
rev = version;
|
|
|
|
fetchSubmodules = true;
|
2021-02-26 16:03:54 +00:00
|
|
|
sha256 = "sha256-4oLOa6kVB053Hrq7BBbZFdruAXuqnC944y5Kuib1F7s=";
|
2021-02-14 17:41:07 +00:00
|
|
|
};
|
|
|
|
};
|
2021-01-09 07:15:41 +00:00
|
|
|
in stdenv.mkDerivation rec {
|
|
|
|
pname = "yabridge";
|
2021-02-26 16:03:54 +00:00
|
|
|
version = "3.0.1";
|
2021-01-09 07:15:41 +00:00
|
|
|
|
2021-01-09 07:15:57 +00:00
|
|
|
# NOTE: Also update yabridgectl's cargoSha256 when this is updated
|
2021-01-09 07:15:41 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "robbert-vdh";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2021-02-26 16:03:54 +00:00
|
|
|
hash = "sha256-BT8Qj8WvyRlBwSuIIlfWVhlG3RSv2sFnSskCcjPF/N0=";
|
2021-01-09 07:15:41 +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
|
2021-02-14 17:41:07 +00:00
|
|
|
cp -R --no-preserve=mode,ownership ${vst3.src} vst3
|
2021-01-09 07:15:41 +00:00
|
|
|
)'';
|
|
|
|
|
2021-02-14 17:41:07 +00:00
|
|
|
postPatch = ''
|
|
|
|
patchShebangs .
|
|
|
|
'';
|
2021-01-09 07:15:41 +00:00
|
|
|
|
|
|
|
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"
|
|
|
|
|
|
|
|
# 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"
|
|
|
|
];
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p "$out/bin" "$out/lib"
|
|
|
|
cp yabridge-group.exe{,.so} "$out/bin"
|
|
|
|
cp yabridge-host.exe{,.so} "$out/bin"
|
2021-02-14 17:41:07 +00:00
|
|
|
cp libyabridge-vst2.so "$out/lib"
|
|
|
|
cp libyabridge-vst3.so "$out/lib"
|
2021-01-09 07:15:41 +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;
|
|
|
|
maintainers = with maintainers; [ metadark ];
|
|
|
|
platforms = [ "x86_64-linux" ];
|
|
|
|
};
|
|
|
|
}
|