16 # Derived from subprojects/asio.wrap
17 asio = fetchFromGitHub {
18 owner = "chriskohlhoff";
21 sha256 = "sha256-UDLhx2yI6Txg0wP5H4oNIhgKIB2eMxUGCyT2x/7GgVg=";
24 # Derived from subprojects/bitsery.wrap
25 bitsery = fetchFromGitHub {
29 sha256 = "sha256-VwzVtxt+E/SVcxqIJw8BKPO2q7bu/hkhY+nB7FHrZpY=";
32 # Derived from subprojects/function2.wrap
33 function2 = fetchFromGitHub {
37 sha256 = "sha256-wrt+fCcM6YD4ZRZYvqqB+fNakCNmltdPZKlNkPLtgMs=";
40 # Derived from subprojects/ghc_filesystem.wrap
41 ghc_filesystem = fetchFromGitHub {
45 sha256 = "sha256-j4RE5Ach7C7Kef4+H9AHSXa2L8OVyJljDwBduKcC4eE=";
48 # Derived from subprojects/tomlplusplus.wrap
49 tomlplusplus = fetchFromGitHub {
51 repo = "tomlplusplus";
53 sha256 = "sha256-l8ckbCqjz3GUfwStcl3H2C+un5dZfT2uLtayvdu93D4=";
56 # Derived from vst3.wrap
57 vst3 = fetchFromGitHub {
58 owner = "robbert-vdh";
60 rev = "v3.7.5_build_44-patched";
61 fetchSubmodules = true;
62 sha256 = "sha256-6cuEUa+BXa6MnAYIBq873n0NRLadcPfMX+kpf4ysE6M=";
64 in multiStdenv.mkDerivation rec {
68 # NOTE: Also update yabridgectl's cargoHash when this is updated
69 src = fetchFromGitHub {
70 owner = "robbert-vdh";
73 sha256 = "sha256-rce6gxnB+RpG84Xakw0h4vZ8lyEQ41swWQGuwpomV2I=";
76 # Unpack subproject sources
78 cd "$sourceRoot/subprojects"
79 cp -R --no-preserve=mode,ownership ${asio} asio
80 cp -R --no-preserve=mode,ownership ${bitsery} bitsery
81 cp -R --no-preserve=mode,ownership ${function2} function2
82 cp -R --no-preserve=mode,ownership ${ghc_filesystem} ghc_filesystem
83 cp -R --no-preserve=mode,ownership ${tomlplusplus} tomlplusplus
84 cp -R --no-preserve=mode,ownership ${vst3} vst3
88 # Hard code bitbridge & runtime dependencies
90 src = ./hardcode-dependencies.patch;
91 libxcb32 = pkgsi686Linux.xorg.libxcb;
92 inherit libnotify wine;
95 # Patch the chainloader to search for libyabridge through NIX_PROFILES
96 ./libyabridge-from-nix-profiles.patch
103 cp packagefiles/asio/* asio
104 cp packagefiles/bitsery/* bitsery
105 cp packagefiles/function2/* function2
106 cp packagefiles/ghc_filesystem/* ghc_filesystem
110 nativeBuildInputs = [
122 "--cross-file" "cross-wine.conf"
125 # Requires CMake and is unnecessary
126 "-Dtomlplusplus:generate_cmake_config=false"
131 mkdir -p "$out/bin" "$out/lib"
132 cp yabridge-host{,-32}.exe{,.so} "$out/bin"
133 cp libyabridge{,-chainloader}-{vst2,vst3}.so "$out/lib"
137 # Hard code wine path in wrapper scripts generated by winegcc
139 for exe in "$out"/bin/*.exe; do
140 substituteInPlace "$exe" \
141 --replace 'WINELOADER="wine"' 'WINELOADER="${wine}/bin/wine"'
145 passthru.updateScript = nix-update-script {
150 description = "A modern and transparent way to use Windows VST2 and VST3 plugins on Linux";
151 homepage = src.meta.homepage;
152 license = licenses.gpl3Plus;
153 maintainers = with maintainers; [ kira-bruneau ];
154 platforms = [ "x86_64-linux" ];