chuck: cleanup

+15 -17
+15 -17
pkgs/applications/audio/chuck/default.nix
··· 1 - { stdenv, fetchurl, alsaLib, bison, flex, libsndfile, which 1 + { stdenv, lib, fetchurl, alsaLib, bison, flex, libsndfile, which 2 2 , AppKit, Carbon, CoreAudio, CoreMIDI, CoreServices, Kernel 3 + , xcbuild 3 4 }: 4 5 5 6 stdenv.mkDerivation rec { ··· 11 12 sha256 = "02z7sglax3j09grj5s1skmw8z6wz7b21hjrm95nrrdpwbxabh079"; 12 13 }; 13 14 14 - buildInputs = [ bison flex libsndfile which ] 15 - ++ stdenv.lib.optional (!stdenv.isDarwin) alsaLib 16 - ++ stdenv.lib.optional stdenv.isDarwin [ AppKit Carbon CoreAudio CoreMIDI CoreServices Kernel ]; 15 + nativeBuildInputs = [ flex bison which ]; 16 + 17 + buildInputs = [ libsndfile ] 18 + ++ lib.optional (!stdenv.isDarwin) alsaLib 19 + ++ lib.optional stdenv.isDarwin [ AppKit Carbon CoreAudio CoreMIDI CoreServices Kernel ]; 17 20 18 21 patches = [ ./clang.patch ./darwin-limits.patch ]; 19 22 20 - NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.isDarwin "-Wno-missing-sysroot"; 21 - NIX_LDFLAGS = stdenv.lib.optionalString stdenv.isDarwin "-framework MultitouchSupport"; 23 + NIX_CFLAGS_COMPILE = lib.optional stdenv.isDarwin "-Wno-missing-sysroot"; 24 + NIX_LDFLAGS = lib.optional stdenv.isDarwin "-framework MultitouchSupport"; 22 25 23 26 postPatch = '' 24 27 substituteInPlace src/makefile --replace "/usr/bin" "$out/bin" 25 - substituteInPlace src/makefile.osx --replace "xcodebuild" "/usr/bin/xcodebuild" 26 - substituteInPlace src/makefile.osx --replace "weak_framework" "framework" 27 - substituteInPlace src/makefile.osx --replace "MACOSX_DEPLOYMENT_TARGET=10.5" "MACOSX_DEPLOYMENT_TARGET=$MACOSX_DEPLOYMENT_TARGET" 28 - ''; 29 - 30 - buildPhase = '' 31 - make -C src ${if stdenv.isDarwin then "osx" else "linux-alsa"} 28 + substituteInPlace src/makefile.osx \ 29 + --replace "weak_framework" "framework" \ 30 + --replace "MACOSX_DEPLOYMENT_TARGET=10.5" "MACOSX_DEPLOYMENT_TARGET=$MACOSX_DEPLOYMENT_TARGET" 32 31 ''; 33 32 34 - installPhase = '' 35 - install -Dm755 ./src/chuck $out/bin/chuck 36 - ''; 33 + makeFlags = [ "-C src" "DESTDIR=$(out)/bin" ]; 34 + buildFlags = [ (if stdenv.isDarwin then "osx" else "linux-alsa") ]; 37 35 38 - meta = with stdenv.lib; { 36 + meta = with lib; { 39 37 description = "Programming language for real-time sound synthesis and music creation"; 40 38 homepage = http://chuck.cs.princeton.edu; 41 39 license = licenses.gpl2;