1if [ -e "$NIX_ATTRS_SH_FILE" ]; then . "$NIX_ATTRS_SH_FILE"; elif [ -f .attrs.sh ]; then . .attrs.sh; fi
2source $stdenv/setup
3
4mkdir unzipped
5pushd unzipped
6unzip $src || true
7popd
8
9mkdir -p $out
10mv unzipped/* $out/
11
12# Remove crap in the root directory.
13for file in $out/*
14do
15 if test -f $file ; then
16 rm $file
17 fi
18done
19
20# Set the dynamic linker.
21rpath=
22for i in $libraries; do
23 rpath=$rpath${rpath:+:}$i/lib
24done
25find $out -type f -perm -0100 \
26 -exec patchelf --interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" {} \;
27find $out -type f -perm -0100 \
28 -exec patchelf --set-rpath "$rpath" {} \;