summary refs log tree commit diff
path: root/pkgs/applications/audio
diff options
context:
space:
mode:
authorMatthew Bauer <mjbauer95@gmail.com>2018-08-17 10:29:12 -0500
committerGitHub <noreply@github.com>2018-08-17 10:29:12 -0500
commit4ff7702082bad838e70140091afe7e77a9f00eca (patch)
treed99a2a14e45e448442bfe669cb21fe0edf0ae7c8 /pkgs/applications/audio
parentcbabebcc2e3b884296fedf8591e04f59240b3939 (diff)
parentee92ab07bae7018486af54ef3b559bf048e331a7 (diff)
downloadnixpkgs-4ff7702082bad838e70140091afe7e77a9f00eca.tar
nixpkgs-4ff7702082bad838e70140091afe7e77a9f00eca.tar.gz
nixpkgs-4ff7702082bad838e70140091afe7e77a9f00eca.tar.bz2
nixpkgs-4ff7702082bad838e70140091afe7e77a9f00eca.tar.lz
nixpkgs-4ff7702082bad838e70140091afe7e77a9f00eca.tar.xz
nixpkgs-4ff7702082bad838e70140091afe7e77a9f00eca.tar.zst
nixpkgs-4ff7702082bad838e70140091afe7e77a9f00eca.zip
Merge pull request #45183 from matthewbauer/macdevelop
Assorted darwin/macOS fixes
Diffstat (limited to 'pkgs/applications/audio')
-rw-r--r--pkgs/applications/audio/chuck/default.nix32
1 files changed, 15 insertions, 17 deletions
diff --git a/pkgs/applications/audio/chuck/default.nix b/pkgs/applications/audio/chuck/default.nix
index e94172b0f87..c10556260c7 100644
--- a/pkgs/applications/audio/chuck/default.nix
+++ b/pkgs/applications/audio/chuck/default.nix
@@ -1,5 +1,6 @@
-{ stdenv, fetchurl, alsaLib, bison, flex, libsndfile, which
+{ stdenv, lib, fetchurl, alsaLib, bison, flex, libsndfile, which
 , AppKit, Carbon, CoreAudio, CoreMIDI, CoreServices, Kernel
+, xcbuild
 }:
 
 stdenv.mkDerivation rec {
@@ -11,31 +12,28 @@ stdenv.mkDerivation rec {
     sha256 = "02z7sglax3j09grj5s1skmw8z6wz7b21hjrm95nrrdpwbxabh079";
   };
 
-  buildInputs = [ bison flex libsndfile which ]
-    ++ stdenv.lib.optional (!stdenv.isDarwin) alsaLib
-    ++ stdenv.lib.optional stdenv.isDarwin [ AppKit Carbon CoreAudio CoreMIDI CoreServices Kernel ];
+  nativeBuildInputs = [ flex bison which ];
+
+  buildInputs = [ libsndfile ]
+    ++ lib.optional (!stdenv.isDarwin) alsaLib
+    ++ lib.optional stdenv.isDarwin [ AppKit Carbon CoreAudio CoreMIDI CoreServices Kernel ];
 
   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";
+  NIX_CFLAGS_COMPILE = lib.optional stdenv.isDarwin "-Wno-missing-sysroot";
+  NIX_LDFLAGS = lib.optional stdenv.isDarwin "-framework MultitouchSupport";
 
   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"
-    substituteInPlace src/makefile.osx --replace "MACOSX_DEPLOYMENT_TARGET=10.5" "MACOSX_DEPLOYMENT_TARGET=$MACOSX_DEPLOYMENT_TARGET"
-  '';
-
-  buildPhase = ''
-    make -C src ${if stdenv.isDarwin then "osx" else "linux-alsa"}
+    substituteInPlace src/makefile.osx \
+      --replace "weak_framework" "framework" \
+      --replace "MACOSX_DEPLOYMENT_TARGET=10.5" "MACOSX_DEPLOYMENT_TARGET=$MACOSX_DEPLOYMENT_TARGET"
   '';
 
-  installPhase = ''
-    install -Dm755 ./src/chuck $out/bin/chuck
-  '';
+  makeFlags = [ "-C src" "DESTDIR=$(out)/bin" ];
+  buildFlags = [ (if stdenv.isDarwin then "osx" else "linux-alsa") ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Programming language for real-time sound synthesis and music creation";
     homepage = http://chuck.cs.princeton.edu;
     license = licenses.gpl2;