diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2020-01-25 11:50:47 +0000 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2020-01-25 11:50:47 +0000 |
commit | d42200bec37eef2a7478d88988ff00addd0a9202 (patch) | |
tree | 10394660b3cbe4b50173c06950b31302cd25d0d1 /dev-java | |
parent | 580f05ea8f512d11e23e8da80177d27835cbdbbc (diff) |
gentoo resync : 25.01.2020
Diffstat (limited to 'dev-java')
-rw-r--r-- | dev-java/ant-core/ant-core-1.10.7-r1.ebuild | 110 | ||||
-rw-r--r-- | dev-java/ant-core/files/1.10.7-cmdline-args.patch | 135 | ||||
-rw-r--r-- | dev-java/openjdk-bin/openjdk-bin-11.0.6_p10.ebuild | 116 | ||||
-rw-r--r-- | dev-java/openjdk-bin/openjdk-bin-8.242_p08.ebuild | 91 | ||||
-rw-r--r-- | dev-java/openjdk-jre-bin/openjdk-jre-bin-8.242_p08.ebuild | 84 | ||||
-rw-r--r-- | dev-java/openjdk/openjdk-11.0.6.ebuild | 269 | ||||
-rw-r--r-- | dev-java/openjfx/openjfx-11.0.6_p2.ebuild | 219 |
7 files changed, 1024 insertions, 0 deletions
diff --git a/dev-java/ant-core/ant-core-1.10.7-r1.ebuild b/dev-java/ant-core/ant-core-1.10.7-r1.ebuild new file mode 100644 index 000000000000..64a382b259f4 --- /dev/null +++ b/dev-java/ant-core/ant-core-1.10.7-r1.ebuild @@ -0,0 +1,110 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +# Don't depend on itself. +JAVA_ANT_DISABLE_ANT_CORE_DEP="true" + +# Rewriting build.xml files for the testcases has no use at the moment. +JAVA_PKG_BSFIX_ALL="no" +JAVA_PKG_IUSE="doc source" + +inherit eutils java-pkg-2 java-ant-2 prefix + +MY_P="apache-ant-${PV}" + +DESCRIPTION="Java-based build tool similar to 'make' that uses XML configuration files" +HOMEPAGE="https://ant.apache.org/" +SRC_URI="https://archive.apache.org/dist/ant/source/${MY_P}-src.tar.bz2 + https://dev.gentoo.org/~fordfrog/distfiles/ant-${PV}-gentoo.tar.bz2" + +LICENSE="Apache-2.0" +SLOT="0" +KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~x86 ~ppc-aix ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris" + +CDEPEND=">=virtual/jdk-1.8:*" +DEPEND="${CDEPEND}" +RDEPEND="${CDEPEND}" + +S="${WORKDIR}/${MY_P}" + +RESTRICT="test" + +PATCHES=( + "${FILESDIR}/${PV}"-cmdline-args.patch + "${WORKDIR}/${PV}-build.patch" + "${WORKDIR}/${PV}-launch.patch" +) + +src_prepare() { + default + + eprefixify "${S}/src/script/ant" + + # Fixes bug 556008. + java-ant_xml-rewrite -f build.xml \ + -c -e javadoc \ + -a failonerror \ + -v "false" + + # See bug #196080 for more details. + java-ant_bsfix_one build.xml + java-pkg-2_src_prepare + + # Remove JDK9+ stuff + einfo "Removing JDK9+ classes (Jmod and Link)" + rm "${S}"/src/main/org/apache/tools/ant/taskdefs/modules/{Jmod,Link}.java +} + +src_compile() { + export ANT_HOME="" + # Avoid error message that package ant-core was not found + export ANT_TASKS="none" + + local bsyscp + + # This ensures that when building ant with bootstrapped ant, + # only the source is used for resolving references, and not + # the classes in bootstrapped ant but jikes in kaffe has issues with this... + if ! java-pkg_current-vm-matches kaffe; then + bsyscp="-Dbuild.sysclasspath=ignore" + fi + + CLASSPATH="$(java-config -t)" ./build.sh ${bsyscp} jars dist-internal \ + $(use_doc javadocs) || die "build failed" +} + +src_install() { + dodir /usr/share/ant/lib + + for jar in ant.jar ant-bootstrap.jar ant-launcher.jar ; do + java-pkg_dojar build/lib/${jar} + dosym ../../${PN}/lib/${jar} /usr/share/ant/lib/${jar} + done + + dobin src/script/ant + + dodir /usr/share/${PN}/bin + for each in antRun antRun.pl runant.pl runant.py ; do + dobin "${S}/src/script/${each}" + dosym ../../../bin/${each} /usr/share/${PN}/bin/${each} + done + dosym ../${PN}/bin /usr/share/ant/bin + + insinto /usr/share/${PN} + doins -r dist/etc + dosym ../${PN}/etc /usr/share/ant/etc + + echo "ANT_HOME=\"${EPREFIX}/usr/share/ant\"" > "${T}/20ant" + doenvd "${T}/20ant" + + dodoc NOTICE README WHATSNEW KEYS + + if use doc; then + dodoc -r manual/* + java-pkg_dojavadoc --symlink manual/api build/javadocs + fi + + use source && java-pkg_dosrc src/main/* +} diff --git a/dev-java/ant-core/files/1.10.7-cmdline-args.patch b/dev-java/ant-core/files/1.10.7-cmdline-args.patch new file mode 100644 index 000000000000..1be6f0bc5e79 --- /dev/null +++ b/dev-java/ant-core/files/1.10.7-cmdline-args.patch @@ -0,0 +1,135 @@ +From 729692d37a72c84998cfc65a6da6e078bbe0910a Mon Sep 17 00:00:00 2001 +From: sergiys <sergiys@amazon.com> +Date: Wed, 23 Oct 2019 13:24:19 -0700 +Subject: [PATCH] Fix regression introduced by commit "Use commandline argument + file for all options, but -J, for case javac" + +--- + .../ant/taskdefs/compilers/JavacExternal.java | 35 +++++++++------- + .../taskdefs/compilers/JavacExternalTest.java | 42 +++++++++++++++++++ + 2 files changed, 62 insertions(+), 15 deletions(-) + +diff --git a/src/main/org/apache/tools/ant/taskdefs/compilers/JavacExternal.java b/src/main/org/apache/tools/ant/taskdefs/compilers/JavacExternal.java +index 9569c7fe8f..637e9bdf6c 100644 +--- a/src/main/org/apache/tools/ant/taskdefs/compilers/JavacExternal.java ++++ b/src/main/org/apache/tools/ant/taskdefs/compilers/JavacExternal.java +@@ -66,7 +66,7 @@ public boolean execute() throws BuildException { + int firstFileName; + + if (assumeJava1_2Plus()) { +- firstFileName = moveJOptionsToBeginning(commandLine); ++ firstFileName = moveArgFileEligibleOptionsToEnd(commandLine); + } else { + firstFileName = -1; + } +@@ -77,31 +77,36 @@ public boolean execute() throws BuildException { + } + + /** +- * Moves all -J arguments to the beginning +- * So that all command line arguments could be written to file, but -J ++ * Moves all -J and @argfiles arguments to the beginning ++ * So that all command line arguments could be written to file, but -J and @argfile + * As per javac documentation: + * you can specify one or more files that contain arguments to the javac command (except -J options) + * @param commandLine command line to process +- * @return int index of first non -J argument ++ * @return int index of first argument that could be put into argfile + */ +- private int moveJOptionsToBeginning(String[] commandLine) { +- int nonJArgumentIdx = 1; // 0 for javac executable +- while(nonJArgumentIdx < commandLine.length && commandLine[nonJArgumentIdx].startsWith("-J")) { +- nonJArgumentIdx++; ++ private int moveArgFileEligibleOptionsToEnd(String[] commandLine) { ++ int nonArgFileOptionIdx = 1; // 0 for javac executable ++ while(nonArgFileOptionIdx < commandLine.length && ++ !isArgFileEligible(commandLine[nonArgFileOptionIdx])) { ++ nonArgFileOptionIdx++; + } + +- for(int i = nonJArgumentIdx + 1; i < commandLine.length; i++) { +- if (commandLine[i].startsWith("-J")) { +- String jArgument = commandLine[i]; +- for(int j = i - 1; j >= nonJArgumentIdx; j--) { ++ for(int i = nonArgFileOptionIdx + 1; i < commandLine.length; i++) { ++ if (!isArgFileEligible(commandLine[i])) { ++ String option = commandLine[i]; ++ for(int j = i - 1; j >= nonArgFileOptionIdx; j--) { + commandLine[j + 1] = commandLine[j]; + } +- commandLine[nonJArgumentIdx] = jArgument; +- nonJArgumentIdx++; ++ commandLine[nonArgFileOptionIdx] = option; ++ nonArgFileOptionIdx++; + } + } + +- return nonJArgumentIdx; ++ return nonArgFileOptionIdx; ++ } ++ ++ private static boolean isArgFileEligible(String option) { ++ return !(option.startsWith("-J") || option.startsWith("@")); + } + + /** +diff --git a/src/tests/junit/org/apache/tools/ant/taskdefs/compilers/JavacExternalTest.java b/src/tests/junit/org/apache/tools/ant/taskdefs/compilers/JavacExternalTest.java +index 53aac6377c..a893fb49c6 100644 +--- a/src/tests/junit/org/apache/tools/ant/taskdefs/compilers/JavacExternalTest.java ++++ b/src/tests/junit/org/apache/tools/ant/taskdefs/compilers/JavacExternalTest.java +@@ -28,6 +28,7 @@ + import java.io.File; + import java.io.IOException; + import java.util.Arrays; ++import java.util.stream.Stream; + + import static org.junit.Assert.assertEquals; + import static org.junit.Assert.assertTrue; +@@ -131,6 +132,47 @@ public void allJOptionsAreMovedToBeginning() throws Exception { + } + } + ++ @Test ++ public void argFileOptionIsMovedToBeginning() throws Exception { ++ final File workDir = createWorkDir("testSMC"); ++ try { ++ final File src = new File(workDir, "src"); ++ src.mkdir(); ++ createFile(src, "org/apache/ant/tests/J1.java"); ++ createFile(src, "org/apache/ant/tests/J2.java"); ++ final File modules = new File(workDir, "modules"); ++ modules.mkdir(); ++ final Project prj = new Project(); ++ prj.setBaseDir(workDir); ++ final Javac javac = new Javac(); ++ javac.setProject(prj); ++ final Commandline[] cmd = new Commandline[1]; ++ final TestJavacExternal impl = new TestJavacExternal(); ++ final Path srcPath = new Path(prj); ++ srcPath.setLocation(src); ++ javac.setSrcdir(srcPath); ++ javac.createModulepath().setLocation(modules); ++ javac.setSource("9"); ++ javac.setTarget("9"); ++ javac.setFork(true); ++ javac.setMemoryInitialSize("80m"); ++ javac.setExecutable("javacExecutable"); ++ javac.add(impl); ++ javac.createCompilerArg().setValue("-g"); ++ javac.createCompilerArg().setValue("@/home/my-compiler.args"); ++ javac.execute(); ++ assertEquals("javacExecutable", impl.getArgs()[0]); ++ assertEquals("-J-Xms80m", impl.getArgs()[1]); ++ assertEquals("@/home/my-compiler.args", impl.getArgs()[2]); ++ assertTrue(Stream.of(impl.getArgs()).anyMatch(x -> x.equals("-g"))); ++ assertTrue(impl.getArgs()[impl.getArgs().length - 2].endsWith("J1.java")); ++ assertTrue(impl.getArgs()[impl.getArgs().length - 1].endsWith("J2.java")); ++ assertEquals(3, impl.getFirstFileName()); ++ } finally { ++ delete(workDir); ++ } ++ } ++ + private File createWorkDir(String testName) { + final File tmp = new File(System.getProperty("java.io.tmpdir")); //NOI18N + final File destDir = new File(tmp, String.format("%s%s%d", diff --git a/dev-java/openjdk-bin/openjdk-bin-11.0.6_p10.ebuild b/dev-java/openjdk-bin/openjdk-bin-11.0.6_p10.ebuild new file mode 100644 index 000000000000..c629d40f4861 --- /dev/null +++ b/dev-java/openjdk-bin/openjdk-bin-11.0.6_p10.ebuild @@ -0,0 +1,116 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +inherit java-vm-2 + +abi_uri() { + echo "${2-$1}? ( + https://github.com/AdoptOpenJDK/openjdk${SLOT}-binaries/releases/download/jdk-${MY_PV}/OpenJDK${SLOT}U-jdk_${1}_linux_hotspot_${MY_PV//+/_}.tar.gz + )" +} + +MY_PV=${PV/_p/+} +SLOT=${MY_PV%%[.+]*} + +SRC_URI=" + $(abi_uri arm) + $(abi_uri aarch64 arm64) + $(abi_uri ppc64le ppc64) + $(abi_uri x64 amd64) +" + +DESCRIPTION="Prebuilt Java JDK binaries provided by AdoptOpenJDK" +HOMEPAGE="https://adoptopenjdk.net" +LICENSE="GPL-2-with-classpath-exception" +KEYWORDS="~amd64 ~arm ~arm64 ~ppc64" +IUSE="alsa cups doc examples +gentoo-vm headless-awt nsplugin selinux source webstart" + +RDEPEND=" + media-libs/fontconfig:1.0 + media-libs/freetype:2 + >=sys-apps/baselayout-java-0.1.0-r1 + >=sys-libs/glibc-2.2.5:* + sys-libs/zlib + alsa? ( media-libs/alsa-lib ) + cups? ( net-print/cups ) + doc? ( dev-java/java-sdk-docs:${SLOT} ) + selinux? ( sec-policy/selinux-java ) + !headless-awt? ( + x11-libs/libX11 + x11-libs/libXext + x11-libs/libXi + x11-libs/libXrender + x11-libs/libXtst + )" + +PDEPEND="webstart? ( >=dev-java/icedtea-web-1.6.1:0 ) + nsplugin? ( >=dev-java/icedtea-web-1.6.1:0[nsplugin] )" + +RESTRICT="preserve-libs splitdebug" +QA_PREBUILT="*" + +S="${WORKDIR}/jdk-${MY_PV}" + +pkg_pretend() { + if [[ "$(tc-is-softfloat)" != "no" ]]; then + die "These binaries require a hardfloat system." + fi +} + +src_install() { + local dest="/opt/${P}" + local ddest="${ED%/}/${dest#/}" + + # Not sure why they bundle this as it's commonly available and they + # only do so on x86_64. It's needed by libfontmanager.so. IcedTea + # also has an explicit dependency while Oracle seemingly dlopens it. + rm -vf lib/libfreetype.so || die + + # Oracle and IcedTea have libjsoundalsa.so depending on + # libasound.so.2 but AdoptOpenJDK only has libjsound.so. Weird. + if ! use alsa ; then + rm -v lib/libjsound.* || die + fi + + if ! use examples ; then + rm -vr demo/ || die + fi + + if use headless-awt ; then + rm -v lib/lib*{[jx]awt,splashscreen}* || die + fi + + if ! use source ; then + rm -v lib/src.zip || die + fi + + rm -v lib/security/cacerts || die + + dodir "${dest}" + cp -pPR * "${ddest}" || die + + dosym "${EPREFIX}"/etc/ssl/certs/java/cacerts "${dest}"/lib/security/cacerts + + use gentoo-vm && java-vm_install-env "${FILESDIR}"/${PN}-${SLOT}.env.sh + java-vm_set-pax-markings "${ddest}" + java-vm_revdep-mask + java-vm_sandbox-predict /dev/random /proc/self/coredump_filter +} + +pkg_postinst() { + java-vm-2_pkg_postinst + + if use gentoo-vm ; then + ewarn "WARNING! You have enabled the gentoo-vm USE flag, making this JDK" + ewarn "recognised by the system. This will almost certainly break" + ewarn "many java ebuilds as they are not ready for openjdk-11" + else + ewarn "The experimental gentoo-vm USE flag has not been enabled so this JDK" + ewarn "will not be recognised by the system. For example, simply calling" + ewarn "\"java\" will launch a different JVM. This is necessary until Gentoo" + ewarn "fully supports Java 11. This JDK must therefore be invoked using its" + ewarn "absolute location under ${EPREFIX}/opt/${P}." + fi +} diff --git a/dev-java/openjdk-bin/openjdk-bin-8.242_p08.ebuild b/dev-java/openjdk-bin/openjdk-bin-8.242_p08.ebuild new file mode 100644 index 000000000000..c3d90d685e65 --- /dev/null +++ b/dev-java/openjdk-bin/openjdk-bin-8.242_p08.ebuild @@ -0,0 +1,91 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +inherit eapi7-ver java-vm-2 + +abi_uri() { + echo "${2-$1}? ( + https://github.com/AdoptOpenJDK/openjdk${SLOT}-binaries/releases/download/jdk${MY_PV}/OpenJDK8U-jdk_${1}_linux_hotspot_${MY_PV/-/}.tar.gz + )" +} + +MY_PV=$(ver_rs 1 'u' 2 '-' ${PV//p/b}) +SLOT="$(ver_cut 1)" + +DESCRIPTION="Prebuilt Java JDK binaries provided by AdoptOpenJDK" +HOMEPAGE="https://adoptopenjdk.net" +SRC_URI=" + $(abi_uri ppc64le ppc64) + $(abi_uri x64 amd64) +" + +LICENSE="GPL-2-with-classpath-exception" +KEYWORDS="~amd64 ~ppc64" + +IUSE="alsa cups examples headless-awt nsplugin selinux source webstart" + +RDEPEND=" + media-libs/fontconfig:1.0 + media-libs/freetype:2 + >=sys-apps/baselayout-java-0.1.0-r1 + >=sys-libs/glibc-2.2.5:* + sys-libs/zlib + alsa? ( media-libs/alsa-lib ) + cups? ( net-print/cups ) + selinux? ( sec-policy/selinux-java ) + !headless-awt? ( + x11-libs/libX11 + x11-libs/libXext + x11-libs/libXi + x11-libs/libXrender + x11-libs/libXtst + )" + +PDEPEND="webstart? ( >=dev-java/icedtea-web-1.6.1:0 ) + nsplugin? ( >=dev-java/icedtea-web-1.6.1:0[nsplugin] )" + +RESTRICT="preserve-libs strip" +QA_PREBUILT="*" + +S="${WORKDIR}/jdk${MY_PV}" + +src_install() { + local dest="/opt/${P}" + local ddest="${ED%/}/${dest#/}" + + rm ASSEMBLY_EXCEPTION LICENSE THIRD_PARTY_README || die + + # this does not exist on arm64 hence -f + rm -fv jre/lib/*/libfreetype.so* || die + + if ! use alsa ; then + rm -v jre/lib/*/libjsoundalsa.so* || die + fi + + if ! use examples ; then + rm -vr sample || die + fi + + if use headless-awt ; then + rm -fvr {,jre/}lib/*/lib*{[jx]awt,splashscreen}* \ + {,jre/}bin/policytool bin/appletviewer || die + fi + + if ! use source ; then + rm -v src.zip || die + fi + + rm -v jre/lib/security/cacerts || die + + dodir "${dest}" + cp -pPR * "${ddest}" || die + + dosym "${EPREFIX}"/etc/ssl/certs/java/cacerts "${dest}"/jre/lib/security/cacerts + + java-vm_install-env "${FILESDIR}"/${PN}-${SLOT}.env.sh + java-vm_set-pax-markings "${ddest}" + java-vm_revdep-mask + java-vm_sandbox-predict /dev/random /proc/self/coredump_filter +} diff --git a/dev-java/openjdk-jre-bin/openjdk-jre-bin-8.242_p08.ebuild b/dev-java/openjdk-jre-bin/openjdk-jre-bin-8.242_p08.ebuild new file mode 100644 index 000000000000..c19496184b2c --- /dev/null +++ b/dev-java/openjdk-jre-bin/openjdk-jre-bin-8.242_p08.ebuild @@ -0,0 +1,84 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +inherit eapi7-ver java-vm-2 + +abi_uri() { + echo "${2-$1}? ( + https://github.com/AdoptOpenJDK/openjdk${SLOT}-binaries/releases/download/jdk${MY_PV}/OpenJDK8U-jre_${1}_linux_hotspot_${MY_PV/-/}.tar.gz + )" +} + +MY_PV=$(ver_rs 1 'u' 2 '-' ${PV//p/b}) +SLOT="$(ver_cut 1)" + +DESCRIPTION="Prebuilt Java JRE binaries provided by AdoptOpenJDK" +HOMEPAGE="https://adoptopenjdk.net" +SRC_URI=" + $(abi_uri x64 amd64) +" + +LICENSE="GPL-2-with-classpath-exception" +KEYWORDS="~amd64" + +IUSE="alsa cups headless-awt nsplugin selinux webstart" + +RDEPEND=" + media-libs/fontconfig:1.0 + media-libs/freetype:2 + >net-libs/libnet-1.1 + >=sys-apps/baselayout-java-0.1.0-r1 + >=sys-libs/glibc-2.2.5:* + sys-libs/zlib + alsa? ( media-libs/alsa-lib ) + cups? ( net-print/cups ) + selinux? ( sec-policy/selinux-java ) + !headless-awt? ( + x11-libs/libX11 + x11-libs/libXext + x11-libs/libXi + x11-libs/libXrender + x11-libs/libXtst + )" + +PDEPEND=" + webstart? ( >=dev-java/icedtea-web-1.6.1:0 ) + nsplugin? ( >=dev-java/icedtea-web-1.6.1:0[nsplugin] )" + +RESTRICT="preserve-libs splitdebug" +QA_PREBUILT="*" + +S="${WORKDIR}/jdk${MY_PV}-jre" + +src_install() { + local dest="/opt/${P}" + local ddest="${ED%/}/${dest#/}" + + rm ASSEMBLY_EXCEPTION LICENSE THIRD_PARTY_README || die + + # this does not exist on arm64 hence -f + rm -fv lib/*/libfreetype.so* || die + + if ! use alsa ; then + rm -v lib/*/libjsoundalsa.so* || die + fi + + if use headless-awt ; then + rm -fvr lib/*/lib*{[jx]awt,splashscreen}* \ + bin/policytool || die + fi + + rm -v lib/security/cacerts || die + + dodir "${dest}" + cp -pPR * "${ddest}" || die + + dosym "${EPREFIX}"/etc/ssl/certs/java/cacerts "${dest}"/lib/security/cacerts + + java-vm_install-env "${FILESDIR}"/${PN}-${SLOT}.env.sh + java-vm_set-pax-markings "${ddest}" + java-vm_revdep-mask + java-vm_sandbox-predict /dev/random /proc/self/coredump_filter +} diff --git a/dev-java/openjdk/openjdk-11.0.6.ebuild b/dev-java/openjdk/openjdk-11.0.6.ebuild new file mode 100644 index 000000000000..dc940a8919c6 --- /dev/null +++ b/dev-java/openjdk/openjdk-11.0.6.ebuild @@ -0,0 +1,269 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +inherit autotools check-reqs flag-o-matic java-pkg-2 java-vm-2 multiprocessing pax-utils toolchain-funcs + +MY_PV="${PV}-ga" +SLOT="${MY_PV%%[.+]*}" + +DESCRIPTION="Open source implementation of the Java programming language" +HOMEPAGE="https://openjdk.java.net" +SRC_URI="https://hg.${PN}.java.net/jdk-updates/jdk${SLOT}u/archive/jdk-${MY_PV}.tar.bz2 -> ${P}.tar.bz2" + +LICENSE="GPL-2" +KEYWORDS="~amd64 ~arm ~arm64 ~ppc64" + +IUSE="alsa cups debug doc examples gentoo-vm headless-awt javafx +jbootstrap nsplugin +pch selinux source systemtap webstart" + +COMMON_DEPEND=" + media-libs/freetype:2= + media-libs/giflib:0/7 + media-libs/libpng:0= + media-libs/lcms:2= + sys-libs/zlib + virtual/jpeg:0= + systemtap? ( dev-util/systemtap ) +" + +# Many libs are required to build, but not to run, make is possible to remove +# by listing conditionally in RDEPEND unconditionally in DEPEND +RDEPEND=" + ${COMMON_DEPEND} + >=sys-apps/baselayout-java-0.1.0-r1 + !headless-awt? ( + x11-libs/libX11 + x11-libs/libXext + x11-libs/libXi + x11-libs/libXrandr + x11-libs/libXrender + x11-libs/libXt + x11-libs/libXtst + ) + alsa? ( media-libs/alsa-lib ) + cups? ( net-print/cups ) + selinux? ( sec-policy/selinux-java ) +" + +DEPEND=" + ${COMMON_DEPEND} + app-arch/zip + media-libs/alsa-lib + net-print/cups + x11-base/xorg-proto + x11-libs/libX11 + x11-libs/libXext + x11-libs/libXi + x11-libs/libXrandr + x11-libs/libXrender + x11-libs/libXt + x11-libs/libXtst + javafx? ( dev-java/openjfx:${SLOT} ) + || ( + dev-java/openjdk-bin:${SLOT} + dev-java/openjdk:${SLOT} + ) +" + +PDEPEND=" + webstart? ( >=dev-java/icedtea-web-1.6.1:0 ) + nsplugin? ( >=dev-java/icedtea-web-1.6.1:0[nsplugin] ) +" + +REQUIRED_USE="javafx? ( alsa !headless-awt )" + +S="${WORKDIR}/jdk${SLOT}u-jdk-${MY_PV}" + +# The space required to build varies wildly depending on USE flags, +# ranging from 2GB to 16GB. This function is certainly not exact but +# should be close enough to be useful. +openjdk_check_requirements() { + local M + M=2048 + M=$(( $(usex jbootstrap 2 1) * $M )) + M=$(( $(usex debug 3 1) * $M )) + M=$(( $(usex doc 320 0) + $(usex source 128 0) + 192 + $M )) + + CHECKREQS_DISK_BUILD=${M}M check-reqs_pkg_${EBUILD_PHASE} +} + +pkg_pretend() { + openjdk_check_requirements + has ccache ${FEATURES} && die "FEATURES=ccache doesn't work with ${PN}" +} + +pkg_setup() { + openjdk_check_requirements + java-vm-2_pkg_setup + + JAVA_PKG_WANT_BUILD_VM="openjdk-${SLOT} openjdk-bin-${SLOT}" + JAVA_PKG_WANT_SOURCE="${SLOT}" + JAVA_PKG_WANT_TARGET="${SLOT}" + + # The nastiness below is necessary while the gentoo-vm USE flag is + # masked. First we call java-pkg-2_pkg_setup if it looks like the + # flag was unmasked against one of the possible build VMs. If not, + # we try finding one of them in their expected locations. This would + # have been slightly less messy if openjdk-bin had been installed to + # /opt/${PN}-${SLOT} or if there was a mechanism to install a VM env + # file but disable it so that it would not normally be selectable. + + local vm + for vm in ${JAVA_PKG_WANT_BUILD_VM}; do + if [[ -d ${EPREFIX}/usr/lib/jvm/${vm} ]]; then + java-pkg-2_pkg_setup + return + fi + done + + if has_version --host-root dev-java/openjdk:${SLOT}; then + export JDK_HOME=${EPREFIX}/usr/$(get_libdir)/openjdk-${SLOT} + else + if [[ ${MERGE_TYPE} != "binary" ]]; then + JDK_HOME=$(best_version --host-root dev-java/openjdk-bin:${SLOT}) + [[ -n ${JDK_HOME} ]] || die "Build VM not found!" + JDK_HOME=${JDK_HOME#*/} + JDK_HOME=${EPREFIX}/opt/${JDK_HOME%-r*} + export JDK_HOME + fi + fi +} + +src_prepare() { + default + chmod +x configure || die +} + +src_configure() { + # Work around stack alignment issue, bug #647954. in case we ever have x86 + use x86 && append-flags -mincoming-stack-boundary=2 + + # Enabling full docs appears to break doc building. If not + # explicitly disabled, the flag will get auto-enabled if pandoc and + # graphviz are detected. pandoc has loads of dependencies anyway. + + local myconf=( + --disable-ccache + --enable-full-docs=no + --with-boot-jdk="${JDK_HOME}" + --with-extra-cflags="${CFLAGS}" + --with-extra-cxxflags="${CXXFLAGS}" + --with-extra-ldflags="${LDFLAGS}" + --with-giflib=system + --with-lcms=system + --with-libjpeg=system + --with-libpng=system + --with-native-debug-symbols=$(usex debug internal none) + --with-vendor-name="Gentoo" + --with-vendor-url="https://gentoo.org" + --with-vendor-bug-url="https://bugs.gentoo.org" + --with-vendor-vm-bug-url="https://bugs.openjdk.java.net" + --with-vendor-version-string="${PV}" + --with-version-pre="" + --with-version-string=${MY_PV%+*} + --with-version-build=${MY_PV#*+} + --with-zlib=system + --enable-dtrace=$(usex systemtap yes no) + --enable-headless-only=$(usex headless-awt yes no) + ) + + if use javafx; then + local zip="${EROOT%/}/usr/$(get_libdir)/openjfx-${SLOT}/javafx-exports.zip" + if [[ -r ${zip} ]]; then + myconf+=( --with-import-modules="${zip}" ) + else + die "${zip} not found or not readable" + fi + fi + + # PaX breaks pch, bug #601016 + if use pch && ! host-is-pax; then + myconf+=( --enable-precompiled-headers ) + else + myconf+=( --disable-precompiled-headers ) + fi + + ( + unset _JAVA_OPTIONS JAVA JAVA_TOOL_OPTIONS JAVAC XARGS + CFLAGS= CXXFLAGS= LDFLAGS= \ + CONFIG_SITE=/dev/null \ + econf "${myconf[@]}" + ) +} + +src_compile() { + local myemakeargs=( + JOBS=$(makeopts_jobs) + LOG=debug + CFLAGS_WARNINGS_ARE_ERRORS= # No -Werror + $(usex doc docs '') + $(usex jbootstrap bootcycle-images product-images) + ) + emake "${myemakeargs[@]}" -j1 #nowarn +} + +src_install() { + local dest="/usr/$(get_libdir)/${PN}-${SLOT}" + local ddest="${ED}${dest#/}" + + cd "${S}"/build/*-release/images/jdk || die + + # Create files used as storage for system preferences. + mkdir .systemPrefs || die + touch .systemPrefs/.system.lock || die + touch .systemPrefs/.systemRootModFile || die + + # Oracle and IcedTea have libjsoundalsa.so depending on + # libasound.so.2 but OpenJDK only has libjsound.so. Weird. + if ! use alsa ; then + rm -v lib/libjsound.* || die + fi + + if ! use examples ; then + rm -vr demo/ || die + fi + + if ! use source ; then + rm -v lib/src.zip || die + fi + + rm -v lib/security/cacerts || die + + dodir "${dest}" + cp -pPR * "${ddest}" || die + + dosym "${EPREFIX}"/etc/ssl/certs/java/cacerts "${dest}"/lib/security/cacerts + + # must be done before running itself + java-vm_set-pax-markings "${ddest}" + + einfo "Creating the Class Data Sharing archives and disabling usage tracking" + "${ddest}/bin/java" -server -Xshare:dump -Djdk.disableLastUsageTracking || die + + use gentoo-vm && java-vm_install-env "${FILESDIR}"/${PN}-${SLOT}.env.sh + java-vm_revdep-mask + java-vm_sandbox-predict /dev/random /proc/self/coredump_filter + + if use doc ; then + docinto html + dodoc -r "${S}"/build/*-release/images/docs/* + dosym "${EPREFIX}"/usr/share/doc/"${PF}" /usr/share/doc/"${PN}-${SLOT}" + fi +} + +pkg_postinst() { + java-vm-2_pkg_postinst + + if use gentoo-vm ; then + ewarn "WARNING! You have enabled the gentoo-vm USE flag, making this JDK" + ewarn "recognised by the system. This will almost certainly break" + ewarn "many java ebuilds as they are not ready for openjdk-11" + else + ewarn "The experimental gentoo-vm USE flag has not been enabled so this JDK" + ewarn "will not be recognised by the system. For example, simply calling" + ewarn "\"java\" will launch a different JVM. This is necessary until Gentoo" + ewarn "fully supports Java ${SLOT}. This JDK must therefore be invoked using its" + ewarn "absolute location under ${EPREFIX}/usr/$(get_libdir)/${PN}-${SLOT}." + fi +} diff --git a/dev-java/openjfx/openjfx-11.0.6_p2.ebuild b/dev-java/openjfx/openjfx-11.0.6_p2.ebuild new file mode 100644 index 000000000000..e262aab4929a --- /dev/null +++ b/dev-java/openjfx/openjfx-11.0.6_p2.ebuild @@ -0,0 +1,219 @@ +# Copyright 2019-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +MY_PV=${PV/_p/+} +SLOT=${MY_PV%%[.+]*} +EGRADLE_VER="4.8" + +inherit java-pkg-2 multiprocessing + +DESCRIPTION="Java OpenJFX client application platform" +HOMEPAGE="https://openjfx.io" + +SRC_URI="https://hg.openjdk.java.net/${PN}/${SLOT}-dev/rt/archive/${MY_PV}.tar.bz2 -> ${P}.tar.bz2 + https://downloads.gradle.org/distributions/gradle-${EGRADLE_VER}-bin.zip + https://repo.maven.apache.org/maven2/org/apache/lucene/lucene-sandbox/7.1.0/lucene-sandbox-7.1.0.jar + https://repo.maven.apache.org/maven2/org/apache/lucene/lucene-grouping/7.1.0/lucene-grouping-7.1.0.jar + https://repo.maven.apache.org/maven2/org/apache/lucene/lucene-queryparser/7.1.0/lucene-queryparser-7.1.0.jar + https://repo.maven.apache.org/maven2/org/apache/lucene/lucene-queries/7.1.0/lucene-queries-7.1.0.jar + https://repo.maven.apache.org/maven2/org/apache/lucene/lucene-core/7.1.0/lucene-core-7.1.0.jar + https://repo.maven.apache.org/maven2/org/antlr/gunit/3.5.2/gunit-3.5.2.jar + https://repo1.maven.org/maven2/org/antlr/antlr4/4.7.2/antlr4-4.7.2-complete.jar + https://repo.maven.apache.org/maven2/org/antlr/ST4/4.0.8/ST4-4.0.8.jar +" + +LICENSE="GPL-2-with-classpath-exception" +SLOT="$(ver_cut 1)" +KEYWORDS="-* ~amd64" + +IUSE="cpu_flags_x86_sse2 debug doc source +media" + +RDEPEND=" + dev-java/swt:4.10[cairo,opengl] + dev-libs/atk + dev-libs/glib:2 + dev-libs/libxml2:2 + dev-libs/libxslt + media-libs/freetype:2 + media-libs/fontconfig:1.0 + media-video/ffmpeg:0= + x11-libs/gdk-pixbuf + x11-libs/gtk+:2 + x11-libs/gtk+:3 + x11-libs/cairo[glib] + x11-libs/libX11 + x11-libs/libXtst + x11-libs/libXxf86vm + x11-libs/pango + virtual/jpeg + virtual/opengl + || ( + dev-java/openjdk-bin:${SLOT}[doc?] + dev-java/openjdk:${SLOT}[doc?] + ) +" + +DEPEND="${RDEPEND} + app-arch/unzip + app-arch/zip + >=dev-java/ant-core-1.10.7-r1:0 + dev-java/antlr:0 + dev-java/antlr:3.5 + dev-java/hamcrest-core:0 + dev-java/stringtemplate:0 + virtual/ttf-fonts + virtual/pkgconfig +" + +REQUIRED_USE="cpu_flags_x86_sse2" + +PATCHES=( + "${FILESDIR}"/11/disable-buildSrc-tests.patch + "${FILESDIR}"/11/glibc-compatibility.patch + "${FILESDIR}"/11/respect-user-cflags.patch + "${FILESDIR}"/11/use-system-swt-jar.patch +) + +S="${WORKDIR}/rt-${MY_PV}" + +egradle() { + local GRADLE_HOME="${WORKDIR}/gradle-${EGRADLE_VER}" + local gradle="${GRADLE_HOME}/bin/gradle" + local gradle_args=( + --info + --stacktrace + --no-build-cache + --no-daemon + --offline + --gradle-user-home "${T}/gradle_user_home" + --project-cache-dir "${T}/gradle_project_cache" + ) + + export GRADLE_HOME + + # FIXME: build.gradle believes $ANT_HOME/bin/ant shoud exist + unset ANT_HOME + + einfo "gradle "${gradle_args[@]}" ${@}" + "${gradle}" "${gradle_args[@]}" ${@} || die "gradle failed" +} + +pkg_setup() { + JAVA_PKG_WANT_BUILD_VM="openjdk-${SLOT} openjdk-bin-${SLOT}" + JAVA_PKG_WANT_SOURCE="${SLOT}" + JAVA_PKG_WANT_TARGET="${SLOT}" + + # The nastiness below is necessary while the gentoo-vm USE flag is + # masked. First we call java-pkg-2_pkg_setup if it looks like the + # flag was unmasked against one of the possible build VMs. If not, + # we try finding one of them in their expected locations. This would + # have been slightly less messy if openjdk-bin had been installed to + # /opt/${PN}-${SLOT} or if there was a mechanism to install a VM env + # file but disable it so that it would not normally be selectable. + + local vm + for vm in ${JAVA_PKG_WANT_BUILD_VM}; do + if [[ -d ${EPREFIX}/usr/lib/jvm/${vm} ]]; then + java-pkg-2_pkg_setup + return + fi + done + + if has_version --host-root dev-java/openjdk:${SLOT}; then + export JAVA_HOME=${EPREFIX}/usr/$(get_libdir)/openjdk-${SLOT} + export JDK_HOME="${JAVA_HOME}" + export ANT_RESPECT_JAVA_HOME=ture + + else + if [[ ${MERGE_TYPE} != "binary" ]]; then + JDK_HOME=$(best_version --host-root dev-java/openjdk-bin:${SLOT}) + [[ -n ${JDK_HOME} ]] || die "Build VM not found!" + JDK_HOME=${JDK_HOME#*/} + JDK_HOME=${EPREFIX}/opt/${JDK_HOME%-r*} + export JDK_HOME + export JAVA_HOME="${JDK_HOME}" + export ANT_RESPECT_JAVA_HOME=ture + fi + fi +} + +src_unpack() { + unpack "${P}.tar.bz2" + unpack "gradle-${EGRADLE_VER}-bin.zip" + + mkdir "${T}/jars" || die + + local line jar + for line in ${SRC_URI}; do + if [[ ${line} =~ (http|https)://[a-zA-Z0-9.-_]*/(maven2|m2|eclipse)/(.*[.]jar)$ ]]; then + jar=$(basename "${BASH_REMATCH[-1]}") + cp -v "${DISTDIR}/${jar}" "${T}/jars/" || die + fi + done +} + +src_prepare() { + default + + local d="${T}/jars" + + java-pkg_jar-from --build-only --with-dependencies --into "${d}" antlr + java-pkg_jar-from --build-only --with-dependencies --into "${d}" antlr-3.5 + java-pkg_jar-from --build-only --with-dependencies --into "${d}" stringtemplate + java-pkg_jar-from --build-only --with-dependencies --into "${d}" hamcrest-core + + sed -i "s#__gentoo_swt_jar__#$(java-pkg_getjars swt-4.10)#" "${S}"/build.gradle || die +} + +src_configure() { + #FIXME: still calls gcc, pkg-config etc by name without chost prefix + #FIXME: should we enable webkit? doubt so + + # build is very sensetive to doc presense, take extra steps + if use doc; then + local jdk_doc + if has_version --host-root dev-java/openjdk:${SLOT}[doc]; then + jdk_doc="${EROOT%/}/usr/share/doc/openjdk-${SLOT}/html/api" + elif has_version --host-root dev-java/java-sdk-docs:${SLOT}; then + jdk_doc="${EROOT%/}/usr/share/doc/java-sdk-docs-${SLOT}/html/api" + fi + [[ -r ${jdk_doc}/element-list ]] || die "JDK Docs not found, terminating build early" + fi + + cat <<- _EOF_ > "${S}"/gradle.properties + COMPILE_TARGETS = linux + COMPILE_WEBKIT = false + COMPILE_MEDIA = $(usex media true false) + JDK_DOCS = https://docs.oracle.com/en/java/javase/${SLOT}/docs/api + JDK_DOCS_LINK = $(usex doc "${jdk_doc}" "") + BUILD_LIBAV_STUBS = false + GRADLE_VERSION_CHECK = false + LINT = none + CONF = $(usex debug DebugNative Release) + NUM_COMPILE_THREADS = $(makeopts_jobs) + JFX_DEPS_URL = ${T}/jars + COMPANY_NAME = "Gentoo" + _EOF_ +} + +src_compile() { + egradle zips $(usex doc "" "--exclude-task javadoc") +} + +src_install() { + if ! use source ; then + rm -v build/sdk/lib/src.zip || die + fi + + insinto "/usr/$(get_libdir)/${PN}-${SLOT}" + doins -r build/sdk/. + doins build/javafx-exports.zip + + if use doc; then + insinto /usr/share/doc/"${PF}"/html + doins -r build/javadoc/. + dosym "${EPREFIX}"/usr/share/doc/"${PF}" /usr/share/doc/"${PN}-${SLOT}" + fi +} |