git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #66525 from andir/google-cloud-cpp

google-cloud-cpp: init at 0.11.0

commitf2e631148ab4032891d3fc4606886d5dad7cb207 authorWilliButz <WilliButz@users.noreply.github.com> dateWed 14 Aug 2019, 21:57 (7 years ago) parent8281a671a72fe8
3 files changed+93
pkgs/development/libraries/crc32c/default.nix+24 pkgs/development/libraries/google-cloud-cpp/default.nix+65 pkgs/top-level/all-packages.nix+4
pkgs/development/libraries/crc32c/default.nixnew file+24
@@ -0,0 +1,24 @@
1+{ stdenv, fetchFromGitHub, cmake, gflags }:
2+stdenv.mkDerivation rec {
3+ pname = "crc32c";
4+ version = "1.1.0";
5+
6+ src = fetchFromGitHub {
7+ owner = "google";
8+ repo = "crc32c";
9+ rev = version;
10+ sha256 = "1sazkis9rzbrklfrvk7jn1mqywnq4yghmzg94mxd153h8b1sb149";
11+ fetchSubmodules = true;
12+ };
13+
14+ nativeBuildInputs = [ cmake ];
15+ buildInputs = [ gflags ];
16+ NIX_CFLAGS_COMPILE = stdenv.lib.optional stdenv.isAarch64 "-march=armv8-a+crc";
17+
18+ meta = with stdenv.lib; {
19+ homepage = https://github.com/google/crc32c;
20+ description = "CRC32C implementation with support for CPU-specific acceleration instructions";
21+ license = with licenses; [ bsd3 ];
22+ maintainers = with maintainers; [ andir ];
23+ };
24+}
pkgs/development/libraries/google-cloud-cpp/default.nixnew file+65
@@ -0,0 +1,65 @@
1+{ stdenv, grpc, curl, cmake, pkgconfig, fetchFromGitHub, doxygen, protobuf, crc32c, c-ares, nlohmann_json, fetchurl }:
2+let
3+ googleapis_rev = "a8ee1416f4c588f2ab92da72e7c1f588c784d3e6";
4+ googleapis = fetchurl {
5+ name = "${googleapis_rev}.tar.gz";
6+ url = "https://github.com/googleapis/googleapis/archive/${googleapis_rev}.tar.gz";
7+ sha256 = "1kxi27r034p7jfldhvgpbn6rqqqddycnja47m6jyjxj4rcmrp2kb";
8+ };
9+in stdenv.mkDerivation rec {
10+ pname = "google-cloud-cpp";
11+ version = "0.11.0";
12+
13+ src = fetchFromGitHub {
14+ owner = "googleapis";
15+ repo = "google-cloud-cpp";
16+ rev = "v${version}";
17+ sha256 = "1w942gzyv01ym1cv2a417x92zxra9s2v3xz5crcv84j919f616f8";
18+ };
19+
20+ buildInputs = [ curl grpc protobuf nlohmann_json crc32c c-ares c-ares.cmake-config ];
21+ nativeBuildInputs = [ cmake pkgconfig doxygen ];
22+
23+ outputs = [ "out" "dev" ];
24+
25+ postPatch = ''
26+ NLOHMANN_SHA256=$(sha256sum ${nlohmann_json}/include/nlohmann/json.hpp | cut -f1 -d' ')
27+ sed -e 's,https://github.com/nlohmann/json/releases/download/.*,file://${nlohmann_json}/include/nlohmann/json.hpp"),' \
28+ -e "s,JSON_SHA256 .*,JSON_SHA256 ''${NLOHMANN_SHA256}," \
29+ -i cmake/DownloadNlohmannJson.cmake
30+
31+ sed -e 's,https://github.com/googleapis/googleapis/archive/${googleapis_rev}.tar.gz,file://${googleapis},' \
32+ -i cmake/external/googleapis.cmake
33+
34+ # Fixup the library path. It would build a path like /build/external//nix/store/…-foo/lib/foo.so for each library instead of /build/external/lib64/foo.so
35+ sed -e 's,''${CMAKE_INSTALL_LIBDIR},lib64,g' \
36+ -e 's,;lib64,lib,g' \
37+ -i cmake/ExternalProjectHelper.cmake
38+ '';
39+
40+ preFixup = ''
41+ mv --no-clobber $out/lib64/cmake/* $out/lib/cmake
42+ mv --no-clobber $out/lib64/pkgconfig/* $out/lib/pkgconfig
43+ rmdir $out/lib64/cmake $out/lib64/pkgconfig
44+ find $out/lib64
45+
46+ for file in $out/lib/pkgconfig/*; do
47+ sed -e 's,\''${prefix}//,/,g' -i $file
48+ done
49+ '';
50+
51+ cmakeFlags = [
52+ "-DGOOGLE_CLOUD_CPP_BIGTABLE_ENABLE_INSTALL=no"
53+ "-DGOOGLE_CLOUD_CPP_DEPENDENCY_PROVIDER=package"
54+ "-DGOOGLE_CLOUD_CPP_GOOGLEAPIS_PROVIDER=external"
55+ "-DBUILD_SHARED_LIBS:BOOL=ON"
56+ "-DGOOGLE_CLOUD_CPP_INSTALL_RPATH=$(out)/lib"
57+ ];
58+
59+ meta = with stdenv.lib; {
60+ license = with licenses; [ asl20 ];
61+ homepage = https://github.com/googleapis/google-cloud-cpp;
62+ description = "C++ Idiomatic Clients for Google Cloud Platform services";
63+ maintainers = with maintainers; [ andir ];
64+ };
65+}
pkgs/top-level/all-packages.nix+4
@@ -760,6 +760,8 @@ in
760760
761761 crumbs = callPackage ../applications/misc/crumbs { };
762762
763+ crc32c = callPackage ../development/libraries/crc32c { };
764+
763765 cue = callPackage ../development/tools/cue { };
764766
765767 deskew = callPackage ../applications/graphics/deskew { };
@@ -3453,6 +3455,8 @@ in
34533455
34543456 google-music-scripts = callPackage ../tools/audio/google-music-scripts { };
34553457
3458+ google-cloud-cpp = callPackage ../development/libraries/google-cloud-cpp { };
3459+
34563460 gopro = callPackage ../tools/video/gopro { };
34573461
34583462 gource = callPackage ../applications/version-management/gource { };