1 { lib, stdenv, fetchFromGitHub, cmake, libsndfile, libsamplerate, flex, bison, boost, gettext
13 # , gmm ? null # opcodes don't build with gmm 5.1
20 stdenv.mkDerivation rec {
24 hardeningDisable = [ "format" ];
26 src = fetchFromGitHub {
30 sha256 = "sha256-O7s92N54+zIl07eIdK/puoSve/qJ3O01fTh0TP+VdZA=";
33 cmakeFlags = [ "-DBUILD_CSOUND_AC=0" ] # fails to find Score.hpp
34 ++ lib.optional stdenv.hostPlatform.isDarwin "-DCS_FRAMEWORK_DEST=${placeholder "out"}/lib"
35 # Ignore gettext in CMAKE_PREFIX_PATH on cross to prevent find_program picking up the wrong gettext
36 ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) "-DCMAKE_IGNORE_PATH=${lib.getBin gettext}/bin";
38 nativeBuildInputs = [ cmake flex bison gettext ];
39 buildInputs = [ libsndfile libsamplerate boost ]
40 ++ lib.optionals stdenv.hostPlatform.isDarwin [
41 Accelerate AudioUnit CoreAudio CoreMIDI portaudio
42 ] ++ lib.optionals stdenv.hostPlatform.isLinux (builtins.filter (optional: optional != null) [
43 alsa-lib libpulseaudio libjack2
44 liblo ladspa-sdk fluidsynth eigen
48 postInstall = lib.optional stdenv.hostPlatform.isDarwin ''
49 mkdir -p $out/Library/Frameworks
50 ln -s $out/lib/CsoundLib64.framework $out/Library/Frameworks
54 description = "Sound design, audio synthesis, and signal processing system, providing facilities for music composition and performance on all major operating systems and platforms";
55 homepage = "https://csound.com/";
56 license = licenses.lgpl21Plus;
57 maintainers = [maintainers.marcweber];
58 platforms = platforms.unix;