16 # Derived from subprojects/asio.wrap
17 asio = fetchFromGitHub {
18 owner = "chriskohlhoff";
20 rev = "refs/tags/asio-1-28-2";
21 hash = "sha256-8Sw0LuAqZFw+dxlsTstlwz5oaz3+ZnKBuvSdLW6/DKQ=";
24 # Derived from subprojects/bitsery.wrap
25 bitsery = fetchFromGitHub {
28 rev = "refs/tags/v5.2.3";
29 hash = "sha256-rmfcIYCrANycFuLtibQ5wOPwpMVhpTMpdGsUfpR3YsM=";
32 # Derived from subprojects/clap.wrap
33 clap = fetchFromGitHub {
36 rev = "refs/tags/1.1.9";
37 hash = "sha256-z2P0U2NkDK1/5oDV35jn/pTXCcspuM1y2RgZyYVVO3w=";
40 # Derived from subprojects/function2.wrap
41 function2 = fetchFromGitHub {
44 rev = "refs/tags/4.2.3";
45 hash = "sha256-+fzntJn1fRifOgJhh5yiv+sWR9pyaeeEi2c1+lqX3X8=";
48 # Derived from subprojects/ghc_filesystem.wrap
49 ghc_filesystem = fetchFromGitHub {
52 rev = "refs/tags/v1.5.14";
53 hash = "sha256-XZ0IxyNIAs2tegktOGQevkLPbWHam/AOFT+M6wAWPFg=";
56 # Derived from subprojects/tomlplusplus.wrap
57 tomlplusplus = fetchFromGitHub {
59 repo = "tomlplusplus";
60 rev = "refs/tags/v3.4.0";
61 hash = "sha256-h5tbO0Rv2tZezY58yUbyRVpsfRjY3i+5TPkkxr6La8M=";
64 # Derived from vst3.wrap
65 vst3 = fetchFromGitHub {
66 owner = "robbert-vdh";
68 rev = "refs/tags/v3.7.7_build_19-patched";
69 fetchSubmodules = true;
70 hash = "sha256-LsPHPoAL21XOKmF1Wl/tvLJGzjaCLjaDAcUtDvXdXSU=";
73 multiStdenv.mkDerivation (finalAttrs: {
77 # NOTE: Also update yabridgectl's cargoHash when this is updated
78 src = fetchFromGitHub {
79 owner = "robbert-vdh";
81 rev = "refs/tags/${finalAttrs.version}";
82 hash = "sha256-4eA3vQFklIWkhtbd3Nw39bnJT6gPcni79ZyQVqU4+GQ=";
85 # Unpack subproject sources
88 cd "$sourceRoot/subprojects"
89 cp -R --no-preserve=mode,ownership ${asio} asio
90 cp -R --no-preserve=mode,ownership ${bitsery} bitsery
91 cp -R --no-preserve=mode,ownership ${clap} clap
92 cp -R --no-preserve=mode,ownership ${function2} function2
93 cp -R --no-preserve=mode,ownership ${ghc_filesystem} ghc_filesystem
94 cp -R --no-preserve=mode,ownership ${tomlplusplus} tomlplusplus
95 cp -R --no-preserve=mode,ownership ${vst3} vst3
100 # Hard code bitbridge & runtime dependencies
102 src = ./hardcode-dependencies.patch;
104 libxcb32 = pkgsi686Linux.xorg.libxcb;
108 # Patch the chainloader to search for libyabridge through NIX_PROFILES
109 ./libyabridge-from-nix-profiles.patch
116 cp packagefiles/asio/* asio
117 cp packagefiles/bitsery/* bitsery
118 cp packagefiles/clap/* clap
119 cp packagefiles/function2/* function2
120 cp packagefiles/ghc_filesystem/* ghc_filesystem
124 nativeBuildInputs = [
137 "--cross-file" "cross-wine.conf"
140 # Requires CMake and is unnecessary
141 "-Dtomlplusplus:generate_cmake_config=false"
146 mkdir -p "$out/bin" "$out/lib"
147 cp yabridge-host{,-32}.exe{,.so} "$out/bin"
148 cp libyabridge{,-chainloader}-{vst2,vst3,clap}.so "$out/lib"
152 # Hard code wine path in wrapper scripts generated by winegcc
154 substituteInPlace "$out/bin/yabridge-host-32.exe" \
155 --replace 'WINELOADER="wine"' 'WINELOADER="${wine}/bin/wine"'
157 substituteInPlace "$out/bin/yabridge-host.exe" \
158 --replace 'WINELOADER="wine"' 'WINELOADER="${wine}/bin/wine64"'
161 passthru.updateScript = nix-update-script { };
164 description = "Modern and transparent way to use Windows VST2 and VST3 plugins on Linux";
165 homepage = "https://github.com/robbert-vdh/yabridge";
166 changelog = "https://github.com/robbert-vdh/yabridge/blob/${finalAttrs.version}/CHANGELOG.md";
167 license = licenses.gpl3Plus;
168 maintainers = with maintainers; [ kira-bruneau ];
169 platforms = [ "x86_64-linux" ];