From 4a67076273c8c566f90e3f0caadce941106314d9 Mon Sep 17 00:00:00 2001 From: sternenseemann <0rpkxez4ksa01gb3typccl0i@systemli.org> Date: Fri, 2 Apr 2021 13:34:15 +0200 Subject: [PATCH] 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. --- pkgs/development/compilers/koka/default.nix | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/pkgs/development/compilers/koka/default.nix b/pkgs/development/compilers/koka/default.nix index 087b0ad1153..6523dcca2f6 100644 --- a/pkgs/development/compilers/koka/default.nix +++ b/pkgs/development/compilers/koka/default.nix @@ -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;