Skip to content

Commit

Permalink
bespokesynth: Modernise
Browse files Browse the repository at this point in the history
- rec -> finalAttrs
- lib.cmakeFeature instead of manual CMake flag writing
- meta-wide "with lib" begone

Evals to the same output.
  • Loading branch information
OPNA2608 committed Dec 23, 2024
1 parent de18642 commit 898f7b4
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions pkgs/applications/audio/bespokesynth/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -58,21 +58,23 @@ let
};

in
stdenv.mkDerivation rec {
stdenv.mkDerivation (finalAttrs: {
pname = "bespokesynth";
version = "1.2.1";

src = fetchFromGitHub {
owner = "BespokeSynth";
repo = pname;
rev = "v${version}";
repo = "bespokesynth";
rev = "v${finalAttrs.version}";
hash = "sha256-vDvNm9sW9BfWloB0CA+JHTp/bfDWAP/T0hDXjoMZ3X4=";
fetchSubmodules = true;
};

cmakeBuildType = "Release";

cmakeFlags = lib.optionals enableVST2 [ "-DBESPOKE_VST2_SDK_LOCATION=${vst-sdk}/VST2_SDK" ];
cmakeFlags = lib.optionals enableVST2 [
(lib.cmakeFeature "BESPOKE_VST2_SDK_LOCATION" "${vst-sdk}/VST2_SDK")
];

nativeBuildInputs = [
python3
Expand Down Expand Up @@ -128,7 +130,7 @@ stdenv.mkDerivation rec {
if stdenv.hostPlatform.isDarwin then
''
mkdir -p $out/{Applications,bin}
mv Source/BespokeSynth_artefacts/${cmakeBuildType}/BespokeSynth.app $out/Applications/
mv Source/BespokeSynth_artefacts/${finalAttrs.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
Expand Down Expand Up @@ -160,22 +162,22 @@ stdenv.mkDerivation rec {
}";
dontPatchELF = true; # needed or nix will try to optimize the binary by removing "useless" rpath

meta = with lib; {
meta = {
description = "Software modular synth with controllers support, scripting and VST";
homepage = "https://www.bespokesynth.com/";
license =
with licenses;
with lib.licenses;
[
gpl3Plus
]
++ lib.optional enableVST2 unfree;
maintainers = with maintainers; [
maintainers = with lib.maintainers; [
astro
tobiasBora
OPNA2608
PowerUser64
];
mainProgram = "BespokeSynth";
platforms = platforms.all;
platforms = lib.platforms.all;
};
}
})

0 comments on commit 898f7b4

Please sign in to comment.