Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

google-cloud-cpp: init at 0.11.0 #66525

Merged
merged 2 commits into from
Aug 14, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions pkgs/development/libraries/crc32c/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{ stdenv, fetchFromGitHub, cmake, gflags }:
stdenv.mkDerivation rec {
pname = "crc32c";
version = "1.1.0";

src = fetchFromGitHub {
owner = "google";
repo = "crc32c";
rev = version;
sha256 = "1sazkis9rzbrklfrvk7jn1mqywnq4yghmzg94mxd153h8b1sb149";
fetchSubmodules = true;
};

nativeBuildInputs = [ cmake ];
buildInputs = [ gflags ];
NIX_CFLAGS_COMPILE = stdenv.lib.optional stdenv.isAarch64 "-march=armv8-a+crc";

andir marked this conversation as resolved.
Show resolved Hide resolved
meta = with stdenv.lib; {
homepage = https://github.com/google/crc32c;
description = "CRC32C implementation with support for CPU-specific acceleration instructions";
license = with licenses; [ bsd3 ];
maintainers = with maintainers; [ andir ];
};
}
65 changes: 65 additions & 0 deletions pkgs/development/libraries/google-cloud-cpp/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
{ stdenv, grpc, curl, cmake, pkgconfig, fetchFromGitHub, doxygen, protobuf, crc32c, c-ares, nlohmann_json, fetchurl }:
let
googleapis_rev = "a8ee1416f4c588f2ab92da72e7c1f588c784d3e6";
googleapis = fetchurl {
name = "${googleapis_rev}.tar.gz";
url = "https://github.com/googleapis/googleapis/archive/${googleapis_rev}.tar.gz";
sha256 = "1kxi27r034p7jfldhvgpbn6rqqqddycnja47m6jyjxj4rcmrp2kb";
};
in stdenv.mkDerivation rec {
pname = "google-cloud-cpp";
version = "0.11.0";

src = fetchFromGitHub {
owner = "googleapis";
repo = "google-cloud-cpp";
rev = "v${version}";
sha256 = "1w942gzyv01ym1cv2a417x92zxra9s2v3xz5crcv84j919f616f8";
};

buildInputs = [ curl grpc protobuf nlohmann_json crc32c c-ares c-ares.cmake-config ];
nativeBuildInputs = [ cmake pkgconfig doxygen ];

outputs = [ "out" "dev" ];

postPatch = ''
NLOHMANN_SHA256=$(sha256sum ${nlohmann_json}/include/nlohmann/json.hpp | cut -f1 -d' ')
sed -e 's,https://github.com/nlohmann/json/releases/download/.*,file://${nlohmann_json}/include/nlohmann/json.hpp"),' \
-e "s,JSON_SHA256 .*,JSON_SHA256 ''${NLOHMANN_SHA256}," \
-i cmake/DownloadNlohmannJson.cmake

sed -e 's,https://github.com/googleapis/googleapis/archive/${googleapis_rev}.tar.gz,file://${googleapis},' \
-i cmake/external/googleapis.cmake

# 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
sed -e 's,''${CMAKE_INSTALL_LIBDIR},lib64,g' \
-e 's,;lib64,lib,g' \
-i cmake/ExternalProjectHelper.cmake
'';

preFixup = ''
mv --no-clobber $out/lib64/cmake/* $out/lib/cmake
mv --no-clobber $out/lib64/pkgconfig/* $out/lib/pkgconfig
rmdir $out/lib64/cmake $out/lib64/pkgconfig
find $out/lib64

for file in $out/lib/pkgconfig/*; do
sed -e 's,\''${prefix}//,/,g' -i $file
done
'';

cmakeFlags = [
"-DGOOGLE_CLOUD_CPP_BIGTABLE_ENABLE_INSTALL=no"
"-DGOOGLE_CLOUD_CPP_DEPENDENCY_PROVIDER=package"
"-DGOOGLE_CLOUD_CPP_GOOGLEAPIS_PROVIDER=external"
"-DBUILD_SHARED_LIBS:BOOL=ON"
"-DGOOGLE_CLOUD_CPP_INSTALL_RPATH=$(out)/lib"
];

meta = with stdenv.lib; {
license = with licenses; [ asl20 ];
homepage = https://github.com/googleapis/google-cloud-cpp;
description = "C++ Idiomatic Clients for Google Cloud Platform services";
maintainers = with maintainers; [ andir ];
};
}
4 changes: 4 additions & 0 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -755,6 +755,8 @@ in

crumbs = callPackage ../applications/misc/crumbs { };

crc32c = callPackage ../development/libraries/crc32c { };

cue = callPackage ../development/tools/cue { };

deskew = callPackage ../applications/graphics/deskew { };
Expand Down Expand Up @@ -3444,6 +3446,8 @@ in

google-music-scripts = callPackage ../tools/audio/google-music-scripts { };

google-cloud-cpp = callPackage ../development/libraries/google-cloud-cpp { };

gopro = callPackage ../tools/video/gopro { };

gource = callPackage ../applications/version-management/gource { };
Expand Down