diff --git a/pkgs/by-name/si/six-sines/package.nix b/pkgs/by-name/si/six-sines/package.nix new file mode 100644 index 000000000000..14100abc6c98 --- /dev/null +++ b/pkgs/by-name/si/six-sines/package.nix @@ -0,0 +1,216 @@ +{ + lib, + stdenv, + fetchFromGitHub, + cmake, + pkg-config, + autoPatchelfHook, + # JUCE graphics / GL + freetype, + fontconfig, + libGL, + # JUCE / standalone audio + MIDI + alsa-lib, + libjack2, + libpulseaudio, + # JUCE GUI: linked at build time (juce_gui_basics dlopens these at runtime, + # but the standalone host's X11 GUI path links them directly) + libx11, + libxext, + libxcursor, + libxinerama, + libxrandr, + libxrender, + libxscrnsaver, + # clap-wrapper's Linux standalone GUI host (auto-detected via pkg-config; + # if absent, the standalone still builds but can't show plugin windows) + gtkmm3, +}: + +let + # The bundled clap-wrapper hard-codes CLAP_WRAPPER_DOWNLOAD_DEPENDENCIES=TRUE + # and CPM-fetches these from GitHub at configure time. We pre-fetch them so + # the build is hermetic, and feed the paths in via *_SDK_ROOT cmake flags; + # `base_sdks.cmake` short-circuits the CPM path when *_SDK_ROOT is set. + # + # Revisions are pinned to whatever the clap-wrapper submodule at the + # six-sines v1.1.0 tag requests in cmake/base_sdks.cmake. When bumping + # six-sines, re-check those tags here. + vst3sdk = fetchFromGitHub { + owner = "steinbergmedia"; + repo = "vst3sdk"; + rev = "v3.7.6_build_18"; + fetchSubmodules = true; + hash = "sha256-MeMb09bM8D4FPHWvvRbmWbiyO9u8JVxyfgv4jmeogLI="; + # The `doc` submodule is ~130 MB of PDFs we never reference. The + # `vstgui4` submodule isn't touched by clap-wrapper's VST3 glue either, + # but it's small (~12 MB) and removing it would diverge further from + # upstream Steinberg, so leave it in. + postFetch = '' + rm -rf $out/doc + ''; + }; + + rtaudio-src = fetchFromGitHub { + owner = "thestk"; + repo = "rtaudio"; + rev = "6.0.1"; + hash = "sha256-Acsxbnl+V+Y4mKC1gD11n0m03E96HMK+oEY/YV7rlIY="; + }; + + rtmidi-src = fetchFromGitHub { + owner = "thestk"; + repo = "rtmidi"; + rev = "6.0.0"; + hash = "sha256-QuUeFx8rPpe0+exB3chT6dUceDa/7ygVy+cQYykq7e0="; + }; +in + +stdenv.mkDerivation (finalAttrs: { + pname = "six-sines"; + version = "1.1.0"; + __structuredAttrs = true; + strictDeps = true; + + src = fetchFromGitHub { + owner = "baconpaul"; + repo = "six-sines"; + rev = "v${finalAttrs.version}"; + fetchSubmodules = true; + hash = "sha256-IQLGC86FqS3dptPzNpHEYKB59MWFDKsOPGM+FuzGcPo="; + }; + + nativeBuildInputs = [ + cmake + pkg-config + autoPatchelfHook + ]; + + # nixpkgs' default `format` hardening injects `-Wformat -Wformat-security + # -Werror=format-security`. clap-wrapper's base_sdks.cmake adds + # `-Wno-format` privately to the VST3 SDK targets to silence a known + # confusion between `%lld` and `long long int`, which leaves + # `-Werror=format-security` dangling — and gcc treats "X ignored without + # Y" as a `-Werror=format-security` violation in its own right, breaking + # the base-sdk-vst3 compile. Disabling the whole hardening flag is the + # smallest change that lets the SDK's own pragma stand. + hardeningDisable = [ "format" ]; + + buildInputs = [ + freetype + fontconfig + libGL + alsa-lib + libjack2 + libpulseaudio + libx11 + libxext + libxcursor + libxinerama + libxrandr + libxrender + libxscrnsaver + gtkmm3 + ]; + + # JUCE loads several X11 libraries via dlopen() in juce_XSymbols_linux.h + # (libx11.so.6, libxext.so.6, libxcursor.so.1, libxinerama.so.1, + # libxrender.so.1, libxrandr.so.2, plus libxss.so.1 from + # juce_XWindowSystem_linux.cpp). Listing them in runtimeDependencies makes + # autoPatchelfHook bake them into the binaries' RPATH. + runtimeDependencies = [ + libx11 + libxext + libxcursor + libxinerama + libxrandr + libxrender + libxscrnsaver + ]; + + postPatch = '' + # sst-plugininfra's version_from_versionfile_or_git() looks for a + # BUILD_VERSION file before falling back to `git describe`. fetchFromGitHub + # strips .git, so we provide the file directly. The format is 5 lines: + # header (ignored), commit hash, tag, branch, display version. + cat > BUILD_VERSION <