From d34ee526a814a6231ec2d400d86fea6d26d450bd Mon Sep 17 00:00:00 2001 From: Dan Peebles Date: Thu, 2 Feb 2017 02:18:26 +0100 Subject: [PATCH] aws-sdk-cpp: fix on darwin The LD_LIBRARY_PATH variable does nothing on Darwin, but DYLD_LIBRARY_PATH does the same thing, so splice in the right variable based on which system we're working on. --- pkgs/development/libraries/aws-sdk-cpp/default.nix | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/pkgs/development/libraries/aws-sdk-cpp/default.nix b/pkgs/development/libraries/aws-sdk-cpp/default.nix index 54d490b77af5..6a18ff3ed242 100644 --- a/pkgs/development/libraries/aws-sdk-cpp/default.nix +++ b/pkgs/development/libraries/aws-sdk-cpp/default.nix @@ -5,7 +5,14 @@ customMemoryManagement ? true }: -stdenv.mkDerivation rec { +let + loaderVar = + if stdenv.isLinux + then "LD_LIBRARY_PATH" + else if stdenv.isDarwin + then "DYLD_LIBRARY_PATH" + else throw "Unsupported system!"; +in stdenv.mkDerivation rec { name = "aws-sdk-cpp-${version}"; version = "1.0.48"; @@ -29,11 +36,12 @@ stdenv.mkDerivation rec { enableParallelBuilding = true; + # Behold the escaping nightmare below on loaderVar o.O 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 + export ${loaderVar}=$(pwd)/$i:''${${loaderVar}} done '';