2024-06-05 15:53:02 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, buildPackages
|
|
|
|
, cmake
|
|
|
|
, gtest
|
|
|
|
, jre
|
|
|
|
, pkg-config
|
|
|
|
, boost
|
|
|
|
, icu
|
|
|
|
, protobuf
|
|
|
|
, Foundation
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2024-01-25 14:12:00 +00:00
|
|
|
pname = "libphonenumber";
|
2024-06-05 15:53:02 +00:00
|
|
|
version = "8.13.37";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2024-06-05 15:53:02 +00:00
|
|
|
owner = "google";
|
2020-04-24 23:36:52 +00:00
|
|
|
repo = "libphonenumber";
|
2024-06-05 15:53:02 +00:00
|
|
|
rev = "v${finalAttrs.version}";
|
|
|
|
hash = "sha256-TQ9Hz9fnKZhZkg+hkXgFqH4TDCWMe+fcEWE6ShwSBBU=";
|
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
|
2024-06-05 15:53:02 +00:00
|
|
|
gtest
|
|
|
|
jre
|
2021-02-05 17:12:51 +00:00
|
|
|
pkg-config
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
boost
|
|
|
|
icu
|
2024-06-05 15:53:02 +00:00
|
|
|
protobuf
|
|
|
|
] ++ lib.optionals stdenv.isDarwin [
|
|
|
|
Foundation
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
cmakeDir = "../cpp";
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
doCheck = true;
|
|
|
|
|
|
|
|
checkTarget = "tests";
|
|
|
|
|
|
|
|
cmakeFlags = lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [
|
|
|
|
(lib.cmakeFeature "CMAKE_CROSSCOMPILING_EMULATOR" (stdenv.hostPlatform.emulator buildPackages))
|
|
|
|
(lib.cmakeFeature "PROTOC_BIN" (lib.getExe buildPackages.protobuf))
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2024-06-05 15:53:02 +00:00
|
|
|
changelog = "https://github.com/google/libphonenumber/blob/${finalAttrs.src.rev}/release_notes.txt";
|
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 ];
|
|
|
|
};
|
2024-06-05 15:53:02 +00:00
|
|
|
})
|