push sheeet
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s

This commit is contained in:
Dark Steveneq
2025-10-09 14:15:47 +02:00
commit 646b892680
49168 changed files with 5897842 additions and 0 deletions

View File

@@ -0,0 +1,127 @@
{
lib,
stdenv,
mkDerivation,
fetchpatch,
fetchurl,
cmake,
runtimeShell,
pkg-config,
alsa-lib,
libjack2,
libsndfile,
fftw,
curl,
gcc,
libsForQt5,
libXt,
qtbase,
qttools,
qtwebengine,
readline,
qtwebsockets,
useSCEL ? false,
emacs,
gitUpdater,
supercollider-with-plugins,
supercolliderPlugins,
writeText,
runCommand,
withWebengine ? false, # vulnerable, so disabled by default
}:
mkDerivation rec {
pname = "supercollider";
version = "3.13.1";
src = fetchurl {
url = "https://github.com/supercollider/supercollider/releases/download/Version-${version}/SuperCollider-${version}-Source.tar.bz2";
sha256 = "sha256-aXnAFdqs/bVZMovoDV1P4mv2PtdFD2QuXHjnsnEyMSs=";
};
patches = [
# add support for SC_DATA_DIR and SC_PLUGIN_DIR env vars to override compile-time values
./supercollider-3.12.0-env-dirs.patch
# Fixes the build with CMake 4
(fetchpatch {
url = "https://github.com/supercollider/supercollider/commit/7d1f3fbe54e122889489a2f60bbc6cd6bb3bce28.patch";
hash = "sha256-gyE0B2qTbj0ppbLlYTMa2ooY3FHzzIrdrpWYr81Hy1Y=";
})
];
postPatch = ''
substituteInPlace common/sc_popen.cpp --replace '/bin/sh' '${runtimeShell}'
'';
strictDeps = true;
nativeBuildInputs = [
cmake
pkg-config
qttools
libsForQt5.wrapQtAppsHook
]
++ lib.optionals useSCEL [ emacs ];
buildInputs = [
gcc
libjack2
libsndfile
fftw
curl
libXt
qtbase
qtwebsockets
readline
]
++ lib.optional withWebengine qtwebengine
++ lib.optional (!stdenv.hostPlatform.isDarwin) alsa-lib;
hardeningDisable = [ "stackprotector" ];
cmakeFlags = [
"-DSC_WII=OFF"
"-DSC_EL=${if useSCEL then "ON" else "OFF"}"
(lib.cmakeBool "SC_USE_QTWEBENGINE" withWebengine)
];
passthru = {
updateScript = gitUpdater {
url = "https://github.com/supercollider/supercollider.git";
rev-prefix = "Version-";
ignoredVersions = "rc|beta";
};
tests = {
# test to make sure sclang runs and included plugins are successfully found
sclang-sc3-plugins =
let
supercollider-with-test-plugins = supercollider-with-plugins.override {
plugins = with supercolliderPlugins; [ sc3-plugins ];
};
testsc = writeText "test.sc" ''
var err = 0;
try {
MdaPiano.name.postln;
} {
err = 1;
};
err.exit;
'';
in
runCommand "sclang-sc3-plugins-test" { } ''
timeout 60s env XDG_CONFIG_HOME="$(mktemp -d)" QT_QPA_PLATFORM=minimal ${supercollider-with-test-plugins}/bin/sclang ${testsc} >$out
'';
};
};
meta = with lib; {
description = "Programming language for real time audio synthesis";
homepage = "https://supercollider.github.io";
changelog = "https://github.com/supercollider/supercollider/blob/Version-${version}/CHANGELOG.md";
maintainers = [ ];
license = licenses.gpl3Plus;
platforms = platforms.linux;
};
}

View File

@@ -0,0 +1,60 @@
{
stdenv,
lib,
fetchpatch2,
fetchurl,
cmake,
supercollider,
fftw,
gitUpdater,
}:
stdenv.mkDerivation rec {
pname = "sc3-plugins";
version = "3.13.0";
src = fetchurl {
url = "https://github.com/supercollider/sc3-plugins/releases/download/Version-${version}/sc3-plugins-${version}-Source.tar.bz2";
sha256 = "sha256-+N7rhh1ALipy21HUC0jEQ2kCYbWlOveJg9TPe6dnF6I=";
};
patches = [
(fetchpatch2 {
url = "https://github.com/supercollider/sc3-plugins/commit/3dc56bf7fcc1f2261afc13f96da762b78bcbfa51.patch";
hash = "sha256-lvXvGunfmjt6i+XPog14IKdnH1Qk8vefxplSDkXXXHU=";
})
];
strictDeps = true;
nativeBuildInputs = [ cmake ];
buildInputs = [
supercollider
fftw
];
cmakeFlags = [
"-DSC_PATH=${supercollider}/include/SuperCollider"
"-DSUPERNOVA=ON"
];
stripDebugList = [
"lib"
"share"
];
passthru.updateScript = gitUpdater {
url = "https://github.com/supercollider/sc3-plugins.git";
rev-prefix = "Version-";
ignoredVersions = "rc|beta";
};
meta = with lib; {
description = "Community plugins for SuperCollider";
homepage = "https://supercollider.github.io/sc3-plugins/";
maintainers = [ ];
license = licenses.gpl2Plus;
platforms = platforms.linux;
};
}

