1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-18 11:40:45 +00:00
nixpkgs/pkgs/development/libraries/libphonenumber/default.nix
2024-07-08 10:51:42 +00:00

66 lines
1.4 KiB
Nix

{ lib
, stdenv
, fetchFromGitHub
, buildPackages
, cmake
, gtest
, jre
, pkg-config
, boost
, icu
, protobuf
, Foundation
}:
stdenv.mkDerivation (finalAttrs: {
pname = "libphonenumber";
version = "8.13.40";
src = fetchFromGitHub {
owner = "google";
repo = "libphonenumber";
rev = "v${finalAttrs.version}";
hash = "sha256-3I+/oLJVbgOA+o8jHhOuHhD+0s7sgOghnW7DTMCllBU=";
};
patches = [
# An earlier version of this patch was submitted upstream but did not get
# any interest there - https://github.com/google/libphonenumber/pull/2921
./build-reproducibility.patch
];
nativeBuildInputs = [
cmake
gtest
jre
pkg-config
];
buildInputs = [
boost
icu
protobuf
] ++ lib.optionals stdenv.isDarwin [
Foundation
];
cmakeDir = "../cpp";
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))
];
meta = with lib; {
changelog = "https://github.com/google/libphonenumber/blob/${finalAttrs.src.rev}/release_notes.txt";
description = "Google's i18n library for parsing and using phone numbers";
homepage = "https://github.com/google/libphonenumber";
license = licenses.asl20;
maintainers = with maintainers; [ illegalprime ];
};
})