3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/development/libraries/wtk/builder.sh
Vladimír Čunát 8f33b8cc93 mass rewrite of find parameters to cross-platform style
Fixes #9044, close #9667. Thanks to @taku0 for suggesting this solution.
Now we have no modes starting with `/` or `+`.

Rewrite the `-perm` parameters of find:
 - completely safe: rewrite `/0100` and `+100` to `-0100`,
 - slightly semantics-changing: rewrite `+111` to `-0100`.
I cross-verified the `find` manual pages for Linux, Darwin, FreeBSD.
2015-09-06 10:26:30 +02:00

28 lines
510 B
Bash

source $stdenv/setup
mkdir unzipped
pushd unzipped
unzip $src || true
popd
mkdir -p $out
mv unzipped/* $out/
# Remove crap in the root directory.
for file in $out/*
do
if test -f $file ; then
rm $file
fi
done
# Set the dynamic linker.
rpath=
for i in $libraries; do
rpath=$rpath${rpath:+:}$i/lib
done
find $out -type f -perm -0100 \
-exec patchelf --interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" {} \;
find $out -type f -perm -0100 \
-exec patchelf --set-rpath "$rpath" {} \;