graalvm8-ee: 19.2.1 -> 19.3.1, graalvm11-ee: init at 19.3.1 (#74010)
graalvm8-ee: 19.2.1 -> 19.3.1, graalvm11-ee: init at 19.3.1
This commit is contained in:
commit
d5086db3c0
@ -1,133 +1,167 @@
|
|||||||
{ stdenv, requireFile, perl, unzip, glibc, zlib, gdk-pixbuf, xorg, glib, fontconfig, freetype, cairo, pango, gtk3, gtk2, ffmpeg, libGL, atk, alsaLib, libav_0_8, setJavaClassPath }:
|
{ stdenv, requireFile, perl, unzip, glibc, zlib, bzip2, gdk-pixbuf, xorg, glib, fontconfig, freetype, cairo, pango, gtk3, gtk2, ffmpeg, libGL, atk, alsaLib, libav_0_8, setJavaClassPath }:
|
||||||
|
|
||||||
let
|
let
|
||||||
graalvm8-ee = stdenv.mkDerivation rec {
|
common = javaVersion:
|
||||||
pname = "graalvm8-ee";
|
let
|
||||||
version = "19.2.0";
|
graalvmXXX-ee = stdenv.mkDerivation rec {
|
||||||
srcs = [
|
pname = "graalvm${javaVersion}-ee";
|
||||||
(requireFile {
|
version = "19.3.1";
|
||||||
name = "graalvm-ee-linux-amd64-${version}.tar.gz";
|
srcs = [
|
||||||
sha256 = "1j56lyids48zyjhxk8xl4niy8hk6qzi1aj7c55yfh62id8v6cpbw";
|
(requireFile {
|
||||||
url = "https://www.oracle.com/technetwork/graalvm/downloads/index.html";
|
name = "graalvm-ee-java${javaVersion}-linux-amd64-${version}.tar.gz";
|
||||||
})
|
sha256 = { "8" = "b4833f1996e0e271d8abde1d0af3420e2bc6797624515a3720bdbedfa99b1e82";
|
||||||
(requireFile {
|
"11" = "a965abb093934712f31cd2183f3f0d68ed1410a50365489f665a30e5382908dc";
|
||||||
name = "native-image-installable-svm-svmee-linux-amd64-${version}.jar";
|
}.${javaVersion};
|
||||||
sha256 = "07c25l27msxccqrbz4bknz0sxsl0z2k8990cdfkbrgxvhxspfnnm";
|
url = "https://www.oracle.com/technetwork/graalvm/downloads/index.html";
|
||||||
url = "https://www.oracle.com/technetwork/graalvm/downloads/index.html";
|
})
|
||||||
})
|
(requireFile {
|
||||||
(requireFile {
|
name = "native-image-installable-svm-svmee-java${javaVersion}-linux-amd64-${version}.jar";
|
||||||
name = "python-installable-svm-svmee-linux-amd64-${version}.jar";
|
sha256 = { "8" = "fe3447dd60fbe3da39c650654594796873cd6bc9995d1430a421363e71d41702";
|
||||||
sha256 = "1c7kpz56w9p418li97ymixdwywscr85vhn7jkzxq71bj7ia7pxwz";
|
"11" = "53357b7facb36c7b38857a2369471d0e869c0ff45555aa8baf2ab84de0c4782c";
|
||||||
url = "https://www.oracle.com/technetwork/graalvm/downloads/index.html";
|
}.${javaVersion};
|
||||||
})
|
url = "https://www.oracle.com/technetwork/graalvm/downloads/index.html";
|
||||||
(requireFile {
|
})
|
||||||
name = "ruby-installable-svm-svmee-linux-amd64-${version}.jar";
|
(requireFile {
|
||||||
sha256 = "13jfm5qpxqxz7f5n9yyvqrv1vwigifrjwk3hssp23maski2ssys1";
|
name = "python-installable-svm-svmee-java${javaVersion}-linux-amd64-${version}.jar";
|
||||||
url = "https://www.oracle.com/technetwork/graalvm/downloads/index.html";
|
sha256 = { "8" = "003e9574e18656a82626aa5d310fac31979abc04955587d68ff977808829a91d";
|
||||||
})
|
"11" = "65558e14a25802001f3c79571a09170fa11564de34df6987724163416d3889bf";
|
||||||
];
|
}.${javaVersion};
|
||||||
nativeBuildInputs = [ unzip perl ];
|
url = "https://www.oracle.com/technetwork/graalvm/downloads/index.html";
|
||||||
unpackPhase = ''
|
})
|
||||||
unpack_jar() {
|
(requireFile {
|
||||||
jar=$1
|
name = "ruby-installable-svm-svmee-java${javaVersion}-linux-amd64-${version}.jar";
|
||||||
unzip $jar -d $out
|
sha256 = { "8" = "45abe74d10e09680f1e40101f93def5615e65f29ced328054a40c8517e054290";
|
||||||
perl -ne 'use File::Path qw(make_path);
|
"11" = "3d4de372b78b68dbd966b36489d1c6d84a326990e91a0314fb77404eed0741ad";
|
||||||
use File::Basename qw(dirname);
|
}.${javaVersion};
|
||||||
if (/^(.+) = (.+)$/) {
|
url = "https://www.oracle.com/technetwork/graalvm/downloads/index.html";
|
||||||
make_path dirname("$ENV{out}/$1");
|
})
|
||||||
system "ln -s $2 $ENV{out}/$1";
|
];
|
||||||
}' $out/META-INF/symlinks
|
nativeBuildInputs = [ unzip perl ];
|
||||||
perl -ne 'if (/^(.+) = ([r-])([w-])([x-])([r-])([w-])([x-])([r-])([w-])([x-])$/) {
|
unpackPhase = ''
|
||||||
my $mode = ($2 eq 'r' ? 0400 : 0) + ($3 eq 'w' ? 0200 : 0) + ($4 eq 'x' ? 0100 : 0) +
|
unpack_jar() {
|
||||||
($5 eq 'r' ? 0040 : 0) + ($6 eq 'w' ? 0020 : 0) + ($7 eq 'x' ? 0010 : 0) +
|
jar=$1
|
||||||
($8 eq 'r' ? 0004 : 0) + ($9 eq 'w' ? 0002 : 0) + ($10 eq 'x' ? 0001 : 0);
|
unzip $jar -d $out
|
||||||
chmod $mode, "$ENV{out}/$1";
|
perl -ne 'use File::Path qw(make_path);
|
||||||
}' $out/META-INF/permissions
|
use File::Basename qw(dirname);
|
||||||
rm -rf $out/META-INF
|
if (/^(.+) = (.+)$/) {
|
||||||
}
|
make_path dirname("$ENV{out}/$1");
|
||||||
|
system "ln -s $2 $ENV{out}/$1";
|
||||||
|
}' $out/META-INF/symlinks
|
||||||
|
perl -ne 'if (/^(.+) = ([r-])([w-])([x-])([r-])([w-])([x-])([r-])([w-])([x-])$/) {
|
||||||
|
my $mode = ($2 eq 'r' ? 0400 : 0) + ($3 eq 'w' ? 0200 : 0) + ($4 eq 'x' ? 0100 : 0) +
|
||||||
|
($5 eq 'r' ? 0040 : 0) + ($6 eq 'w' ? 0020 : 0) + ($7 eq 'x' ? 0010 : 0) +
|
||||||
|
($8 eq 'r' ? 0004 : 0) + ($9 eq 'w' ? 0002 : 0) + ($10 eq 'x' ? 0001 : 0);
|
||||||
|
chmod $mode, "$ENV{out}/$1";
|
||||||
|
}' $out/META-INF/permissions
|
||||||
|
rm -rf $out/META-INF
|
||||||
|
}
|
||||||
|
|
||||||
mkdir -p $out
|
mkdir -p $out
|
||||||
arr=($srcs)
|
arr=($srcs)
|
||||||
tar xf ''${arr[0]} -C $out --strip-components=1
|
tar xf ''${arr[0]} -C $out --strip-components=1
|
||||||
unpack_jar ''${arr[1]}
|
unpack_jar ''${arr[1]}
|
||||||
unpack_jar ''${arr[2]}
|
unpack_jar ''${arr[2]}
|
||||||
unpack_jar ''${arr[3]}
|
unpack_jar ''${arr[3]}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
installPhase = ''
|
installPhase = {
|
||||||
# BUG workaround http://mail.openjdk.java.net/pipermail/graal-dev/2017-December/005141.html
|
"8" = ''
|
||||||
substituteInPlace $out/jre/lib/security/java.security \
|
# BUG workaround http://mail.openjdk.java.net/pipermail/graal-dev/2017-December/005141.html
|
||||||
--replace file:/dev/random file:/dev/./urandom \
|
substituteInPlace $out/jre/lib/security/java.security \
|
||||||
--replace NativePRNGBlocking SHA1PRNG
|
--replace file:/dev/random file:/dev/./urandom \
|
||||||
|
--replace NativePRNGBlocking SHA1PRNG
|
||||||
|
|
||||||
# provide libraries needed for static compilation
|
# provide libraries needed for static compilation
|
||||||
for f in ${glibc}/lib/* ${glibc.static}/lib/* ${zlib.static}/lib/*; do
|
for f in ${glibc}/lib/* ${glibc.static}/lib/* ${zlib.static}/lib/*; do
|
||||||
ln -s $f $out/jre/lib/svm/clibraries/linux-amd64/$(basename $f)
|
ln -s $f $out/jre/lib/svm/clibraries/linux-amd64/$(basename $f)
|
||||||
done
|
done
|
||||||
'';
|
|
||||||
|
|
||||||
dontStrip = true;
|
# allow using external truffle-api.jar and languages not included in the distrubution
|
||||||
|
rm $out/jre/lib/jvmci/parentClassLoader.classpath
|
||||||
|
'';
|
||||||
|
"11" = ''
|
||||||
|
# BUG workaround http://mail.openjdk.java.net/pipermail/graal-dev/2017-December/005141.html
|
||||||
|
substituteInPlace $out/conf/security/java.security \
|
||||||
|
--replace file:/dev/random file:/dev/./urandom \
|
||||||
|
--replace NativePRNGBlocking SHA1PRNG
|
||||||
|
|
||||||
preFixup = ''
|
# provide libraries needed for static compilation
|
||||||
# Set JAVA_HOME automatically.
|
for f in ${glibc}/lib/* ${glibc.static}/lib/* ${zlib.static}/lib/*; do
|
||||||
mkdir -p $out/nix-support
|
ln -s $f $out/lib/svm/clibraries/linux-amd64/$(basename $f)
|
||||||
cat <<EOF > $out/nix-support/setup-hook
|
done
|
||||||
if [ -z "\''${JAVA_HOME-}" ]; then export JAVA_HOME=$out; fi
|
'';
|
||||||
EOF
|
}.${javaVersion};
|
||||||
'';
|
|
||||||
|
|
||||||
postFixup = ''
|
dontStrip = true;
|
||||||
rpath="$out/jre/lib/amd64/jli:$out/jre/lib/amd64/server:$out/jre/lib/amd64:${
|
|
||||||
stdenv.lib.strings.makeLibraryPath [ glibc xorg.libXxf86vm xorg.libX11 xorg.libXext xorg.libXtst xorg.libXi xorg.libXrender
|
|
||||||
glib zlib alsaLib fontconfig freetype pango gtk3 gtk2 cairo gdk-pixbuf atk ffmpeg libGL ]}"
|
|
||||||
|
|
||||||
for f in $(find $out -type f -perm -0100); do
|
# copy-paste openjdk's preFixup
|
||||||
patchelf --interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" "$f" || true
|
preFixup = ''
|
||||||
patchelf --set-rpath "$rpath" "$f" || true
|
# Set JAVA_HOME automatically.
|
||||||
done
|
mkdir -p $out/nix-support
|
||||||
|
cat <<EOF > $out/nix-support/setup-hook
|
||||||
|
if [ -z "\''${JAVA_HOME-}" ]; then export JAVA_HOME=$out; fi
|
||||||
|
EOF
|
||||||
|
'';
|
||||||
|
|
||||||
for f in $(find $out -type f -perm -0100); do
|
postFixup = ''
|
||||||
if ldd "$f" | fgrep 'not found'; then echo "in file $f"; fi
|
rpath="${ { "8" = "$out/jre/lib/amd64/jli:$out/jre/lib/amd64/server:$out/jre/lib/amd64";
|
||||||
done
|
"11" = "$out/lib/jli:$out/lib/server:$out/lib";
|
||||||
'';
|
}.${javaVersion}
|
||||||
|
}:${
|
||||||
|
stdenv.lib.strings.makeLibraryPath [ glibc xorg.libXxf86vm xorg.libX11 xorg.libXext xorg.libXtst xorg.libXi xorg.libXrender
|
||||||
|
glib zlib bzip2 alsaLib fontconfig freetype pango gtk3 gtk2 cairo gdk-pixbuf atk ffmpeg libGL ]}"
|
||||||
|
|
||||||
propagatedBuildInputs = [ setJavaClassPath zlib ]; # $out/bin/native-image needs zlib to build native executables
|
for f in $(find $out -type f -perm -0100); do
|
||||||
|
patchelf --interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" "$f" || true
|
||||||
|
patchelf --set-rpath "$rpath" "$f" || true
|
||||||
|
done
|
||||||
|
|
||||||
doInstallCheck = true;
|
for f in $(find $out -type f -perm -0100); do
|
||||||
installCheckPhase = ''
|
if ldd "$f" | fgrep 'not found'; then echo "in file $f"; fi
|
||||||
echo ${stdenv.lib.escapeShellArg ''
|
done
|
||||||
public class HelloWorld {
|
'';
|
||||||
public static void main(String[] args) {
|
|
||||||
System.out.println("Hello World");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
''} > HelloWorld.java
|
|
||||||
$out/bin/javac HelloWorld.java
|
|
||||||
|
|
||||||
# run on JVM with Graal Compiler
|
propagatedBuildInputs = [ setJavaClassPath zlib ]; # $out/bin/native-image needs zlib to build native executables
|
||||||
$out/bin/java -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -XX:+UseJVMCICompiler HelloWorld
|
|
||||||
$out/bin/java -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -XX:+UseJVMCICompiler HelloWorld | fgrep 'Hello World'
|
|
||||||
|
|
||||||
# Ahead-Of-Time compilation
|
doInstallCheck = true;
|
||||||
$out/bin/native-image --no-server HelloWorld
|
installCheckPhase = ''
|
||||||
./helloworld
|
echo ${stdenv.lib.escapeShellArg ''
|
||||||
./helloworld | fgrep 'Hello World'
|
public class HelloWorld {
|
||||||
|
public static void main(String[] args) {
|
||||||
|
System.out.println("Hello World");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
''} > HelloWorld.java
|
||||||
|
$out/bin/javac HelloWorld.java
|
||||||
|
|
||||||
# Ahead-Of-Time compilation with --static
|
# run on JVM with Graal Compiler
|
||||||
$out/bin/native-image --no-server --static HelloWorld
|
$out/bin/java -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -XX:+UseJVMCICompiler HelloWorld
|
||||||
./helloworld
|
$out/bin/java -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -XX:+UseJVMCICompiler HelloWorld | fgrep 'Hello World'
|
||||||
./helloworld | fgrep 'Hello World'
|
|
||||||
'';
|
|
||||||
|
|
||||||
passthru.home = graalvm8-ee;
|
# Ahead-Of-Time compilation
|
||||||
|
$out/bin/native-image --no-server HelloWorld
|
||||||
|
./helloworld
|
||||||
|
./helloworld | fgrep 'Hello World'
|
||||||
|
|
||||||
meta = with stdenv.lib; {
|
# Ahead-Of-Time compilation with --static
|
||||||
homepage = https://www.graalvm.org/;
|
$out/bin/native-image --no-server --static HelloWorld
|
||||||
description = "High-Performance Polyglot VM";
|
./helloworld
|
||||||
license = licenses.unfree;
|
./helloworld | fgrep 'Hello World'
|
||||||
maintainers = with maintainers; [ volth hlolli ];
|
'';
|
||||||
platforms = [ "x86_64-linux" ];
|
|
||||||
};
|
passthru.home = graalvmXXX-ee;
|
||||||
};
|
|
||||||
in
|
meta = with stdenv.lib; {
|
||||||
graalvm8-ee
|
homepage = https://www.graalvm.org/;
|
||||||
|
description = "High-Performance Polyglot VM";
|
||||||
|
license = licenses.unfree;
|
||||||
|
maintainers = with maintainers; [ volth hlolli ];
|
||||||
|
platforms = [ "x86_64-linux" ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
in
|
||||||
|
graalvmXXX-ee;
|
||||||
|
in {
|
||||||
|
graalvm8-ee = common "8";
|
||||||
|
graalvm11-ee = common "11";
|
||||||
|
}
|
||||||
|
@ -8456,7 +8456,9 @@ in
|
|||||||
|
|
||||||
inherit (callPackages ../development/compilers/graalvm { }) mx jvmci8 graalvm8;
|
inherit (callPackages ../development/compilers/graalvm { }) mx jvmci8 graalvm8;
|
||||||
|
|
||||||
graalvm8-ee = callPackage ../development/compilers/graalvm/enterprise-edition.nix { };
|
inherit (callPackages ../development/compilers/graalvm/enterprise-edition.nix { })
|
||||||
|
graalvm8-ee
|
||||||
|
graalvm11-ee;
|
||||||
|
|
||||||
openshot-qt = libsForQt5.callPackage ../applications/video/openshot-qt { };
|
openshot-qt = libsForQt5.callPackage ../applications/video/openshot-qt { };
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user