summary refs log tree commit diff
path: root/pkgs/development/libraries/wtk/builder.sh
blob: ca5157c6d71ab1d9d0a3e79320961675925f01b7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
if [ -e "$NIX_ATTRS_SH_FILE" ]; then . "$NIX_ATTRS_SH_FILE"; elif [ -f .attrs.sh ]; then . .attrs.sh; fi
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" {} \;