2012-08-24 13:30:48 +01:00
|
|
|
{ runCommand, openjdk, nukeReferences }:
|
2012-08-24 04:07:38 +01:00
|
|
|
|
2012-08-24 13:30:48 +01:00
|
|
|
runCommand "${openjdk.name}-bootstrap.tar.xz" {} ''
|
2015-06-07 05:55:09 +01:00
|
|
|
mkdir -pv openjdk-bootstrap/lib
|
|
|
|
|
|
|
|
# Do a deep copy of the openjdk
|
|
|
|
cp -vrL ${openjdk.home} openjdk-bootstrap/lib
|
|
|
|
|
|
|
|
# Includes are needed for building the native jvm
|
|
|
|
cp -vrL ${openjdk}/include openjdk-bootstrap
|
|
|
|
|
|
|
|
# The binaries are actually stored in the openjdk lib
|
|
|
|
ln -sv lib/openjdk/bin openjdk-bootstrap/bin
|
|
|
|
find . -name libjli.so
|
|
|
|
(cd openjdk-bootstrap/lib; find . -name libjli.so -exec ln -sfv {} libjli.so \;)
|
2012-08-24 13:30:48 +01:00
|
|
|
|
|
|
|
chmod -R +w openjdk-bootstrap
|
2015-06-07 05:55:09 +01:00
|
|
|
|
|
|
|
# Remove components we don't need
|
|
|
|
find openjdk-bootstrap -name \*.diz -exec rm {} \;
|
|
|
|
find openjdk-bootstrap -name \*.ttf -exec rm {} \;
|
|
|
|
find openjdk-bootstrap -name \*.gif -exec rm {} \;
|
|
|
|
find openjdk-bootstrap -name src.zip -exec rm {} \;
|
|
|
|
rm -rf openjdk-bootstrap/lib/openjdk/jre/bin
|
|
|
|
|
|
|
|
# Remove all of the references to the native nix store
|
2012-08-24 13:30:48 +01:00
|
|
|
find openjdk-bootstrap -print0 | xargs -0 ${nukeReferences}/bin/nuke-refs
|
|
|
|
|
2015-06-07 05:55:09 +01:00
|
|
|
# Create the output tarball
|
2012-08-24 13:30:48 +01:00
|
|
|
tar cv openjdk-bootstrap | xz > $out
|
2012-08-24 04:07:38 +01:00
|
|
|
''
|