@@ -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