{ stdenv, pkgs, fetchurl, lib, autoPatchelfHook, makeWrapper, ... }: stdenv.mkDerivation rec { pname = "u-he twangstrom"; version = "latest"; src = fetchurl { url = "https://dl.u-he.com/releases/Twangstrom_102_16742_Linux.tar.xz"; sha256 = "sha256-SFPY+R+gQstDXe+gLaoIuCUckBoYwWZygXSMwytcpnc="; }; nativeBuildInputs = [ makeWrapper autoPatchelfHook ]; buildInputs = with pkgs; [ freetype fontconfig alsa-lib pipewire stdenv.cc.cc.lib cairo xorg.libxcb xorg.xcbutilkeysyms xorg.xcbutil gtk3 glibc batik ]; installPhase = '' mkdir -p $out/lib/vst3 $out/share $out/lib/vst3/Twangstrom.64.vst3/Contents/Resources/Documentation $out/lib/vst3/Twangstrom.64.vst3/Contents/x86_64-linux cp -r Twangstrom/Twangstrom.64.so $out/lib/vst3/Twangstrom.64.vst3/Contents/x86_64-linux/ cp -r Twangstrom/*.pdf $out/lib/vst3/Twangstrom.64.vst3/Contents/Resources/Documentation/ ''; # cp -r Twangstrom $out/share/ postFixup = '' for file in \ $out/lib/vst3/Twangstrom.64.vst3/Contents/x86_64-linux/Twangstrom.64.so do patchelf --set-rpath "${lib.makeLibraryPath buildInputs}" $file done ''; meta = with lib; { homepage = "https://u-he.com/products/twangstrom/"; description = "u-he twangstrom. To complete the installation, manually symlink the data dirs from ~/.nix-profile/share/Twangstrom/ into ~/.u-he/Twangstrom/"; platforms = platforms.linux; }; }