View File

@@ -0,0 +1,65 @@
diff --git a/common/SC_Filesystem_unix.cpp b/common/SC_Filesystem_unix.cpp
index 52dc1fd2d..aae09ed9c 100644
--- a/common/SC_Filesystem_unix.cpp
+++ b/common/SC_Filesystem_unix.cpp
@@ -94,6 +94,10 @@ bool SC_Filesystem::isNonHostPlatformDirectoryName(const std::string& s) {
}
Path SC_Filesystem::defaultSystemAppSupportDirectory() {
+ const char* sc_data_dir = getenv("SC_DATA_DIR");
+ if (sc_data_dir)
+ return Path(sc_data_dir);
+
# ifdef SC_DATA_DIR
return Path(SC_DATA_DIR);
# else
@@ -125,6 +129,10 @@ Path SC_Filesystem::defaultUserConfigDirectory() {
}
Path SC_Filesystem::defaultResourceDirectory() {
+ const char* sc_data_dir = getenv("SC_DATA_DIR");
+ if (sc_data_dir)
+ return Path(sc_data_dir);
+
# ifdef SC_DATA_DIR
return Path(SC_DATA_DIR);
# else
diff --git a/server/scsynth/SC_Lib_Cintf.cpp b/server/scsynth/SC_Lib_Cintf.cpp
index f6219307e..28e13eb98 100644
--- a/server/scsynth/SC_Lib_Cintf.cpp
+++ b/server/scsynth/SC_Lib_Cintf.cpp
@@ -178,9 +178,13 @@ void initialize_library(const char* uGensPluginPath) {
using DirName = SC_Filesystem::DirName;
if (loadUGensExtDirs) {
+ const char* sc_plugin_dir = getenv("SC_PLUGIN_DIR");
+ if (sc_plugin_dir) {
+ PlugIn_LoadDir(sc_plugin_dir, true);
+ }
#ifdef SC_PLUGIN_DIR
// load globally installed plugins
- if (bfs::is_directory(SC_PLUGIN_DIR)) {
+ else if (bfs::is_directory(SC_PLUGIN_DIR)) {
PlugIn_LoadDir(SC_PLUGIN_DIR, true);
}
#endif // SC_PLUGIN_DIR
diff --git a/server/supernova/server/main.cpp b/server/supernova/server/main.cpp
index b2b5adf4e..6cb8c411c 100644
--- a/server/supernova/server/main.cpp
+++ b/server/supernova/server/main.cpp
@@ -224,8 +224,14 @@ void set_plugin_paths(server_arguments const& args, nova::sc_ugen_factory* facto
}
}
} else {
+ const char* sc_plugin_dir = getenv("SC_PLUGIN_DIR");
+ if (sc_plugin_dir) {
+ factory->load_plugin_folder(sc_plugin_dir);
+ }
#ifdef SC_PLUGIN_DIR
- factory->load_plugin_folder(SC_PLUGIN_DIR);
+ else {
+ factory->load_plugin_folder(SC_PLUGIN_DIR);
+ }
#endif
factory->load_plugin_folder(SC_Filesystem::instance().getDirectory(DirName::Resource) / SC_PLUGIN_DIR_NAME);
factory->load_plugin_folder(SC_Filesystem::instance().getDirectory(DirName::SystemExtension));

View File

@@ -0,0 +1,23 @@
{
symlinkJoin,
makeWrapper,
supercollider,
plugins,
}:
symlinkJoin {
name = "supercollider-with-plugins-${supercollider.version}";
paths = [ supercollider ] ++ plugins;
nativeBuildInputs = [ makeWrapper ];
postBuild = ''
for exe in $out/bin/*; do
wrapProgram $exe \
--set SC_PLUGIN_DIR "$out/lib/SuperCollider/plugins" \
--set SC_DATA_DIR "$out/share/SuperCollider"
done
'';
inherit (supercollider) pname version meta;
}