SDL2: limit postFixup to the platforms supported by patchelf

This prevents future rebuilds on Darwin if this Linux-only postFixup changes.
This commit is contained in:
Orivej Desh 2018-06-10 22:23:33 +00:00
parent d1994ebd8a
commit 8d5570a041

View file

@ -78,7 +78,7 @@ stdenv.mkDerivation rec {
# You can grep SDL sources with `grep -rE 'SDL_(NAME|.*_SYM)'` to
# confirm that they actually use most of the `propagatedBuildInputs`
# from above in this way. This is pretty weird.
postFixup = ''
postFixup = optionalString (stdenv.hostPlatform.extensions.sharedLibrary == ".so") ''
for lib in $out/lib/*.so* ; do
if [[ -L "$lib" ]]; then
patchelf --set-rpath "$(patchelf --print-rpath $lib):${lib.makeLibraryPath propagatedBuildInputs}" "$lib"