Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at fix-function-merge 60 lines 1.4 kB view raw
1source $stdenv/setup 2 3echo "Unpacking distribution" 4unzip ${src} || true 5 6# set the dynamic linker of unpack200, necessary for construct script 7echo "patching unpack200" 8patchelf --interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" --set-rpath "" */bin/unpack200 9 10echo "constructing JDK and JRE installations" 11if test -z "$installjdk"; then 12 sh ${construct} . tmp-linux-jdk tmp-linux-jre 13 mkdir -p $out 14 cp -R tmp-linux-jre/* $out 15else 16 sh ${construct} . $out tmp-linux-jre 17fi 18 19echo "removing files at top level of installation" 20for file in $out/* 21do 22 if test -f $file ; then 23 rm $file 24 fi 25done 26rm -rf $out/docs 27 28# construct the rpath 29rpath= 30for i in $libraries; do 31 rpath=$rpath${rpath:+:}$i/lib 32done 33 34if test -z "$installjdk"; then 35 jrePath=$out 36else 37 jrePath=$out/jre 38fi 39 40if test -n "$jce"; then 41 unzip $jce 42 cp -v jce/*.jar $jrePath/lib/security 43fi 44 45rpath=$rpath${rpath:+:}$jrePath/lib/$architecture/jli 46 47# set all the dynamic linkers 48find $out -type f -perm -0100 \ 49 -exec patchelf --interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \ 50 --set-rpath "$rpath" {} \; 51 52find $out -name "*.so" -exec patchelf --set-rpath "$rpath" {} \; 53 54if test -z "$pluginSupport"; then 55 rm -f $out/bin/javaws 56fi 57 58mkdir $jrePath/lib/$architecture/plugins 59ln -s $jrePath/lib/$architecture/libnpjp2.so $jrePath/lib/$architecture/plugins 60