capnproto: fix cross

capnproto tries to compile some capnproto files, so when
cross-compiling we need to give it the build platform's capnproto
binary or it'll try to execute the one for the host platform.
This commit is contained in:
Alyssa Ross 2021-09-20 13:47:32 +00:00
parent 3fc12275e6
commit 860b938bbf

View File

@ -1,4 +1,4 @@
{ lib, stdenv, fetchurl, cmake }:
{ lib, stdenv, fetchurl, capnproto, cmake }:
stdenv.mkDerivation rec {
pname = "capnproto";
@ -9,7 +9,10 @@ stdenv.mkDerivation rec {
sha256 = "sha256-soBUp6K/6kK/w5LI0AljDZTXLozoaiOtbxi15yV0Bk8=";
};
nativeBuildInputs = [ cmake ];
nativeBuildInputs = [ cmake ]
++ lib.optional (!(stdenv.hostPlatform.isCompatible stdenv.buildPlatform)) capnproto;
cmakeFlags = lib.optional (!(stdenv.hostPlatform.isCompatible stdenv.buildPlatform)) "-DEXTERNAL_CAPNP";
meta = with lib; {
homepage = "https://capnproto.org/";