From 3391ee339b2008bd74ab112dc66a84f3e103f840 Mon Sep 17 00:00:00 2001 From: Weijia Wang <9713184+wegank@users.noreply.github.com> Date: Wed, 25 Jan 2023 13:47:48 +0100 Subject: [PATCH] cmus: remove clangGCC hack The compiler is overridable using the HOSTCC flag, so no hacks such as creating a fake gcc is needed. --- pkgs/applications/audio/cmus/default.nix | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/pkgs/applications/audio/cmus/default.nix b/pkgs/applications/audio/cmus/default.nix index 61ff53aa1d75..6d37e33b5eee 100644 --- a/pkgs/applications/audio/cmus/default.nix +++ b/pkgs/applications/audio/cmus/default.nix @@ -88,14 +88,6 @@ 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,17 +103,18 @@ stdenv.mkDerivation rec { patches = [ ./option-debugging.patch ]; - configurePhase = "./configure " + lib.concatStringsSep " " ([ - "prefix=$out" - "CONFIG_WAV=y" - ] ++ lib.concatMap (a: a.flags) opts); - nativeBuildInputs = [ pkg-config ]; buildInputs = [ ncurses ] - ++ lib.optional stdenv.cc.isClang clangGCC ++ lib.optionals stdenv.isDarwin [ libiconv CoreAudio AudioUnit VideoToolbox ] ++ lib.flatten (lib.concatMap (a: a.deps) opts); + prefixKey = "prefix="; + + configureFlags = [ + "CONFIG_WAV=y" + "HOSTCC=${stdenv.cc.targetPrefix}cc" + ] ++ lib.concatMap (a: a.flags) opts; + makeFlags = [ "LD=$(CC)" ]; meta = with lib; {