2018-03-08 23:33:35 +01:00
|
|
|
{ stdenv, fetchurl, alsaLib, bison, flex, libsndfile, which
|
|
|
|
, AppKit, Carbon, CoreAudio, CoreMIDI, CoreServices, Kernel
|
|
|
|
}:
|
2014-10-27 23:28:10 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2017-03-05 15:43:12 +01:00
|
|
|
version = "1.3.5.2";
|
2014-10-27 23:28:10 +01:00
|
|
|
name = "chuck-${version}";
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "http://chuck.cs.princeton.edu/release/files/chuck-${version}.tgz";
|
2017-03-05 15:43:12 +01:00
|
|
|
sha256 = "02z7sglax3j09grj5s1skmw8z6wz7b21hjrm95nrrdpwbxabh079";
|
2014-10-27 23:28:10 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [ bison flex libsndfile which ]
|
2018-03-08 23:33:35 +01:00
|
|
|
++ stdenv.lib.optional (!stdenv.isDarwin) alsaLib
|
|
|
|
++ stdenv.lib.optional stdenv.isDarwin [ AppKit Carbon CoreAudio CoreMIDI CoreServices Kernel ];
|
2014-10-27 23:28:10 +01:00
|
|
|
|
2018-03-08 23:33:35 +01:00
|
|
|
patches = [ ./clang.patch ./darwin-limits.patch ];
|
|
|
|
|
|
|
|
NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.isDarwin "-Wno-missing-sysroot";
|
|
|
|
NIX_LDFLAGS = stdenv.lib.optionalString stdenv.isDarwin "-framework MultitouchSupport";
|
2014-10-27 23:28:10 +01:00
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace src/makefile --replace "/usr/bin" "$out/bin"
|
|
|
|
substituteInPlace src/makefile.osx --replace "xcodebuild" "/usr/bin/xcodebuild"
|
|
|
|
substituteInPlace src/makefile.osx --replace "weak_framework" "framework"
|
2018-03-08 23:33:35 +01:00
|
|
|
substituteInPlace src/makefile.osx --replace "MACOSX_DEPLOYMENT_TARGET=10.5" "MACOSX_DEPLOYMENT_TARGET=$MACOSX_DEPLOYMENT_TARGET"
|
2014-10-27 23:28:10 +01:00
|
|
|
'';
|
|
|
|
|
2018-03-08 23:33:35 +01:00
|
|
|
buildPhase = ''
|
|
|
|
make -C src ${if stdenv.isDarwin then "osx" else "linux-alsa"}
|
|
|
|
'';
|
2014-10-27 23:28:10 +01:00
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
install -Dm755 ./src/chuck $out/bin/chuck
|
|
|
|
'';
|
|
|
|
|
2017-03-05 15:43:12 +01:00
|
|
|
meta = with stdenv.lib; {
|
2014-10-27 23:28:10 +01:00
|
|
|
description = "Programming language for real-time sound synthesis and music creation";
|
|
|
|
homepage = http://chuck.cs.princeton.edu;
|
2017-03-05 15:43:12 +01:00
|
|
|
license = licenses.gpl2;
|
|
|
|
platforms = with platforms; linux ++ darwin;
|
|
|
|
maintainers = with maintainers; [ ftrvxmtrx ];
|
2014-10-27 23:28:10 +01:00
|
|
|
};
|
|
|
|
}
|