nixpkgs-suyu/pkgs/development/libraries/aws-sdk-cpp/default.nix

48 lines
1.3 KiB
Nix
Raw Normal View History

2016-11-28 16:14:35 +01:00
{ lib, stdenv, fetchFromGitHub, cmake, curl, libuuid, openssl, zlib
, # Allow building a limited set of APIs, e.g. ["s3" "ec2"].
apis ? ["*"]
, # Whether to enable AWS' custom memory management.
customMemoryManagement ? true
}:
2016-02-16 13:41:19 +01:00
stdenv.mkDerivation rec {
name = "aws-sdk-cpp-${version}";
2016-11-28 16:14:35 +01:00
version = "1.0.34";
2016-02-16 13:41:19 +01:00
src = fetchFromGitHub {
owner = "awslabs";
repo = "aws-sdk-cpp";
rev = version;
2016-11-28 16:14:35 +01:00
sha256 = "09vag1ybfqvw37djmd9g740iqjvg8nwr4p0xb21rfj06vazrdg4b";
2016-02-16 13:41:19 +01:00
};
2016-11-28 16:14:35 +01:00
buildInputs = [ cmake curl libuuid ];
2016-02-16 13:41:19 +01:00
cmakeFlags =
lib.optional (!customMemoryManagement) "-DCUSTOM_MEMORY_MANAGEMENT=0"
++ lib.optional (apis != ["*"])
2016-11-28 16:14:35 +01:00
"-DBUILD_ONLY=${lib.concatStringsSep ";" apis}";
2016-02-16 13:41:19 +01:00
enableParallelBuilding = true;
preBuild =
''
# Ensure that the unit tests can find the *.so files.
for i in testing-resources aws-cpp-sdk-*; do
export LD_LIBRARY_PATH=$(pwd)/$i:$LD_LIBRARY_PATH
done
'';
2016-11-28 16:14:35 +01:00
NIX_LDFLAGS = lib.concatStringsSep " " (
(map (pkg: "-rpath ${lib.getOutput "lib" pkg}/lib"))
[ libuuid curl openssl zlib stdenv.cc.cc ]);
2016-02-16 13:41:19 +01:00
meta = {
description = "A C++ interface for Amazon Web Services";
homepage = https://github.com/awslabs/aws-sdk-cpp;
license = lib.licenses.asl20;
platforms = lib.platforms.linux;
maintainers = [ lib.maintainers.eelco ];
};
}