1{
2 fetchFromGitHub,
3 lib,
4 stdenv,
5 cmake,
6 zlib,
7 libuv,
8 openssl,
9 pkg-config,
10 examples ? false,
11}:
12stdenv.mkDerivation rec {
13 pname = "cassandra-cpp-driver";
14 version = "2.17.1";
15
16 src = fetchFromGitHub {
17 owner = "datastax";
18 repo = "cpp-driver";
19 tag = version;
20 sha256 = "sha256-GuvmKHJknudyn7ahrn/8+kKUA4NW5UjCfkYoX3aTE+Q=";
21 };
22
23 nativeBuildInputs = [
24 cmake
25 pkg-config
26 ];
27 buildInputs = [
28 zlib
29 libuv
30 openssl.dev
31 ];
32
33 cmakeFlags =
34 (lib.attrsets.mapAttrsToList
35 (name: value: "-DCASS_BUILD_${name}:BOOL=${if value then "ON" else "OFF"}")
36 {
37 EXAMPLES = examples;
38 }
39 )
40 ++ [ "-DLIBUV_INCLUDE_DIR=${lib.getDev libuv}/include" ];
41
42 meta = with lib; {
43 description = "DataStax CPP cassandra driver";
44 longDescription = ''
45 A modern, feature-rich and highly tunable C/C++ client
46 library for Apache Cassandra 2.1+ using exclusively Cassandra’s
47 binary protocol and Cassandra Query Language v3.
48 '';
49 license = with licenses; [ asl20 ];
50 platforms = platforms.x86_64;
51 homepage = "https://docs.datastax.com/en/developer/cpp-driver/";
52 maintainers = [ maintainers.npatsakula ];
53 };
54}