about summary refs log tree commit diff
path: root/nixpkgs/pkgs/applications/audio/chuck
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/applications/audio/chuck')
-rw-r--r--nixpkgs/pkgs/applications/audio/chuck/darwin-limits.patch13
-rw-r--r--nixpkgs/pkgs/applications/audio/chuck/default.nix41
2 files changed, 54 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/applications/audio/chuck/darwin-limits.patch b/nixpkgs/pkgs/applications/audio/chuck/darwin-limits.patch
new file mode 100644
index 000000000000..dc98a1726913
--- /dev/null
+++ b/nixpkgs/pkgs/applications/audio/chuck/darwin-limits.patch
@@ -0,0 +1,13 @@
+--- a/src/core/util_string.cpp	2014-10-27 22:52:11.875981552 +0100
++++ b/src/core/util_string.cpp	2014-10-27 22:54:18.613001994 +0100
+@@ -40,6 +40,10 @@
+ #include <linux/limits.h>
+ #endif // __PLATFORM_LINUX__
+ 
++#ifdef __PLATFORM_MACOSX__
++#include <limits.h>
++#endif // __PLATFORM_MACOSX__
++
+ #include <stdio.h>
+ using namespace std;
+ 
diff --git a/nixpkgs/pkgs/applications/audio/chuck/default.nix b/nixpkgs/pkgs/applications/audio/chuck/default.nix
new file mode 100644
index 000000000000..a6509256881b
--- /dev/null
+++ b/nixpkgs/pkgs/applications/audio/chuck/default.nix
@@ -0,0 +1,41 @@
+{ stdenv, lib, fetchurl, alsa-lib, bison, flex, libsndfile, which
+, AppKit, Carbon, CoreAudio, CoreMIDI, CoreServices, Kernel
+}:
+
+stdenv.mkDerivation rec {
+  version = "1.4.1.0";
+  pname = "chuck";
+
+  src = fetchurl {
+    url = "http://chuck.cs.princeton.edu/release/files/chuck-${version}.tgz";
+    sha256 = "sha256-dL+ZrVFeMRPFW4MxUpNvrQKjzwBqVBBf8Rd3xHMZSSg=";
+  };
+
+  nativeBuildInputs = [ flex bison which ];
+
+  buildInputs = [ libsndfile ]
+    ++ lib.optional (!stdenv.isDarwin) alsa-lib
+    ++ lib.optional stdenv.isDarwin [ AppKit Carbon CoreAudio CoreMIDI CoreServices Kernel ];
+
+  patches = [ ./darwin-limits.patch ];
+
+  NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-Wno-missing-sysroot";
+  NIX_LDFLAGS = lib.optionalString stdenv.isDarwin "-framework MultitouchSupport";
+
+  postPatch = ''
+    substituteInPlace src/core/makefile.x/makefile.osx \
+      --replace "weak_framework" "framework" \
+      --replace "MACOSX_DEPLOYMENT_TARGET=10.9" "MACOSX_DEPLOYMENT_TARGET=$MACOSX_DEPLOYMENT_TARGET"
+  '';
+
+  makeFlags = [ "-C src" "DESTDIR=$(out)/bin" ];
+  buildFlags = [ (if stdenv.isDarwin then "osx" else "linux-alsa") ];
+
+  meta = with lib; {
+    description = "Programming language for real-time sound synthesis and music creation";
+    homepage = "http://chuck.cs.princeton.edu";
+    license = licenses.gpl2;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ ftrvxmtrx ];
+  };
+}