2021-01-19 07:50:56 +01:00
|
|
|
{ lib, stdenv, makeWrapper, fetchzip, fetchFromGitHub, pkg-config
|
2018-07-16 14:46:25 +02:00
|
|
|
, alsaLib, curl, glew, glfw, gtk2-x11, jansson, libjack2, libXext, libXi
|
2019-10-01 03:53:03 +02:00
|
|
|
, libzip, rtaudio, rtmidi, speex, libsamplerate }:
|
2018-07-16 14:46:25 +02:00
|
|
|
|
|
|
|
let
|
2019-11-18 07:43:32 +01:00
|
|
|
# The package repo vendors some of the package dependencies as submodules.
|
|
|
|
# Others are downloaded with `make deps`. Due to previous issues with the
|
|
|
|
# `glfw` submodule (see above) and because we can not access the network when
|
|
|
|
# building in a sandbox, we fetch the dependency source manually.
|
2021-01-03 07:50:56 +01:00
|
|
|
pfft-source = fetchzip {
|
|
|
|
url = "https://vcvrack.com/downloads/dep/pffft.zip";
|
2018-07-16 14:46:25 +02:00
|
|
|
sha256 = "084csgqa6f1a270bhybjayrh3mpyi2jimc87qkdgsqcp8ycsx1l1";
|
|
|
|
};
|
2019-10-19 05:57:50 +02:00
|
|
|
nanovg-source = fetchFromGitHub {
|
|
|
|
owner = "memononen";
|
|
|
|
repo = "nanovg";
|
|
|
|
rev = "1f9c8864fc556a1be4d4bf1d6bfe20cde25734b4";
|
|
|
|
sha256 = "08r15zrr6p1kxigxzxrg5rgya7wwbdx7d078r362qbkmws83wk27";
|
|
|
|
};
|
|
|
|
nanosvg-source = fetchFromGitHub {
|
|
|
|
owner = "memononen";
|
|
|
|
repo = "nanosvg";
|
|
|
|
rev = "25241c5a8f8451d41ab1b02ab2d865b01600d949";
|
|
|
|
sha256 = "114qgfmazsdl53rm4pgqif3gv8msdmfwi91lyc2jfadgzfd83xkg";
|
|
|
|
};
|
|
|
|
osdialog-source = fetchFromGitHub {
|
|
|
|
owner = "AndrewBelt";
|
|
|
|
repo = "osdialog";
|
|
|
|
rev = "e5db5de6444f4b2c4e1390c67b3efd718080c3da";
|
|
|
|
sha256 = "0iqxn1md053nl19hbjk8rqsdcmjwa5l5z0ci4fara77q43rc323i";
|
|
|
|
};
|
|
|
|
oui-blendish-source = fetchFromGitHub {
|
|
|
|
owner = "AndrewBelt";
|
|
|
|
repo = "oui-blendish";
|
|
|
|
rev = "79ec59e6bc7201017fc13a20c6e33380adca1660";
|
|
|
|
sha256 = "17kd0lh2x3x12bxkyhq6z8sg6vxln8m9qirf0basvcsmylr6rb64";
|
|
|
|
};
|
2018-07-16 14:46:25 +02:00
|
|
|
in
|
2021-01-15 14:21:58 +01:00
|
|
|
with lib; stdenv.mkDerivation rec {
|
2019-08-15 14:41:18 +02:00
|
|
|
pname = "VCV-Rack";
|
2019-11-18 07:43:32 +01:00
|
|
|
version = "1.1.6";
|
2018-07-16 14:46:25 +02:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "VCVRack";
|
|
|
|
repo = "Rack";
|
|
|
|
rev = "v${version}";
|
2019-11-18 07:43:32 +01:00
|
|
|
sha256 = "0ji64prr74qzxf5bx1sw022kbslx9nzll16lmk5in78hbl137b3i";
|
2018-07-16 14:46:25 +02:00
|
|
|
};
|
|
|
|
|
2019-10-19 05:57:50 +02:00
|
|
|
patches = [
|
|
|
|
./rack-minimize-vendoring.patch
|
|
|
|
];
|
2019-07-10 13:14:24 +02:00
|
|
|
|
2018-07-16 14:46:25 +02:00
|
|
|
prePatch = ''
|
2019-11-18 07:43:32 +01:00
|
|
|
# As we can't use `make dep` to set up the dependencies (as explained
|
|
|
|
# above), we do it here manually
|
2018-07-16 14:46:25 +02:00
|
|
|
mkdir -p dep/include
|
|
|
|
|
2019-10-19 05:57:50 +02:00
|
|
|
cp -r ${pfft-source} dep/jpommier-pffft-source
|
|
|
|
cp -r ${nanovg-source}/* dep/nanovg
|
|
|
|
cp -r ${nanosvg-source}/* dep/nanosvg
|
|
|
|
cp -r ${osdialog-source}/* dep/osdialog
|
|
|
|
cp -r ${oui-blendish-source}/* dep/oui-blendish
|
|
|
|
|
2018-07-16 14:46:25 +02:00
|
|
|
cp dep/jpommier-pffft-source/*.h dep/include
|
2019-07-10 13:14:24 +02:00
|
|
|
cp dep/nanosvg/**/*.h dep/include
|
2018-07-16 14:46:25 +02:00
|
|
|
cp dep/nanovg/src/*.h dep/include
|
|
|
|
cp dep/osdialog/*.h dep/include
|
|
|
|
cp dep/oui-blendish/*.h dep/include
|
|
|
|
|
|
|
|
substituteInPlace include/audio.hpp --replace "<RtAudio.h>" "<rtaudio/RtAudio.h>"
|
|
|
|
substituteInPlace compile.mk --replace "-march=nocona" ""
|
|
|
|
'';
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2021-01-19 07:50:56 +01:00
|
|
|
nativeBuildInputs = [ makeWrapper pkg-config ];
|
2019-11-18 07:43:32 +01:00
|
|
|
buildInputs = [ alsaLib curl glew glfw gtk2-x11 jansson libjack2 libsamplerate libzip rtaudio rtmidi speex ];
|
2018-07-16 14:46:25 +02:00
|
|
|
|
2019-10-27 14:03:25 +01:00
|
|
|
buildFlags = [ "Rack" ];
|
2018-07-16 14:46:25 +02:00
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
install -D -m755 -t $out/bin Rack
|
|
|
|
|
2019-07-10 13:14:24 +02:00
|
|
|
mkdir -p $out/share/vcv-rack
|
|
|
|
cp -r res Core.json template.vcv LICENSE* cacert.pem $out/share/vcv-rack
|
2018-07-16 14:46:25 +02:00
|
|
|
|
|
|
|
# Override the default global resource file directory
|
2019-07-10 13:14:24 +02:00
|
|
|
wrapProgram $out/bin/Rack --add-flags "-s $out/share/vcv-rack"
|
2018-07-16 14:46:25 +02:00
|
|
|
'';
|
|
|
|
|
2021-01-11 08:54:33 +01:00
|
|
|
meta = with lib; {
|
2018-07-16 14:46:25 +02:00
|
|
|
description = "Open-source virtual modular synthesizer";
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "https://vcvrack.com/";
|
2019-05-05 09:53:25 +02:00
|
|
|
# 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 ];
|
2019-08-26 01:48:00 +02:00
|
|
|
maintainers = with maintainers; [ moredread nathyong ];
|
2018-07-16 14:46:25 +02:00
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|