2022-11-02 22:02:43 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, cmake, gtest, boost, pkg-config, protobuf, icu, Foundation, buildPackages }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2024-01-25 14:12:00 +00:00
|
|
|
pname = "libphonenumber";
|
2021-12-06 16:07:01 +00:00
|
|
|
version = "8.12.37";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "googlei18n";
|
|
|
|
repo = "libphonenumber";
|
|
|
|
rev = "v${version}";
|
2021-12-06 16:07:01 +00:00
|
|
|
sha256 = "sha256-xLxadSxVY3DjFDQrqj3BuOvdMaKdFSLjocfzovJCBB0=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-05-24 13:37:59 +00:00
|
|
|
patches = [
|
2024-01-25 14:12:00 +00:00
|
|
|
# An earlier version of this patch was submitted upstream but did not get
|
|
|
|
# any interest there - https://github.com/google/libphonenumber/pull/2921
|
2023-05-24 13:37:59 +00:00
|
|
|
./build-reproducibility.patch
|
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
2021-02-05 17:12:51 +00:00
|
|
|
pkg-config
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
boost
|
|
|
|
protobuf
|
|
|
|
icu
|
2022-11-02 22:02:43 +00:00
|
|
|
gtest
|
2021-12-06 16:07:01 +00:00
|
|
|
] ++ lib.optional stdenv.isDarwin Foundation;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
cmakeDir = "../cpp";
|
2022-11-02 22:02:43 +00:00
|
|
|
cmakeFlags =
|
|
|
|
lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
|
|
|
|
"-DBUILD_GEOCODER=OFF"
|
|
|
|
"-DPROTOC_BIN=${buildPackages.protobuf}/bin/protoc"
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
checkPhase = "./libphonenumber_test";
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Google's i18n library for parsing and using phone numbers";
|
2021-12-06 16:07:01 +00:00
|
|
|
homepage = "https://github.com/google/libphonenumber";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ illegalprime ];
|
|
|
|
};
|
|
|
|
}
|