2021-03-03 12:59:53 +01:00
|
|
|
{ stdenv, lib, makeWrapper, fetchzip, fetchFromGitHub, pkgconfig
|
2021-12-02 23:12:37 +01:00
|
|
|
, alsaLib, curl, ghc_filesystem, glew, glfw, gtk3-x11, jansson, jq, libarchive
|
|
|
|
, libjack2, libpulseaudio, libXext, libXi, rtaudio, rtmidi, speex
|
|
|
|
, libsamplerate, zstd }:
|
2021-01-01 10:39:15 +01:00
|
|
|
|
|
|
|
let
|
2021-12-02 23:12:37 +01:00
|
|
|
fundamental-source = fetchFromGitHub {
|
|
|
|
owner = "VCVRack";
|
|
|
|
repo = "Fundamental";
|
|
|
|
rev = "533397cdcad5c6401ebd3937d6c1663de2473627"; # tip of branch v2
|
|
|
|
sha256 = "QnwOgrYxiCa/7t/u6F63Ks8C9E8k6T+hia4JZFhp1LI=";
|
2021-01-01 10:39:15 +01:00
|
|
|
};
|
|
|
|
in
|
2021-03-03 12:59:53 +01:00
|
|
|
with lib; stdenv.mkDerivation rec {
|
2021-01-01 10:39:15 +01:00
|
|
|
pname = "VCV-Rack";
|
2021-12-02 23:12:37 +01:00
|
|
|
version = "2";
|
2021-01-01 10:39:15 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "VCVRack";
|
|
|
|
repo = "Rack";
|
|
|
|
rev = "v${version}";
|
2021-12-02 23:12:37 +01:00
|
|
|
sha256 = "HRy0IFi384/TpXYVhrKieITb2kOeSYLd/ujC93/kGv4=";
|
2021-01-01 10:39:15 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
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
|
|
|
|
|
2021-12-02 23:12:37 +01:00
|
|
|
cp dep/pffft/*.h dep/include
|
|
|
|
cp dep/fuzzysearchdatabase/src/*.hpp dep/include
|
2021-01-01 10:39:15 +01:00
|
|
|
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
|
|
|
|
|
2021-12-02 23:12:37 +01:00
|
|
|
cp -r ${fundamental-source} plugins/Fundamental/
|
|
|
|
chmod -R +rw plugins/Fundamental # will be used as build dir
|
|
|
|
substituteInPlace plugin.mk --replace ":= all" ":= dist"
|
2021-01-01 10:39:15 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
|
|
|
nativeBuildInputs = [ makeWrapper pkgconfig ];
|
2021-12-02 23:12:37 +01:00
|
|
|
buildInputs = [ alsaLib curl ghc_filesystem glew glfw gtk3-x11 jansson jq libarchive libjack2 libpulseaudio libsamplerate rtaudio rtmidi speex zstd ];
|
2021-01-01 10:39:15 +01:00
|
|
|
|
2021-12-02 23:12:37 +01:00
|
|
|
makeFlags = [ "all" "plugins" ];
|
2021-01-01 10:39:15 +01:00
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
install -D -m755 -t $out/bin Rack
|
2021-12-02 23:12:37 +01:00
|
|
|
install -D -m755 -t $out/lib libRack.so
|
2021-01-01 10:39:15 +01:00
|
|
|
|
|
|
|
mkdir -p $out/share/vcv-rack
|
2021-12-02 23:12:37 +01:00
|
|
|
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
|
2021-01-01 10:39:15 +01:00
|
|
|
|
|
|
|
# Override the default global resource file directory
|
|
|
|
wrapProgram $out/bin/Rack --add-flags "-s $out/share/vcv-rack"
|
|
|
|
'';
|
|
|
|
|
2021-03-03 12:59:53 +01:00
|
|
|
meta = with lib; {
|
2021-01-01 10:39:15 +01:00
|
|
|
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;
|
|
|
|
};
|
|
|
|
}
|