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