{ gcc11Stdenv, lib, makeWrapper, fetchzip, fetchFromGitHub, pkgconfig , alsaLib, curl, ghc_filesystem, glew, glfw, gtk3-x11, jansson, jq, libarchive , libjack2, libpulseaudio, libXext, libXi, rtaudio, rtmidi, speex , libsamplerate, zstd }: let fundamental-source = fetchFromGitHub { owner = "VCVRack"; repo = "Fundamental"; rev = "533397cdcad5c6401ebd3937d6c1663de2473627"; # tip of branch v2 sha256 = "QnwOgrYxiCa/7t/u6F63Ks8C9E8k6T+hia4JZFhp1LI="; }; in # gcc11 is necessary because many vcv plugins are already built with it # If using an older gcc for Rack, you get # undefined symbol: _ZSt28__throw_bad_array_new_lengthv # for those plugins which were built with v11 with lib; gcc11Stdenv.mkDerivation rec { pname = "VCV-Rack"; version = "2"; src = fetchFromGitHub { owner = "VCVRack"; repo = "Rack"; rev = "v${version}"; sha256 = "HRy0IFi384/TpXYVhrKieITb2kOeSYLd/ujC93/kGv4="; }; patches = [ ./rack-minimize-vendoring.patch ]; prePatch = '' # As we can't use `make dep` to set up the dependencies (as explained # above), we do it here manually mkdir -p dep/include cp dep/pffft/*.h dep/include cp dep/fuzzysearchdatabase/src/*.hpp dep/include cp dep/nanosvg/**/*.h dep/include cp dep/nanovg/src/*.h dep/include cp dep/osdialog/*.h dep/include cp dep/oui-blendish/*.h dep/include cp -r ${fundamental-source} plugins/Fundamental/ chmod -R +rw plugins/Fundamental # will be used as build dir substituteInPlace plugin.mk --replace ":= all" ":= dist" ''; enableParallelBuilding = true; nativeBuildInputs = [ makeWrapper pkgconfig ]; buildInputs = [ alsaLib curl ghc_filesystem glew glfw gtk3-x11 jansson jq libarchive libjack2 libpulseaudio libsamplerate rtaudio rtmidi speex zstd ]; makeFlags = [ "all" "plugins" ]; installPhase = '' install -D -m755 -t $out/bin Rack install -D -m755 -t $out/lib libRack.so mkdir -p $out/share/vcv-rack cp -r res cacert.pem Core.json template.vcv LICENSE-GPLv3.txt $out/share/vcv-rack cp -r plugins/Fundamental/dist/Fundamental-*.vcvplugin $out/share/vcv-rack/Fundamental.vcvplugin # Override the default global resource file directory wrapProgram $out/bin/Rack --add-flags "-s $out/share/vcv-rack" ''; meta = with lib; { description = "Open-source virtual modular synthesizer"; homepage = "https://vcvrack.com/"; # The source is BSD-3 licensed, some of the art is CC-BY-NC 4.0 or under a # no-derivatives clause license = with licenses; [ bsd3 cc-by-nc-40 unfreeRedistributable ]; maintainers = with maintainers; [ moredread nathyong ]; platforms = platforms.linux; }; }