2022-09-23 20:24:14 +01:00
|
|
|
{ lib, stdenv, fetchFromGitHub, cmake, gtest, boost, pkg-config, protobuf, icu, Foundation, buildPackages }:
|
2018-08-13 21:23:19 +01:00
|
|
|
|
2019-10-05 22:50:15 +01:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "phonenumber";
|
2021-11-18 17:09:41 +00:00
|
|
|
version = "8.12.37";
|
2018-08-13 21:23:19 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "googlei18n";
|
|
|
|
repo = "libphonenumber";
|
|
|
|
rev = "v${version}";
|
2021-11-18 17:09:41 +00:00
|
|
|
sha256 = "sha256-xLxadSxVY3DjFDQrqj3BuOvdMaKdFSLjocfzovJCBB0=";
|
2018-08-13 21:23:19 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
2021-01-19 06:50:56 +00:00
|
|
|
pkg-config
|
2018-08-13 21:23:19 +01:00
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
boost
|
|
|
|
protobuf
|
|
|
|
icu
|
2022-09-23 20:24:14 +01:00
|
|
|
gtest
|
2021-11-18 17:09:41 +00:00
|
|
|
] ++ lib.optional stdenv.isDarwin Foundation;
|
2018-08-13 21:23:19 +01:00
|
|
|
|
|
|
|
cmakeDir = "../cpp";
|
2022-09-23 20:24:14 +01:00
|
|
|
cmakeFlags =
|
|
|
|
lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
|
|
|
|
"-DBUILD_GEOCODER=OFF"
|
|
|
|
"-DPROTOC_BIN=${buildPackages.protobuf}/bin/protoc"
|
|
|
|
];
|
2018-08-13 21:23:19 +01:00
|
|
|
|
|
|
|
checkPhase = "./libphonenumber_test";
|
|
|
|
|
2021-01-21 17:00:13 +00:00
|
|
|
meta = with lib; {
|
2018-08-13 21:23:19 +01:00
|
|
|
description = "Google's i18n library for parsing and using phone numbers";
|
2021-11-18 17:09:41 +00:00
|
|
|
homepage = "https://github.com/google/libphonenumber";
|
2018-08-13 21:23:19 +01:00
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ illegalprime ];
|
|
|
|
};
|
|
|
|
}
|