@@ -121,9 +121,14 @@ stdenv.mkDerivation rec {
121121 find $ICAInstDir -type f -exec file {} \; |
122122 grep 'ELF.*executable' |
123123 cut -f 1 -d : |
124− xargs -t -n 1 patchelf \
125− --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \
126− --set-rpath "$ICAInstDir:$libPath"
124+ while read f
125+ do
126+ echo "Patching ELF intrepreter and rpath for $f"
127+ chmod u+w "$f"
128+ patchelf \
129+ --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \
130+ --set-rpath "$ICAInstDir:$libPath" "$f"
131+ done
127132
128133 echo "Wrapping wfica..."
129134 mkdir "$out/bin"