koka: make sure runtime dependencies are host -> target

buildPackages.stdenv.cc.cc is a C compiler that runs on the build
platform and produces binaries for the host platform. This is not
what we want. Also pkgsHostTarget.stdenv.cc is not the compiler we
want as stdenv always runs on the previous stage so to say (the stdenv
is used to build the package set, in the case of cross compiling
this is not done natively). Thus pkgsHostTarget.targetPackages.stdenv.cc
is what we want.
This commit is contained in:
sternenseemann 2021-04-02 13:34:15 +02:00 committed by sterni
parent 2136e90fa3
commit 4a67076273

@ -1,4 +1,4 @@
{ stdenv, buildPackages, cmake, gnumake, makeWrapper, mkDerivation, fetchFromGitHub
{ stdenv, pkgsHostTarget, cmake, makeWrapper, mkDerivation, fetchFromGitHub
, alex, array, base, bytestring, cond, containers, directory, extra
, filepath, haskeline, hpack, hspec, hspec-core, json, lib, mtl
, parsec, process, regex-compat, text, time }:
@ -18,11 +18,12 @@ let
src = "${src}/kklib";
nativeBuildInputs = [ cmake ];
};
inherit (pkgsHostTarget.targetPackages.stdenv) cc;
runtimeDeps = [
buildPackages.stdenv.cc
buildPackages.stdenv.cc.bintools.bintools
gnumake
cmake
cc
cc.bintools.bintools
pkgsHostTarget.gnumake
pkgsHostTarget.cmake
];
in
mkDerivation rec {
@ -42,7 +43,7 @@ mkDerivation rec {
cp -a contrib $out/share/koka/v${version}
cp -a kklib $out/share/koka/v${version}
wrapProgram "$out/bin/koka" \
--set CC "${lib.getBin buildPackages.stdenv.cc}/bin/${buildPackages.stdenv.cc.targetPrefix}cc" \
--set CC "${lib.getBin cc}/bin/${cc.targetPrefix}cc" \
--prefix PATH : "${lib.makeSearchPath "bin" runtimeDeps}"
'';
doCheck = false;