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-12-19 01:06:50 +00:00
|
|
|
, pkgsi686Linux
|
2023-01-20 10:41:00 +00:00
|
|
|
, dbus
|
2021-02-17 17:02:09 +00:00
|
|
|
, meson
|
|
|
|
, ninja
|
|
|
|
, pkg-config
|
|
|
|
, wine
|
|
|
|
, libxcb
|
2021-12-19 01:06:50 +00:00
|
|
|
, nix-update-script
|
2021-02-17 17:02:09 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
2022-07-18 16:21:45 +00:00
|
|
|
# Derived from subprojects/asio.wrap
|
|
|
|
asio = fetchFromGitHub {
|
|
|
|
owner = "chriskohlhoff";
|
|
|
|
repo = "asio";
|
2024-01-13 08:15:51 +00:00
|
|
|
rev = "refs/tags/asio-1-28-2";
|
|
|
|
hash = "sha256-8Sw0LuAqZFw+dxlsTstlwz5oaz3+ZnKBuvSdLW6/DKQ=";
|
2022-07-18 16:21:45 +00:00
|
|
|
};
|
|
|
|
|
2021-02-17 17:02:09 +00:00
|
|
|
# Derived from subprojects/bitsery.wrap
|
2021-12-19 01:06:50 +00:00
|
|
|
bitsery = fetchFromGitHub {
|
|
|
|
owner = "fraillt";
|
|
|
|
repo = "bitsery";
|
2024-01-13 08:15:51 +00:00
|
|
|
rev = "refs/tags/v5.2.3";
|
|
|
|
hash = "sha256-rmfcIYCrANycFuLtibQ5wOPwpMVhpTMpdGsUfpR3YsM=";
|
2021-02-17 17:02:09 +00:00
|
|
|
};
|
|
|
|
|
2023-01-20 10:41:00 +00:00
|
|
|
# Derived from subprojects/clap.wrap
|
|
|
|
clap = fetchFromGitHub {
|
|
|
|
owner = "free-audio";
|
|
|
|
repo = "clap";
|
2024-01-13 08:15:51 +00:00
|
|
|
rev = "refs/tags/1.1.9";
|
|
|
|
hash = "sha256-z2P0U2NkDK1/5oDV35jn/pTXCcspuM1y2RgZyYVVO3w=";
|
2023-01-20 10:41:00 +00:00
|
|
|
};
|
|
|
|
|
2021-02-17 17:02:09 +00:00
|
|
|
# Derived from subprojects/function2.wrap
|
2021-12-19 01:06:50 +00:00
|
|
|
function2 = fetchFromGitHub {
|
|
|
|
owner = "Naios";
|
|
|
|
repo = "function2";
|
2024-01-13 08:15:51 +00:00
|
|
|
rev = "refs/tags/4.2.3";
|
|
|
|
hash = "sha256-+fzntJn1fRifOgJhh5yiv+sWR9pyaeeEi2c1+lqX3X8=";
|
2021-02-17 17:02:09 +00:00
|
|
|
};
|
|
|
|
|
2022-07-18 16:21:45 +00:00
|
|
|
# Derived from subprojects/ghc_filesystem.wrap
|
|
|
|
ghc_filesystem = fetchFromGitHub {
|
|
|
|
owner = "gulrak";
|
|
|
|
repo = "filesystem";
|
2024-01-13 08:15:51 +00:00
|
|
|
rev = "refs/tags/v1.5.14";
|
|
|
|
hash = "sha256-XZ0IxyNIAs2tegktOGQevkLPbWHam/AOFT+M6wAWPFg=";
|
2022-07-18 16:21:45 +00:00
|
|
|
};
|
|
|
|
|
2021-02-17 17:02:09 +00:00
|
|
|
# Derived from subprojects/tomlplusplus.wrap
|
2021-12-19 01:06:50 +00:00
|
|
|
tomlplusplus = fetchFromGitHub {
|
|
|
|
owner = "marzer";
|
|
|
|
repo = "tomlplusplus";
|
2024-01-13 08:15:51 +00:00
|
|
|
rev = "refs/tags/v3.4.0";
|
|
|
|
hash = "sha256-h5tbO0Rv2tZezY58yUbyRVpsfRjY3i+5TPkkxr6La8M=";
|
2021-02-17 17:02:09 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
# Derived from vst3.wrap
|
2021-12-19 01:06:50 +00:00
|
|
|
vst3 = fetchFromGitHub {
|
|
|
|
owner = "robbert-vdh";
|
|
|
|
repo = "vst3sdk";
|
2023-03-15 16:39:30 +00:00
|
|
|
rev = "refs/tags/v3.7.7_build_19-patched";
|
2021-12-19 01:06:50 +00:00
|
|
|
fetchSubmodules = true;
|
2023-05-24 13:37:59 +00:00
|
|
|
hash = "sha256-LsPHPoAL21XOKmF1Wl/tvLJGzjaCLjaDAcUtDvXdXSU=";
|
2021-02-17 17:02:09 +00:00
|
|
|
};
|
2023-03-15 16:39:30 +00:00
|
|
|
in
|
|
|
|
multiStdenv.mkDerivation (finalAttrs: {
|
2021-02-17 17:02:09 +00:00
|
|
|
pname = "yabridge";
|
2024-01-13 08:15:51 +00:00
|
|
|
version = "5.1.0";
|
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";
|
2023-03-15 16:39:30 +00:00
|
|
|
repo = "yabridge";
|
|
|
|
rev = "refs/tags/${finalAttrs.version}";
|
2024-01-13 08:15:51 +00:00
|
|
|
hash = "sha256-vnSdGedpiit8nym26i1QFiNnATk0Bymm7e5Ha2H41/M=";
|
2021-02-17 17:02:09 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
# Unpack subproject sources
|
|
|
|
postUnpack = ''(
|
|
|
|
cd "$sourceRoot/subprojects"
|
2022-07-18 16:21:45 +00:00
|
|
|
cp -R --no-preserve=mode,ownership ${asio} asio
|
2021-12-19 01:06:50 +00:00
|
|
|
cp -R --no-preserve=mode,ownership ${bitsery} bitsery
|
2023-01-20 10:41:00 +00:00
|
|
|
cp -R --no-preserve=mode,ownership ${clap} clap
|
2021-12-19 01:06:50 +00:00
|
|
|
cp -R --no-preserve=mode,ownership ${function2} function2
|
2022-07-18 16:21:45 +00:00
|
|
|
cp -R --no-preserve=mode,ownership ${ghc_filesystem} ghc_filesystem
|
2021-12-19 01:06:50 +00:00
|
|
|
cp -R --no-preserve=mode,ownership ${tomlplusplus} tomlplusplus
|
|
|
|
cp -R --no-preserve=mode,ownership ${vst3} vst3
|
2021-02-17 17:02:09 +00:00
|
|
|
)'';
|
|
|
|
|
2021-05-03 20:48:10 +00:00
|
|
|
patches = [
|
2021-12-19 01:06:50 +00:00
|
|
|
# Hard code bitbridge & runtime dependencies
|
2021-05-03 20:48:10 +00:00
|
|
|
(substituteAll {
|
2021-12-19 01:06:50 +00:00
|
|
|
src = ./hardcode-dependencies.patch;
|
2024-04-21 15:54:59 +00:00
|
|
|
libdbus = dbus.lib;
|
2021-12-19 01:06:50 +00:00
|
|
|
libxcb32 = pkgsi686Linux.xorg.libxcb;
|
2023-01-20 10:41:00 +00:00
|
|
|
inherit wine;
|
2021-10-28 06:52:43 +00:00
|
|
|
})
|
2022-07-18 16:21:45 +00:00
|
|
|
|
|
|
|
# Patch the chainloader to search for libyabridge through NIX_PROFILES
|
|
|
|
./libyabridge-from-nix-profiles.patch
|
2021-05-03 20:48:10 +00:00
|
|
|
];
|
|
|
|
|
2021-02-17 17:02:09 +00:00
|
|
|
postPatch = ''
|
|
|
|
patchShebangs .
|
2022-07-18 16:21:45 +00:00
|
|
|
(
|
|
|
|
cd subprojects
|
|
|
|
cp packagefiles/asio/* asio
|
|
|
|
cp packagefiles/bitsery/* bitsery
|
2023-01-20 10:41:00 +00:00
|
|
|
cp packagefiles/clap/* clap
|
2022-07-18 16:21:45 +00:00
|
|
|
cp packagefiles/function2/* function2
|
|
|
|
cp packagefiles/ghc_filesystem/* ghc_filesystem
|
|
|
|
)
|
2021-02-17 17:02:09 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
meson
|
|
|
|
ninja
|
|
|
|
pkg-config
|
|
|
|
wine
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
libxcb
|
2023-01-20 10:41:00 +00:00
|
|
|
dbus
|
2021-02-17 17:02:09 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
mesonFlags = [
|
|
|
|
"--cross-file" "cross-wine.conf"
|
2022-07-18 16:21:45 +00:00
|
|
|
"-Dbitbridge=true"
|
2021-02-17 17:02:09 +00:00
|
|
|
|
|
|
|
# Requires CMake and is unnecessary
|
2022-01-26 04:04:25 +00:00
|
|
|
"-Dtomlplusplus:generate_cmake_config=false"
|
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"
|
2022-07-18 16:21:45 +00:00
|
|
|
cp yabridge-host{,-32}.exe{,.so} "$out/bin"
|
2023-01-20 10:41:00 +00:00
|
|
|
cp libyabridge{,-chainloader}-{vst2,vst3,clap}.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 = ''
|
2024-04-21 15:54:59 +00:00
|
|
|
substituteInPlace "$out/bin/yabridge-host-32.exe" \
|
|
|
|
--replace 'WINELOADER="wine"' 'WINELOADER="${wine}/bin/wine"'
|
|
|
|
|
|
|
|
substituteInPlace "$out/bin/yabridge-host.exe" \
|
|
|
|
--replace 'WINELOADER="wine"' 'WINELOADER="${wine}/bin/wine64"'
|
2021-05-03 20:48:10 +00:00
|
|
|
'';
|
|
|
|
|
2022-12-28 21:21:41 +00:00
|
|
|
passthru.updateScript = nix-update-script { };
|
2021-12-19 01:06:50 +00:00
|
|
|
|
2021-02-17 17:02:09 +00:00
|
|
|
meta = with lib; {
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Modern and transparent way to use Windows VST2 and VST3 plugins on Linux";
|
2023-03-15 16:39:30 +00:00
|
|
|
homepage = "https://github.com/robbert-vdh/yabridge";
|
2024-01-13 08:15:51 +00:00
|
|
|
changelog = "https://github.com/robbert-vdh/yabridge/blob/${finalAttrs.version}/CHANGELOG.md";
|
2021-02-17 17:02:09 +00:00
|
|
|
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" ];
|
|
|
|
};
|
2023-03-15 16:39:30 +00:00
|
|
|
})
|