nixpkgs/pkgs/development/interpreters/supercollider/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

79 lines
2.4 KiB
Nix
Raw Normal View History

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