From 7b2ac69adae1927602e336981aa96cdbb53f77e3 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 18 Feb 2016 19:04:02 +0100 Subject: [PATCH] aws-sdk-cpp: Allow building some APIS and disabling custom memory management --- pkgs/development/libraries/aws-sdk-cpp/default.nix | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/pkgs/development/libraries/aws-sdk-cpp/default.nix b/pkgs/development/libraries/aws-sdk-cpp/default.nix index 22fb9facfea9..6a881e4245aa 100644 --- a/pkgs/development/libraries/aws-sdk-cpp/default.nix +++ b/pkgs/development/libraries/aws-sdk-cpp/default.nix @@ -1,4 +1,9 @@ -{ lib, stdenv, fetchFromGitHub, cmake, curl }: +{ lib, stdenv, fetchFromGitHub, cmake, curl +, # Allow building a limited set of APIs, e.g. ["s3" "ec2"]. + apis ? ["*"] +, # Whether to enable AWS' custom memory management. + customMemoryManagement ? true +}: stdenv.mkDerivation rec { name = "aws-sdk-cpp-${version}"; @@ -13,9 +18,10 @@ stdenv.mkDerivation rec { buildInputs = [ cmake curl ]; - # FIXME: provide flags to build only part of the SDK, or put them in - # different outputs. - # cmakeFlags = "-DBUILD_ONLY=aws-cpp-sdk-s3"; + cmakeFlags = + lib.optional (!customMemoryManagement) "-DCUSTOM_MEMORY_MANAGEMENT=0" + ++ lib.optional (apis != ["*"]) + "-DBUILD_ONLY=${lib.concatMapStringsSep ";" (api: "aws-cpp-sdk-" + api) apis}"; enableParallelBuilding = true;