2023-11-16 04:20:00 +00:00
|
|
|
{ lib, stdenv, mkDerivation, fetchurl, cmake, runtimeShell
|
2022-04-27 09:35:20 +00:00
|
|
|
, pkg-config, alsa-lib, libjack2, libsndfile, fftw
|
|
|
|
, curl, gcc, libXt, qtbase, qttools, qtwebengine
|
2020-04-24 23:36:52 +00:00
|
|
|
, readline, qtwebsockets, useSCEL ? false, emacs
|
2023-02-22 10:55:15 +00:00
|
|
|
, gitUpdater, supercollider-with-plugins
|
|
|
|
, supercolliderPlugins, writeText, runCommand
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
2021-04-08 16:26:57 +00:00
|
|
|
mkDerivation rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "supercollider";
|
2023-04-29 16:46:19 +00:00
|
|
|
version = "3.13.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://github.com/supercollider/supercollider/releases/download/Version-${version}/SuperCollider-${version}-Source.tar.bz2";
|
2023-04-29 16:46:19 +00:00
|
|
|
sha256 = "sha256-D8Xbpbrq43+Qaa0oiFqkBcaiUwnjiGy+ERvTt8BVMc4=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
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
|
|
|
|
];
|
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace common/sc_popen.cpp --replace '/bin/sh' '${runtimeShell}'
|
|
|
|
'';
|
|
|
|
|
2023-02-22 10:55:15 +00:00
|
|
|
strictDeps = true;
|
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
nativeBuildInputs = [ cmake pkg-config qttools ];
|
|
|
|
|
|
|
|
buildInputs = [ gcc libjack2 libsndfile fftw curl libXt qtbase qtwebengine qtwebsockets readline ]
|
|
|
|
++ lib.optional (!stdenv.isDarwin) alsa-lib
|
|
|
|
++ lib.optional useSCEL emacs;
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
hardeningDisable = [ "stackprotector" ];
|
|
|
|
|
|
|
|
cmakeFlags = [
|
|
|
|
"-DSC_WII=OFF"
|
|
|
|
"-DSC_EL=${if useSCEL then "ON" else "OFF"}"
|
|
|
|
];
|
|
|
|
|
2023-02-22 10:55:15 +00:00
|
|
|
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 ];
|
2022-04-27 09:35:20 +00:00
|
|
|
};
|
2023-02-22 10:55:15 +00:00
|
|
|
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
|
2022-04-27 09:35:20 +00:00
|
|
|
'';
|
2023-02-22 10:55:15 +00:00
|
|
|
};
|
2022-04-27 09:35:20 +00:00
|
|
|
};
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Programming language for real time audio synthesis";
|
|
|
|
homepage = "https://supercollider.github.io";
|
2023-04-29 16:46:19 +00:00
|
|
|
changelog = "https://github.com/supercollider/supercollider/blob/Version-${version}/CHANGELOG.md";
|
2024-07-27 06:49:29 +00:00
|
|
|
maintainers = with maintainers; [ ];
|
2021-04-08 16:26:57 +00:00
|
|
|
license = licenses.gpl3Plus;
|
2021-10-06 13:57:05 +00:00
|
|
|
platforms = platforms.linux;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|