2022-01-18 18:30:50 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, fetchzip
|
|
|
|
, cmake
|
|
|
|
, pkg-config
|
|
|
|
, ninja
|
|
|
|
, makeWrapper
|
|
|
|
, libjack2
|
|
|
|
, alsa-lib
|
|
|
|
, alsa-tools
|
|
|
|
, freetype
|
|
|
|
, libusb1
|
|
|
|
, libX11
|
|
|
|
, libXrandr
|
|
|
|
, libXinerama
|
|
|
|
, libXext
|
|
|
|
, libXcursor
|
|
|
|
, libXScrnSaver
|
|
|
|
, libGL
|
|
|
|
, libxcb
|
|
|
|
, xcbutil
|
|
|
|
, libxkbcommon
|
|
|
|
, xcbutilkeysyms
|
|
|
|
, xcb-util-cursor
|
|
|
|
, gtk3
|
|
|
|
, webkitgtk
|
|
|
|
, python3
|
|
|
|
, curl
|
|
|
|
, pcre
|
|
|
|
, mount
|
|
|
|
, gnome
|
2023-05-11 12:07:20 +00:00
|
|
|
, Accelerate
|
2022-01-18 18:30:50 +00:00
|
|
|
, Cocoa
|
|
|
|
, WebKit
|
|
|
|
, CoreServices
|
|
|
|
, CoreAudioKit
|
2023-05-11 12:07:20 +00:00
|
|
|
, IOBluetooth
|
2023-07-10 09:49:25 +00:00
|
|
|
, MetalKit
|
2022-01-18 18:30:50 +00:00
|
|
|
# It is not allowed to distribute binaries with the VST2 SDK plugin without a license
|
|
|
|
# (the author of Bespoke has such a licence but not Nix). VST3 should work out of the box.
|
|
|
|
# Read more in https://github.com/NixOS/nixpkgs/issues/145607
|
|
|
|
, enableVST2 ? false
|
2021-09-22 01:14:04 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
# equal to vst-sdk in ../oxefmsynth/default.nix
|
|
|
|
vst-sdk = stdenv.mkDerivation rec {
|
|
|
|
name = "vstsdk3610_11_06_2018_build_37";
|
|
|
|
src = fetchzip {
|
|
|
|
url = "https://web.archive.org/web/20181016150224if_/https://download.steinberg.net/sdk_downloads/${name}.zip";
|
|
|
|
sha256 = "0da16iwac590wphz2sm5afrfj42jrsnkr1bxcy93lj7a369ildkj";
|
|
|
|
};
|
|
|
|
installPhase = ''
|
|
|
|
cp -r . $out
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
in
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "bespokesynth";
|
2023-07-10 09:49:25 +00:00
|
|
|
version = "unstable-2023-08-17";
|
2021-09-22 01:14:04 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2022-01-18 18:30:50 +00:00
|
|
|
owner = "BespokeSynth";
|
2021-09-22 01:14:04 +00:00
|
|
|
repo = pname;
|
2023-07-10 09:49:25 +00:00
|
|
|
rev = "c6b1410afefc8b0b9aeb4aa11ad5c32651879c9f";
|
|
|
|
hash = "sha256-MLHlHSszD2jEN4/f2jC4vjAidr3gVOSK606qs5bq+Sc=";
|
2022-01-18 18:30:50 +00:00
|
|
|
fetchSubmodules = true;
|
2021-09-22 01:14:04 +00:00
|
|
|
};
|
|
|
|
|
2022-01-18 18:30:50 +00:00
|
|
|
cmakeBuildType = "Release";
|
|
|
|
|
|
|
|
cmakeFlags = lib.optionals enableVST2 [ "-DBESPOKE_VST2_SDK_LOCATION=${vst-sdk}/VST2_SDK" ];
|
|
|
|
|
|
|
|
nativeBuildInputs = [ python3 makeWrapper cmake pkg-config ninja ];
|
|
|
|
|
|
|
|
buildInputs = lib.optionals stdenv.hostPlatform.isLinux [
|
2023-07-10 09:49:25 +00:00
|
|
|
# List obtained from https://github.com/BespokeSynth/BespokeSynth/blob/main/azure-pipelines.yml
|
2022-01-18 18:30:50 +00:00
|
|
|
libX11
|
|
|
|
libXrandr
|
|
|
|
libXinerama
|
|
|
|
libXext
|
|
|
|
libXcursor
|
|
|
|
libXScrnSaver
|
|
|
|
curl
|
|
|
|
gtk3
|
|
|
|
webkitgtk
|
|
|
|
freetype
|
|
|
|
libGL
|
|
|
|
libusb1
|
|
|
|
alsa-lib
|
|
|
|
libjack2
|
|
|
|
gnome.zenity
|
|
|
|
alsa-tools
|
|
|
|
libxcb
|
|
|
|
xcbutil
|
|
|
|
libxkbcommon
|
|
|
|
xcbutilkeysyms
|
|
|
|
xcb-util-cursor
|
|
|
|
pcre
|
|
|
|
mount
|
|
|
|
] ++ lib.optionals stdenv.hostPlatform.isDarwin [
|
2023-05-11 12:07:20 +00:00
|
|
|
Accelerate
|
2022-01-18 18:30:50 +00:00
|
|
|
Cocoa
|
|
|
|
WebKit
|
|
|
|
CoreServices
|
|
|
|
CoreAudioKit
|
2023-05-11 12:07:20 +00:00
|
|
|
IOBluetooth
|
2023-07-10 09:49:25 +00:00
|
|
|
MetalKit
|
2021-09-22 01:14:04 +00:00
|
|
|
];
|
|
|
|
|
2023-02-19 19:23:32 +00:00
|
|
|
env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.hostPlatform.isDarwin (toString [
|
2022-01-18 18:30:50 +00:00
|
|
|
# Fails to find fp.h on its own
|
|
|
|
"-isystem ${CoreServices}/Library/Frameworks/CoreServices.framework/Versions/Current/Frameworks/CarbonCore.framework/Versions/Current/Headers/"
|
|
|
|
]);
|
|
|
|
|
|
|
|
postInstall =
|
|
|
|
if stdenv.hostPlatform.isDarwin then ''
|
|
|
|
mkdir -p $out/{Applications,bin}
|
|
|
|
mv Source/BespokeSynth_artefacts/${cmakeBuildType}/BespokeSynth.app $out/Applications/
|
|
|
|
# Symlinking confuses the resource finding about the actual location of the binary
|
|
|
|
# Resources are looked up relative to the executed file's location
|
|
|
|
makeWrapper $out/{Applications/BespokeSynth.app/Contents/MacOS,bin}/BespokeSynth
|
|
|
|
'' else ''
|
|
|
|
# Ensure zenity is available, or it won't be able to open new files.
|
|
|
|
# Ensure the python used for compilation is the same as the python used at run-time.
|
|
|
|
# jedi is also required for auto-completion.
|
|
|
|
# These X11 libs get dlopen'd, they cause visual bugs when unavailable.
|
|
|
|
wrapProgram $out/bin/BespokeSynth \
|
|
|
|
--prefix PATH : '${lib.makeBinPath [
|
|
|
|
gnome.zenity
|
|
|
|
(python3.withPackages (ps: with ps; [ jedi ]))
|
|
|
|
]}'
|
|
|
|
'';
|
2021-09-22 01:14:04 +00:00
|
|
|
|
2023-07-10 09:49:25 +00:00
|
|
|
env.NIX_LDFLAGS = lib.optionalString stdenv.hostPlatform.isLinux "-rpath ${lib.makeLibraryPath ([
|
|
|
|
libX11
|
|
|
|
libXrandr
|
|
|
|
libXinerama
|
|
|
|
libXext
|
|
|
|
libXcursor
|
|
|
|
libXScrnSaver
|
|
|
|
])}";
|
|
|
|
dontPatchELF = true; # needed or nix will try to optimize the binary by removing "useless" rpath
|
|
|
|
|
2021-09-22 01:14:04 +00:00
|
|
|
meta = with lib; {
|
2022-01-18 18:30:50 +00:00
|
|
|
description =
|
|
|
|
"Software modular synth with controllers support, scripting and VST";
|
2023-07-10 09:49:25 +00:00
|
|
|
homepage = "https://www.bespokesynth.com/";
|
2021-11-13 15:55:00 +00:00
|
|
|
license = with licenses; [
|
|
|
|
gpl3Plus
|
2022-01-18 18:30:50 +00:00
|
|
|
] ++ lib.optional enableVST2 unfree;
|
2023-07-10 09:49:25 +00:00
|
|
|
maintainers = with maintainers; [ astro tobiasBora OPNA2608 PowerUser64 ];
|
2022-04-01 19:34:55 +00:00
|
|
|
mainProgram = "BespokeSynth";
|
2021-09-22 01:14:04 +00:00
|
|
|
platforms = platforms.all;
|
|
|
|
};
|
|
|
|
}
|