1{ stdenv, fetchgit, fetchurl, cmake, protobuf, libunwind, openssl, glog
2, google-gflags, gmock, gtest
3}:
4
5let
6 protoTar = fetchurl {
7 url = "http://github.com/Seagate/kinetic-protocol/archive/3.0.0.tar.gz";
8 sha256 = "0406pp0sdf0rg6s5g18r2d8si2rin7p6qbzp7c6pma5hyzsygz48";
9 };
10in
11stdenv.mkDerivation rec {
12 name = "kinetic-cpp-client-2015-04-14";
13
14 src = fetchgit {
15 url = "git://github.com/Seagate/kinetic-cpp-client.git";
16 rev = "015085a5c89db0398f80923053f36b9e0611e107";
17 sha256 = "15iwlfjwnyswiwssdjg6qiflhddh66nv07xji4yhz1s4vqhk3nrx";
18 };
19
20 patches = [ ./build-fix.patch ];
21
22 postPatch = ''
23 mkdir -p build/kinetic-proto
24 tar -x --strip-components 1 -C build/kinetic-proto -f ${protoTar}
25 '';
26
27 nativeBuildInputs = [ cmake protobuf ];
28 buildInputs = [ libunwind glog google-gflags gmock gtest ];
29
30 # The headers and library include from these and there is no provided pc file
31 propagatedBuildInputs = [ protobuf openssl ];
32
33 cmakeFlags = [
34 "-DBUILD_SHARED_LIBS=true"
35 ];
36
37 preCheck = ''
38 # The checks cannot find libkinetic_client.so otherwise
39 export LD_LIBRARY_PATH="$(pwd)"
40 '';
41
42 installPhase = ''
43 # There is no included install script so do our best
44 mkdir -p $out/lib
45 cp libkinetic_client.so $out/lib
46 cp -r ../include $out
47 cp ../src/main/generated/kinetic_client.pb.h $out/include
48 '';
49
50 doCheck = true;
51
52 meta = with stdenv.lib; {
53 homepage = https://github.com/Seagate/kinetic-cpp-client;
54 description = "code for producing C and C++ kinetic clients";
55 license = licenses.lgpl21;
56 platforms = platforms.unix;
57 maintainers = with maintainers; [ wkennington ];
58 };
59}