summary refs log tree commit diff
path: root/pkgs/development/compilers/jdk/builder.sh
blob: ccfe2838d1b6594bd86e70d6e9b801c18446b7c4 (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
29
30
31
32
33
34
buildInputs="$unzip"
source $stdenv/setup

unzip $src || true

mkdir -p $out
mv $dirname/* $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 +100 \
    -exec patchelf --interpreter "$(cat $NIX_GCC/nix-support/dynamic-linker)" \
    --set-rpath "$rpath" {} \;

# Unpack .pack files.
for i in $(find $out -name "*.pack"); do
    echo "unpacking $i..."
    $out/bin/unpack200 "$i" "$(dirname $i)/$(basename $i .pack).jar"
    rm "$i"
done

# Put the *_md.h files in the right place.
cd $out/include && ln -s */*_md.h .