diff --git a/pkgs/development/compilers/avian/default.nix b/pkgs/development/compilers/avian/default.nix index 3d58e75200c..4dc384f70a3 100644 --- a/pkgs/development/compilers/avian/default.nix +++ b/pkgs/development/compilers/avian/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchFromGitHub, zlib, jdk }: +{ stdenv, fetchFromGitHub, zlib, jdk, CoreServices, Foundation }: stdenv.mkDerivation rec { name = "avian-${version}"; @@ -11,10 +11,16 @@ stdenv.mkDerivation rec { sha256 = "1j2y45cpqk3x6a743mgpg7z3ivwm7qc9jy6xirvay7ah1qyxmm48"; }; - buildInputs = [ - zlib - jdk - ]; + buildInputs = [ zlib jdk ] + ++ stdenv.lib.optionals stdenv.isDarwin [ CoreServices Foundation ]; + + NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.cc.isClang "-Wno-error"; + + postPatch = '' + substituteInPlace makefile \ + --replace 'g++' 'c++' \ + --replace 'gcc' 'cc' + ''; installPhase = '' mkdir -p $out/bin diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 9866a2aaf99..2ed949ac7a8 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -5769,7 +5769,8 @@ with pkgs; avra = callPackage ../development/compilers/avra { }; avian = callPackage ../development/compilers/avian { - stdenv = overrideCC stdenv gcc49; + inherit (darwin.apple_sdk.frameworks) CoreServices Foundation; + stdenv = if stdenv.cc.isGNU then overrideCC stdenv gcc49 else stdenv; }; bigloo = callPackage ../development/compilers/bigloo { };