libphonenumber: fix cross-compilation

The following previously failed and now succeeds.

    nix-build -A pkgsCross.aarch64-multiplatform.libphonenumber .

When compiling natively, the result is the same as before.
This commit is contained in:
Ewout Van Troostenberghe 2022-09-23 21:24:14 +02:00 committed by Rick van Schijndel
parent d8218497d3
commit d8be1b011f

View File

@ -1,4 +1,4 @@
{ lib, stdenv, fetchFromGitHub, cmake, gtest, boost, pkg-config, protobuf, icu, Foundation }:
{ lib, stdenv, fetchFromGitHub, cmake, gtest, boost, pkg-config, protobuf, icu, Foundation, buildPackages }:
stdenv.mkDerivation rec {
pname = "phonenumber";
@ -13,7 +13,6 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [
cmake
gtest
pkg-config
];
@ -21,9 +20,15 @@ stdenv.mkDerivation rec {
boost
protobuf
icu
gtest
] ++ lib.optional stdenv.isDarwin Foundation;
cmakeDir = "../cpp";
cmakeFlags =
lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
"-DBUILD_GEOCODER=OFF"
"-DPROTOC_BIN=${buildPackages.protobuf}/bin/protoc"
];
checkPhase = "./libphonenumber_test";