···
1
+
{ lib, stdenv, fetchFromGitHub, pkg-config, fetchzip
2
+
, libjack2, alsa-lib, freetype, libX11, libXrandr, libXinerama, libXext, libXcursor
3
+
, libGL, python3, ncurses, libusb1
4
+
, gtk3, webkitgtk, curl, xvfb-run, makeWrapper
5
+
# "Debug", or "Release"
6
+
, buildType ? "Release"
10
+
projucer = stdenv.mkDerivation rec {
14
+
src = fetchFromGitHub {
15
+
owner = "juce-framework";
18
+
sha256= "0qpiqfwwpcghk7ij6w4vy9ywr3ryg7ppg77bmd7783kxg6zbhj8h";
21
+
nativeBuildInputs = [ pkg-config ];
23
+
freetype libX11 libXrandr libXinerama libXext gtk3 webkitgtk
27
+
cd extras/Projucer/Builds/LinuxMakefile
29
+
makeFlags = [ "CONFIG=${buildType}" ];
30
+
enableParallelBuilding = true;
34
+
cp -a build/Projucer $out/bin/Projucer
38
+
# equal to vst-sdk in ../oxefmsynth/default.nix
39
+
vst-sdk = stdenv.mkDerivation rec {
40
+
name = "vstsdk3610_11_06_2018_build_37";
42
+
url = "https://web.archive.org/web/20181016150224if_/https://download.steinberg.net/sdk_downloads/${name}.zip";
43
+
sha256 = "0da16iwac590wphz2sm5afrfj42jrsnkr1bxcy93lj7a369ildkj";
51
+
stdenv.mkDerivation rec {
52
+
pname = "bespokesynth";
55
+
src = fetchFromGitHub {
58
+
rev = "v${version}";
59
+
sha256 = "04b2m40jszphslkd4850jcb8qwls392lwy3lc6vlj01h4izvapqk";
63
+
runHook preConfigure
65
+
export HOME=$(mktemp -d)
66
+
xvfb-run sh -e <<EOF
67
+
${projucer}/bin/Projucer --set-global-search-path linux defaultJuceModulePath ${projucer.src}/modules
68
+
${projucer}/bin/Projucer --resave BespokeSynth.jucer
71
+
runHook postConfigure
73
+
CFLAGS = "-I${vst-sdk}/VST2_SDK";
75
+
nativeBuildInputs = [ xvfb-run pkg-config python3 makeWrapper ];
78
+
libX11 libXrandr libXinerama libXext libXcursor freetype libGL
84
+
cd Builds/LinuxMakefile
86
+
makeFlags = [ "CONFIG=${buildType}" ];
87
+
enableParallelBuilding = true;
92
+
mkdir -p $out/bin $out/share/bespokesynth $out/share/applications $out/share/icons/hicolor/512x512/apps
93
+
cp build/BespokeSynth $out/bin/
94
+
cp -ar ../MacOSX/build/Release/resource $out/share/bespokesynth/
95
+
wrapProgram $out/bin/BespokeSynth \
96
+
--run "cd $out/share/bespokesynth"
98
+
mkdir -p $out/share/applications/ $out/share/icons/hicolor/512x512/apps/
99
+
cp ../../bespoke_icon.png $out/share/icons/hicolor/512x512/apps/
100
+
substitute ../../BespokeSynth.desktop $out/share/applications/BespokseSynth.desktop \
101
+
--replace "/usr/bin/" ""
103
+
runHook postInstall
107
+
description = "Software modular synth with controllers support, scripting and VST";
108
+
homepage = "https://github.com/awwbees/BespokeSynth";
109
+
license = licenses.gpl3Plus;
110
+
maintainers = with maintainers; [ astro ];
111
+
platforms = platforms.all;