3
0
Fork 0
forked from mirrors/nixpkgs

cmus: use clang's gcc compatibility for a clang based stdenv

This commit is contained in:
Daiderd Jordan 2017-01-25 21:48:43 +01:00
parent ad6ac35ae4
commit 50e9921179
No known key found for this signature in database
GPG key ID: D02435D05B810C96

View file

@ -1,5 +1,5 @@
{ stdenv, fetchFromGitHub, ncurses, pkgconfig
, gcc, libiconv, CoreAudio
{ stdenv, fetchFromGitHub, runCommand, ncurses, pkgconfig
, libiconv, CoreAudio
, alsaSupport ? stdenv.isLinux, alsaLib ? null
# simple fallback for everyone else
@ -90,6 +90,13 @@ let
#(mkFlag vtxSupport "CONFIG_VTX=y" libayemu)
];
clangGCC = runCommand "clang-gcc" {} ''
#! ${stdenv.shell}
mkdir -p $out/bin
ln -s ${stdenv.cc}/bin/clang $out/bin/gcc
ln -s ${stdenv.cc}/bin/clang++ $out/bin/g++
'';
in
stdenv.mkDerivation rec {
@ -111,7 +118,7 @@ stdenv.mkDerivation rec {
] ++ concatMap (a: a.flags) opts);
buildInputs = [ ncurses pkgconfig ]
++ stdenv.lib.optional stdenv.cc.isClang gcc
++ stdenv.lib.optional stdenv.cc.isClang clangGCC
++ stdenv.lib.optionals stdenv.isDarwin [ libiconv CoreAudio ]
++ concatMap (a: a.deps) opts;