Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / development / libraries / libphonenumber / default.nix
bloba9b0df3304be5aa47a12b44436564957186125db
1 { lib, stdenv, fetchFromGitHub, cmake, gtest, boost, pkg-config, protobuf, icu, Foundation, buildPackages }:
3 stdenv.mkDerivation rec {
4   pname = "phonenumber";
5   version = "8.12.37";
7   src = fetchFromGitHub {
8     owner = "googlei18n";
9     repo = "libphonenumber";
10     rev = "v${version}";
11     sha256 = "sha256-xLxadSxVY3DjFDQrqj3BuOvdMaKdFSLjocfzovJCBB0=";
12   };
14   patches = [
15     # Submitted upstream: https://github.com/google/libphonenumber/pull/2921
16     ./build-reproducibility.patch
17   ];
19   nativeBuildInputs = [
20     cmake
21     pkg-config
22   ];
24   buildInputs = [
25     boost
26     protobuf
27     icu
28     gtest
29   ] ++ lib.optional stdenv.isDarwin Foundation;
31   cmakeDir = "../cpp";
32   cmakeFlags =
33     lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
34       "-DBUILD_GEOCODER=OFF"
35       "-DPROTOC_BIN=${buildPackages.protobuf}/bin/protoc"
36     ];
38   checkPhase = "./libphonenumber_test";
40   meta = with lib; {
41     description = "Google's i18n library for parsing and using phone numbers";
42     homepage = "https://github.com/google/libphonenumber";
43     license = licenses.asl20;
44     maintainers = with maintainers; [ illegalprime ];
45   };