2018-07-16 13:46:25 +01:00
|
|
|
{ stdenv, makeWrapper, fetchFromBitbucket, fetchFromGitHub, pkgconfig
|
|
|
|
, alsaLib, curl, glew, glfw, gtk2-x11, jansson, libjack2, libXext, libXi
|
2019-10-01 02:53:03 +01:00
|
|
|
, libzip, rtaudio, rtmidi, speex, libsamplerate }:
|
2018-07-16 13:46:25 +01:00
|
|
|
|
|
|
|
let
|
2018-11-05 16:38:20 +00:00
|
|
|
glfw-git = glfw.overrideAttrs (oldAttrs: rec {
|
|
|
|
name = "glfw-git-${version}";
|
2019-07-10 12:14:24 +01:00
|
|
|
version = "2019-06-30";
|
2018-07-16 13:46:25 +01:00
|
|
|
src = fetchFromGitHub {
|
2019-07-10 12:14:24 +01:00
|
|
|
owner = "AndrewBelt";
|
2018-07-16 13:46:25 +01:00
|
|
|
repo = "glfw";
|
2019-07-10 12:14:24 +01:00
|
|
|
rev = "d9ab59efc781c392128a449361a381fcc93cf6f3";
|
|
|
|
sha256 = "1ykkq6qq8y6j5hlfj2zp1p87kr33vwhywziprz20v5avx1q7rjm8";
|
2018-07-16 13:46:25 +01:00
|
|
|
};
|
2019-07-10 12:14:24 +01:00
|
|
|
# We patch the source to export a function that was added to the glfw fork
|
|
|
|
# for Rack so it is present when we build glfw as a shared library.
|
|
|
|
# See https://github.com/AndrewBelt/glfw/pull/1 for discussion of this issue
|
|
|
|
# with upstream.
|
|
|
|
patches = [ ./glfw.patch ];
|
2018-07-16 13:46:25 +01:00
|
|
|
buildInputs = oldAttrs.buildInputs ++ [ libXext libXi ];
|
|
|
|
});
|
|
|
|
pfft-source = fetchFromBitbucket {
|
|
|
|
owner = "jpommier";
|
|
|
|
repo = "pffft";
|
|
|
|
rev = "29e4f76ac53bef048938754f32231d7836401f79";
|
|
|
|
sha256 = "084csgqa6f1a270bhybjayrh3mpyi2jimc87qkdgsqcp8ycsx1l1";
|
|
|
|
};
|
|
|
|
in
|
|
|
|
with stdenv.lib; stdenv.mkDerivation rec {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "VCV-Rack";
|
2019-10-01 02:53:03 +01:00
|
|
|
version = "1.1.5";
|
2018-07-16 13:46:25 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "VCVRack";
|
|
|
|
repo = "Rack";
|
|
|
|
rev = "v${version}";
|
2019-10-01 02:53:03 +01:00
|
|
|
sha256 = "172v66v2vb6l9dpsq6fb6xn035igwhpjci8w3kz2na3rvmz1bc5w";
|
2018-07-16 13:46:25 +01:00
|
|
|
fetchSubmodules = true;
|
|
|
|
};
|
|
|
|
|
2019-07-10 12:14:24 +01:00
|
|
|
patches = [ ./rack-minimize-vendoring.patch ];
|
|
|
|
|
2018-07-16 13:46:25 +01:00
|
|
|
prePatch = ''
|
2019-07-10 12:14:24 +01:00
|
|
|
cp -r ${pfft-source} dep/jpommier-pffft-source
|
2018-07-16 13:46:25 +01:00
|
|
|
|
|
|
|
mkdir -p dep/include
|
|
|
|
|
|
|
|
cp dep/jpommier-pffft-source/*.h dep/include
|
2019-07-10 12:14:24 +01:00
|
|
|
cp dep/nanosvg/**/*.h dep/include
|
2018-07-16 13:46:25 +01: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;
|
|
|
|
|
|
|
|
nativeBuildInputs = [ makeWrapper pkgconfig ];
|
2019-10-01 02:53:03 +01:00
|
|
|
buildInputs = [ glfw-git alsaLib curl glew gtk2-x11 jansson libjack2 libzip rtaudio rtmidi speex libsamplerate ];
|
2018-07-16 13:46:25 +01:00
|
|
|
|
|
|
|
buildFlags = "Rack";
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
install -D -m755 -t $out/bin Rack
|
|
|
|
|
2019-07-10 12:14:24 +01:00
|
|
|
mkdir -p $out/share/vcv-rack
|
|
|
|
cp -r res Core.json template.vcv LICENSE* cacert.pem $out/share/vcv-rack
|
2018-07-16 13:46:25 +01:00
|
|
|
|
|
|
|
# Override the default global resource file directory
|
2019-07-10 12:14:24 +01:00
|
|
|
wrapProgram $out/bin/Rack --add-flags "-s $out/share/vcv-rack"
|
2018-07-16 13:46:25 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "Open-source virtual modular synthesizer";
|
|
|
|
homepage = http://vcvrack.com/;
|
2019-05-05 08:53:25 +01: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 00:48:00 +01:00
|
|
|
maintainers = with maintainers; [ moredread nathyong ];
|
2018-07-16 13:46:25 +01:00
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|