From d8be1b011fa763ab0261366b59be108e04b50f79 Mon Sep 17 00:00:00 2001 From: Ewout Van Troostenberghe Date: Fri, 23 Sep 2022 21:24:14 +0200 Subject: [PATCH] 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. --- pkgs/development/libraries/libphonenumber/default.nix | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pkgs/development/libraries/libphonenumber/default.nix b/pkgs/development/libraries/libphonenumber/default.nix index b19eee6ccf88..1c6d355da429 100644 --- a/pkgs/development/libraries/libphonenumber/default.nix +++ b/pkgs/development/libraries/libphonenumber/default.nix @@ -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";