Skip to content

Commit

Permalink
aws-sdk-cpp: fix on darwin
Browse files Browse the repository at this point in the history
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.

(cherry picked from commit d34ee52)
  • Loading branch information
copumpkin authored and shlevy committed Mar 5, 2017
1 parent 2482e8c commit 2d6a82a
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions pkgs/development/libraries/aws-sdk-cpp/default.nix
Expand Up @@ -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";

Expand All @@ -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
'';

Expand Down

0 comments on commit 2d6a82a

Please sign in to comment.