bespokesynth: 1.0 -> 1.1.0. Fixing issues with file loading (#144708)
Co-authored-by: OPNA2608 <christoph.neidahl@gmail.com>
This commit is contained in:
parent
222f62ed88
commit
d3a146c2ec
|
@ -1,40 +1,46 @@
|
||||||
{ lib, stdenv, fetchFromGitHub, pkg-config, fetchzip
|
{ lib
|
||||||
, libjack2, alsa-lib, freetype, libX11, libXrandr, libXinerama, libXext, libXcursor
|
, stdenv
|
||||||
, libGL, python3, ncurses, libusb1
|
, fetchFromGitHub
|
||||||
, gtk3, webkitgtk, curl, xvfb-run, makeWrapper
|
, fetchzip
|
||||||
# "Debug", or "Release"
|
, cmake
|
||||||
, buildType ? "Release"
|
, 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
|
||||||
|
, Cocoa
|
||||||
|
, WebKit
|
||||||
|
, CoreServices
|
||||||
|
, CoreAudioKit
|
||||||
|
# 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
|
||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
projucer = stdenv.mkDerivation rec {
|
|
||||||
pname = "projucer";
|
|
||||||
version = "5.4.7";
|
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
|
||||||
owner = "juce-framework";
|
|
||||||
repo = "JUCE";
|
|
||||||
rev = version;
|
|
||||||
sha256= "0qpiqfwwpcghk7ij6w4vy9ywr3ryg7ppg77bmd7783kxg6zbhj8h";
|
|
||||||
};
|
|
||||||
|
|
||||||
nativeBuildInputs = [ pkg-config ];
|
|
||||||
buildInputs = [
|
|
||||||
freetype libX11 libXrandr libXinerama libXext gtk3 webkitgtk
|
|
||||||
libjack2 curl
|
|
||||||
];
|
|
||||||
preBuild = ''
|
|
||||||
cd extras/Projucer/Builds/LinuxMakefile
|
|
||||||
'';
|
|
||||||
makeFlags = [ "CONFIG=${buildType}" ];
|
|
||||||
enableParallelBuilding = true;
|
|
||||||
|
|
||||||
installPhase = ''
|
|
||||||
mkdir -p $out/bin
|
|
||||||
cp -a build/Projucer $out/bin/Projucer
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
# equal to vst-sdk in ../oxefmsynth/default.nix
|
# equal to vst-sdk in ../oxefmsynth/default.nix
|
||||||
vst-sdk = stdenv.mkDerivation rec {
|
vst-sdk = stdenv.mkDerivation rec {
|
||||||
name = "vstsdk3610_11_06_2018_build_37";
|
name = "vstsdk3610_11_06_2018_build_37";
|
||||||
|
@ -50,70 +56,92 @@ let
|
||||||
in
|
in
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
pname = "bespokesynth";
|
pname = "bespokesynth";
|
||||||
version = "1.0.0";
|
version = "1.1.0";
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
src = fetchFromGitHub {
|
||||||
owner = "awwbees";
|
owner = "BespokeSynth";
|
||||||
repo = pname;
|
repo = pname;
|
||||||
rev = "v${version}";
|
rev = "v${version}";
|
||||||
sha256 = "04b2m40jszphslkd4850jcb8qwls392lwy3lc6vlj01h4izvapqk";
|
sha256 = "sha256-PN0Q6/gI1PeMaF/8EZFGJdLR8JVHQZfWunAhOIQxkHw=";
|
||||||
|
fetchSubmodules = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
configurePhase = ''
|
cmakeBuildType = "Release";
|
||||||
runHook preConfigure
|
|
||||||
|
|
||||||
export HOME=$(mktemp -d)
|
cmakeFlags = lib.optionals enableVST2 [ "-DBESPOKE_VST2_SDK_LOCATION=${vst-sdk}/VST2_SDK" ];
|
||||||
xvfb-run sh -e <<EOF
|
|
||||||
${projucer}/bin/Projucer --set-global-search-path linux defaultJuceModulePath ${projucer.src}/modules
|
|
||||||
${projucer}/bin/Projucer --resave BespokeSynth.jucer
|
|
||||||
EOF
|
|
||||||
|
|
||||||
runHook postConfigure
|
nativeBuildInputs = [ python3 makeWrapper cmake pkg-config ninja ];
|
||||||
'';
|
|
||||||
CFLAGS = "-I${vst-sdk}/VST2_SDK";
|
|
||||||
|
|
||||||
nativeBuildInputs = [ xvfb-run pkg-config python3 makeWrapper ];
|
buildInputs = lib.optionals stdenv.hostPlatform.isLinux [
|
||||||
|
# List obtained in https://github.com/BespokeSynth/BespokeSynth/blob/main/azure-pipelines.yml
|
||||||
buildInputs = [
|
libX11
|
||||||
libX11 libXrandr libXinerama libXext libXcursor freetype libGL
|
libXrandr
|
||||||
ncurses libusb1
|
libXinerama
|
||||||
alsa-lib libjack2
|
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 [
|
||||||
|
Cocoa
|
||||||
|
WebKit
|
||||||
|
CoreServices
|
||||||
|
CoreAudioKit
|
||||||
];
|
];
|
||||||
|
|
||||||
preBuild = ''
|
NIX_CFLAGS_COMPILE = lib.optionalString stdenv.hostPlatform.isDarwin (toString [
|
||||||
cd Builds/LinuxMakefile
|
# Fails to find fp.h on its own
|
||||||
'';
|
"-isystem ${CoreServices}/Library/Frameworks/CoreServices.framework/Versions/Current/Frameworks/CarbonCore.framework/Versions/Current/Headers/"
|
||||||
makeFlags = [ "CONFIG=${buildType}" ];
|
]);
|
||||||
enableParallelBuilding = true;
|
|
||||||
|
|
||||||
installPhase = ''
|
postInstall =
|
||||||
runHook preInstall
|
if stdenv.hostPlatform.isDarwin then ''
|
||||||
|
mkdir -p $out/{Applications,bin}
|
||||||
mkdir -p $out/bin $out/share/bespokesynth $out/share/applications $out/share/icons/hicolor/512x512/apps
|
mv Source/BespokeSynth_artefacts/${cmakeBuildType}/BespokeSynth.app $out/Applications/
|
||||||
cp build/BespokeSynth $out/bin/
|
# Symlinking confuses the resource finding about the actual location of the binary
|
||||||
cp -ar ../MacOSX/build/Release/resource $out/share/bespokesynth/
|
# Resources are looked up relative to the executed file's location
|
||||||
wrapProgram $out/bin/BespokeSynth \
|
makeWrapper $out/{Applications/BespokeSynth.app/Contents/MacOS,bin}/BespokeSynth
|
||||||
--run "cd $out/share/bespokesynth"
|
'' else ''
|
||||||
|
# Ensure zenity is available, or it won't be able to open new files.
|
||||||
mkdir -p $out/share/applications/ $out/share/icons/hicolor/512x512/apps/
|
# Ensure the python used for compilation is the same as the python used at run-time.
|
||||||
cp ../../bespoke_icon.png $out/share/icons/hicolor/512x512/apps/
|
# jedi is also required for auto-completion.
|
||||||
substitute ../../BespokeSynth.desktop $out/share/applications/BespokseSynth.desktop \
|
# These X11 libs get dlopen'd, they cause visual bugs when unavailable.
|
||||||
--replace "/usr/bin/" ""
|
wrapProgram $out/bin/BespokeSynth \
|
||||||
|
--prefix PATH : '${lib.makeBinPath [
|
||||||
runHook postInstall
|
gnome.zenity
|
||||||
'';
|
(python3.withPackages (ps: with ps; [ jedi ]))
|
||||||
|
]}' \
|
||||||
|
--prefix LD_LIBRARY_PATH : '${lib.makeLibraryPath [
|
||||||
|
libXrandr
|
||||||
|
libXinerama
|
||||||
|
libXcursor
|
||||||
|
libXScrnSaver
|
||||||
|
]}'
|
||||||
|
'';
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
description = "Software modular synth with controllers support, scripting and VST";
|
description =
|
||||||
|
"Software modular synth with controllers support, scripting and VST";
|
||||||
homepage = "https://github.com/awwbees/BespokeSynth";
|
homepage = "https://github.com/awwbees/BespokeSynth";
|
||||||
license = with licenses; [
|
license = with licenses; [
|
||||||
gpl3Plus
|
gpl3Plus
|
||||||
|
] ++ lib.optional enableVST2 unfree;
|
||||||
# This package is unfree and not distributable due to the license of VST2.
|
maintainers = with maintainers; [ astro tobiasBora OPNA2608 ];
|
||||||
# see #145607
|
|
||||||
unfree
|
|
||||||
];
|
|
||||||
maintainers = with maintainers; [ astro ];
|
|
||||||
platforms = platforms.all;
|
platforms = platforms.all;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -24449,7 +24449,13 @@ with pkgs;
|
||||||
|
|
||||||
berry = callPackage ../applications/window-managers/berry { };
|
berry = callPackage ../applications/window-managers/berry { };
|
||||||
|
|
||||||
bespokesynth = callPackage ../applications/audio/bespokesynth { };
|
bespokesynth = callPackage ../applications/audio/bespokesynth {
|
||||||
|
inherit (darwin.apple_sdk.frameworks) Cocoa WebKit CoreServices CoreAudioKit;
|
||||||
|
};
|
||||||
|
|
||||||
|
bespokesynth-with-vst2 = bespokesynth.override {
|
||||||
|
enableVST2 = true;
|
||||||
|
};
|
||||||
|
|
||||||
bevelbar = callPackage ../applications/window-managers/bevelbar { };
|
bevelbar = callPackage ../applications/window-managers/bevelbar { };
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue