3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/development/libraries/libphonenumber/default.nix
Ewout Van Troostenberghe d8be1b011f 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.
2022-10-31 21:52:18 +00:00

42 lines
1,018 B
Nix

{ lib, stdenv, fetchFromGitHub, cmake, gtest, boost, pkg-config, protobuf, icu, Foundation, buildPackages }:
stdenv.mkDerivation rec {
pname = "phonenumber";
version = "8.12.37";
src = fetchFromGitHub {
owner = "googlei18n";
repo = "libphonenumber";
rev = "v${version}";
sha256 = "sha256-xLxadSxVY3DjFDQrqj3BuOvdMaKdFSLjocfzovJCBB0=";
};
nativeBuildInputs = [
cmake
pkg-config
];
buildInputs = [
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";
meta = with lib; {
description = "Google's i18n library for parsing and using phone numbers";
homepage = "https://github.com/google/libphonenumber";
license = licenses.asl20;
maintainers = with maintainers; [ illegalprime ];
};
}