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.
  • Loading branch information
copumpkin committed Feb 2, 2017
1 parent 6bb4e6d commit d34ee52
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

1 comment on commit d34ee52

@copumpkin
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI @edolstra (the build was broken on darwin)

Please sign in to comment.