git.iko.soy/typeable/nixpkgs
on master help sign in
openjdk7: Fix refernces to the bootstrap
commit240338638e064b786e85a549aa70cb9a5caabc29 authorWilliam A. Kennington III <william@wkennington.com> dateMon 8 Jun 2015, 13:56 (11 years ago) parentae6d056
1 file changed+26
pkgs/development/compilers/openjdk/default.nix+26
pkgs/development/compilers/openjdk/default.nix+26
@@ -203,6 +203,32 @@ let
203203 EOF
204204 '';
205205
206+ postFixup = ''
207+ # Build the set of output library directories to rpath against
208+ LIBDIRS=""
209+ for output in $outputs; do
210+ LIBDIRS="$(find $(eval echo \$$output) -name \*.so\* -exec dirname {} \; | sort | uniq | tr '\n' ':'):$LIBDIRS"
211+ done
212+
213+ # Add the local library paths to remove dependencies on the bootstrap
214+ for output in $outputs; do
215+ OUTPUTDIR="$(eval echo \$$output)"
216+ BINLIBS="$(find $OUTPUTDIR/bin/ -type f; find $OUTPUTDIR -name \*.so\*)"
217+ echo "$BINLIBS" | while read i; do
218+ patchelf --set-rpath "$LIBDIRS:$(patchelf --print-rpath "$i")" "$i" || true
219+ patchelf --shrink-rpath "$i" || true
220+ done
221+ done
222+
223+ # Test to make sure that we don't depend on the bootstrap
224+ for output in $outputs; do
225+ if grep -q -r '${bootjdk}' $(eval echo \$$output); then
226+ echo "Extraneous references to ${bootjdk} detected"
227+ exit 1
228+ fi
229+ done
230+ '';
231+
206232 meta = {
207233 homepage = http://openjdk.java.net/;
208234 license = stdenv.lib.licenses.gpl2;