google-cloud-cpp: 0.11.0 -> 0.14.0
This bumps google-cloud-cpp to 0.14.0, which switched to using pkgconfig for more of the dependencies. On top of that, the installation looks much better (we don't need to fixup library paths and move files around) On top of that, upstream introduced another intermediate dependency (googleapis-cpp-cmakefiles). Obsoletes #67769.
This commit is contained in:
parent
bcc5f08ba0
commit
5e225b7fd9
@ -1,65 +1,62 @@
|
|||||||
{ stdenv, grpc, curl, cmake, pkgconfig, fetchFromGitHub, doxygen, protobuf, crc32c, c-ares, nlohmann_json, fetchurl }:
|
{ stdenv, clang-tools, grpc, curl, cmake, pkgconfig, fetchFromGitHub, doxygen, protobuf, crc32c, c-ares, fetchurl, openssl, zlib }:
|
||||||
let
|
let
|
||||||
googleapis_rev = "a8ee1416f4c588f2ab92da72e7c1f588c784d3e6";
|
googleapis = fetchFromGitHub {
|
||||||
googleapis = fetchurl {
|
owner = "googleapis";
|
||||||
name = "${googleapis_rev}.tar.gz";
|
repo = "googleapis";
|
||||||
url = "https://github.com/googleapis/googleapis/archive/${googleapis_rev}.tar.gz";
|
rev = "9c9f778aedde02f9826d2ae5d0f9c96409ba0f25";
|
||||||
sha256 = "1kxi27r034p7jfldhvgpbn6rqqqddycnja47m6jyjxj4rcmrp2kb";
|
sha256 = "1gd3nwv8qf503wy6km0ad6akdvss9w5b1k3jqizy5gah1fkirkpi";
|
||||||
|
};
|
||||||
|
googleapis-cpp-cmakefiles = stdenv.mkDerivation rec {
|
||||||
|
pname = "googleapis-cpp-cmakefiles";
|
||||||
|
version = "0.1.5";
|
||||||
|
src = fetchFromGitHub {
|
||||||
|
owner = "googleapis";
|
||||||
|
repo = "cpp-cmakefiles";
|
||||||
|
rev = "v${version}";
|
||||||
|
sha256 = "02zkcq2wl831ayd9qy009xvfx7q80pgycx7mzz9vknwd0nn6dd0n";
|
||||||
|
};
|
||||||
|
|
||||||
|
nativeBuildInputs = [ cmake pkgconfig ];
|
||||||
|
buildInputs = [ c-ares c-ares.cmake-config grpc openssl protobuf zlib ];
|
||||||
|
|
||||||
|
postPatch = ''
|
||||||
|
sed -e 's,https://github.com/googleapis/googleapis/archive/9c9f778aedde02f9826d2ae5d0f9c96409ba0f25.tar.gz,file://${googleapis},' \
|
||||||
|
-i CMakeLists.txt
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
_nlohmann_json = fetchurl {
|
||||||
|
url = "https://github.com/nlohmann/json/releases/download/v3.4.0/json.hpp";
|
||||||
|
sha256 = "0pw3jpi572irbp2dqclmyhgic6k9rxav5mpp9ygbp9xj48gnvnk3";
|
||||||
};
|
};
|
||||||
in stdenv.mkDerivation rec {
|
in stdenv.mkDerivation rec {
|
||||||
pname = "google-cloud-cpp";
|
pname = "google-cloud-cpp";
|
||||||
version = "0.11.0";
|
version = "0.14.0";
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
src = fetchFromGitHub {
|
||||||
owner = "googleapis";
|
owner = "googleapis";
|
||||||
repo = "google-cloud-cpp";
|
repo = "google-cloud-cpp";
|
||||||
rev = "v${version}";
|
rev = "v${version}";
|
||||||
sha256 = "1w942gzyv01ym1cv2a417x92zxra9s2v3xz5crcv84j919f616f8";
|
sha256 = "15wci4m8h6py7fqfziq8mp5m6pxp2h1cbh5rp2k90mk5js4jb9pa";
|
||||||
};
|
};
|
||||||
|
|
||||||
buildInputs = [ curl grpc protobuf nlohmann_json crc32c c-ares c-ares.cmake-config ];
|
buildInputs = [ curl crc32c c-ares c-ares.cmake-config googleapis-cpp-cmakefiles grpc protobuf ];
|
||||||
nativeBuildInputs = [ cmake pkgconfig doxygen ];
|
nativeBuildInputs = [ clang-tools cmake pkgconfig doxygen ];
|
||||||
|
|
||||||
outputs = [ "out" "dev" ];
|
outputs = [ "out" "dev" ];
|
||||||
|
|
||||||
postPatch = ''
|
postPatch = ''
|
||||||
NLOHMANN_SHA256=$(sha256sum ${nlohmann_json}/include/nlohmann/json.hpp | cut -f1 -d' ')
|
sed -e 's,https://github.com/nlohmann/json/releases/download/v3.4.0/json.hpp,file://${_nlohmann_json},' \
|
||||||
sed -e 's,https://github.com/nlohmann/json/releases/download/.*,file://${nlohmann_json}/include/nlohmann/json.hpp"),' \
|
-i cmake/DownloadNlohmannJson.cmake
|
||||||
-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 = [
|
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"
|
"-DBUILD_SHARED_LIBS:BOOL=ON"
|
||||||
"-DGOOGLE_CLOUD_CPP_INSTALL_RPATH=$(out)/lib"
|
|
||||||
];
|
];
|
||||||
|
|
||||||
meta = with stdenv.lib; {
|
meta = with stdenv.lib; {
|
||||||
license = with licenses; [ asl20 ];
|
license = with licenses; [ asl20 ];
|
||||||
homepage = https://github.com/googleapis/google-cloud-cpp;
|
homepage = https://github.com/googleapis/google-cloud-cpp;
|
||||||
description = "C++ Idiomatic Clients for Google Cloud Platform services";
|
description = "C++ Idiomatic Clients for Google Cloud Platform services";
|
||||||
maintainers = with maintainers; [ andir ];
|
maintainers = with maintainers; [ andir flokli ];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user