2021-06-10 02:57:09 +00:00
|
|
|
{ stdenv, lib, fetchurl, alsa-lib, bison, flex, libsndfile, which
|
2018-03-08 22:33:35 +00:00
|
|
|
, AppKit, Carbon, CoreAudio, CoreMIDI, CoreServices, Kernel
|
|
|
|
}:
|
2014-10-27 22:28:10 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2021-06-26 21:38:40 +00:00
|
|
|
version = "1.4.1.0";
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "chuck";
|
2014-10-27 22:28:10 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "http://chuck.cs.princeton.edu/release/files/chuck-${version}.tgz";
|
2021-06-26 21:38:40 +00:00
|
|
|
sha256 = "sha256-dL+ZrVFeMRPFW4MxUpNvrQKjzwBqVBBf8Rd3xHMZSSg=";
|
2014-10-27 22:28:10 +00:00
|
|
|
};
|
|
|
|
|
2018-08-17 03:54:32 +00:00
|
|
|
nativeBuildInputs = [ flex bison which ];
|
|
|
|
|
|
|
|
buildInputs = [ libsndfile ]
|
2021-06-10 02:57:09 +00:00
|
|
|
++ lib.optional (!stdenv.isDarwin) alsa-lib
|
2022-10-06 16:38:53 +00:00
|
|
|
++ lib.optionals stdenv.isDarwin [ AppKit Carbon CoreAudio CoreMIDI CoreServices Kernel ];
|
2014-10-27 22:28:10 +00:00
|
|
|
|
2019-07-31 12:05:55 +00:00
|
|
|
patches = [ ./darwin-limits.patch ];
|
2018-03-08 22:33:35 +00:00
|
|
|
|
2019-10-30 01:29:30 +00:00
|
|
|
NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-Wno-missing-sysroot";
|
|
|
|
NIX_LDFLAGS = lib.optionalString stdenv.isDarwin "-framework MultitouchSupport";
|
2014-10-27 22:28:10 +00:00
|
|
|
|
|
|
|
postPatch = ''
|
2019-07-31 12:05:55 +00:00
|
|
|
substituteInPlace src/core/makefile.x/makefile.osx \
|
2018-08-17 03:54:32 +00:00
|
|
|
--replace "weak_framework" "framework" \
|
2019-07-31 12:05:55 +00:00
|
|
|
--replace "MACOSX_DEPLOYMENT_TARGET=10.9" "MACOSX_DEPLOYMENT_TARGET=$MACOSX_DEPLOYMENT_TARGET"
|
2018-03-08 22:33:35 +00:00
|
|
|
'';
|
2014-10-27 22:28:10 +00:00
|
|
|
|
2018-08-17 03:54:32 +00:00
|
|
|
makeFlags = [ "-C src" "DESTDIR=$(out)/bin" ];
|
|
|
|
buildFlags = [ (if stdenv.isDarwin then "osx" else "linux-alsa") ];
|
2014-10-27 22:28:10 +00:00
|
|
|
|
2018-08-17 03:54:32 +00:00
|
|
|
meta = with lib; {
|
2014-10-27 22:28:10 +00:00
|
|
|
description = "Programming language for real-time sound synthesis and music creation";
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "http://chuck.cs.princeton.edu";
|
2017-03-05 14:43:12 +00:00
|
|
|
license = licenses.gpl2;
|
2019-07-31 12:05:55 +00:00
|
|
|
platforms = platforms.unix;
|
2017-03-05 14:43:12 +00:00
|
|
|
maintainers = with maintainers; [ ftrvxmtrx ];
|
2022-12-06 20:47:40 +00:00
|
|
|
# never built on aarch64-darwin since first introduction in nixpkgs
|
|
|
|
broken = stdenv.isDarwin && stdenv.isAarch64;
|
2014-10-27 22:28:10 +00:00
|
|
|
};
|
|
|
|
}
|