From 8b11fb8fcbb6d03680edfaaef32463693bcb04b9 Mon Sep 17 00:00:00 2001 From: Peter Simons Date: Mon, 16 Dec 2013 21:20:49 +0100 Subject: [PATCH] pkgs/build-support/cabal: clean up the code that sets rpath for shared executables --- pkgs/build-support/cabal/default.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkgs/build-support/cabal/default.nix b/pkgs/build-support/cabal/default.nix index d99faf41f88..8984feac167 100644 --- a/pkgs/build-support/cabal/default.nix +++ b/pkgs/build-support/cabal/default.nix @@ -156,7 +156,7 @@ assert !enableStaticLibraries -> versionOlder "7.7" ghc.version; (optional (versionOlder "7" ghc.version) (enableFeature self.enableStaticLibraries "library-vanilla")) (optional (versionOlder "7.4" ghc.version) (enableFeature self.enableSharedExecutables "executable-dynamic")) (optional (versionOlder "7" ghc.version) (enableFeature self.doCheck "tests")) - ] ++ optional self.enableSharedExecutables "--ghc-option=-optl=-Wl,-rpath=$ORIGIN/../lib/${ghc.ghc.name}/${self.pname}-${self.version}"; + ]; # GHC needs the locale configured during the Haddock phase. LANG = "en_US.UTF-8"; @@ -187,6 +187,10 @@ assert !enableStaticLibraries -> versionOlder "7.7" ghc.version; done done + ${optionalString self.enableSharedExecutables '' + configureFlags+=" --ghc-option=-optl=-Wl,-rpath=$out/lib/${ghc.ghc.name}/${self.pname}-${self.version}"; + ''} + echo "configure flags: $extraConfigureFlags $configureFlags" ./Setup configure --verbose --prefix="$out" --libdir='$prefix/lib/$compiler' --libsubdir='$pkgid' $extraConfigureFlags $configureFlags