git.iko.soy/typeable/nixpkgs
on master help sign in
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.

commitd34ee526a814a6231ec2d400d86fea6d26d450bd authorDan Peebles <pumpkin@me.com> dateThu 2 Feb 2017, 02:18 (10 years ago) parent6bb4e6d
1 file changed+10−2
pkgs/development/libraries/aws-sdk-cpp/default.nix+10−2
pkgs/development/libraries/aws-sdk-cpp/default.nix+10−2
@@ -5,7 +5,14 @@
55 customMemoryManagement ? true
66}:
77
8−stdenv.mkDerivation rec {
8+let
9+ loaderVar =
10+ if stdenv.isLinux
11+ then "LD_LIBRARY_PATH"
12+ else if stdenv.isDarwin
13+ then "DYLD_LIBRARY_PATH"
14+ else throw "Unsupported system!";
15+in stdenv.mkDerivation rec {
916 name = "aws-sdk-cpp-${version}";
1017 version = "1.0.48";
1118
@@ -29,11 +36,12 @@ stdenv.mkDerivation rec {
2936
3037 enableParallelBuilding = true;
3138
39+ # Behold the escaping nightmare below on loaderVar o.O
3240 preBuild =
3341 ''
3442 # Ensure that the unit tests can find the *.so files.
3543 for i in testing-resources aws-cpp-sdk-*; do
36− export LD_LIBRARY_PATH=$(pwd)/$i:$LD_LIBRARY_PATH
44+ export ${loaderVar}=$(pwd)/$i:''${${loaderVar}}
3745 done
3846 '';
3947