diff options
author | V3n3RiX <venerix@koprulu.sector> | 2024-03-06 19:06:26 +0000 |
---|---|---|
committer | V3n3RiX <venerix@koprulu.sector> | 2024-03-06 19:06:26 +0000 |
commit | f8f68d6f93dd8510c09261f47d4f64cadf303815 (patch) | |
tree | 2d317143f2696b93a06c8d26452ea901a1f2fd74 /dev-java/openjfx | |
parent | 0113c4c9eb49e26aee006787c9564c1165909926 (diff) |
gentoo auto-resync : 06:03:2024 - 19:06:26
Diffstat (limited to 'dev-java/openjfx')
-rw-r--r-- | dev-java/openjfx/Manifest | 6 | ||||
-rw-r--r-- | dev-java/openjfx/files/11/0001-c99.patch | 22 | ||||
-rw-r--r-- | dev-java/openjfx/files/11/0002-c99.patch | 18 | ||||
-rw-r--r-- | dev-java/openjfx/files/11/0003-c99.patch | 19 | ||||
-rw-r--r-- | dev-java/openjfx/files/11/respect-cc.patch | 15 | ||||
-rw-r--r-- | dev-java/openjfx/files/11/strip-blank-elements-flags.patch | 29 | ||||
-rw-r--r-- | dev-java/openjfx/openjfx-11.0.11_p1-r2.ebuild | 231 |
7 files changed, 340 insertions, 0 deletions
diff --git a/dev-java/openjfx/Manifest b/dev-java/openjfx/Manifest index cd75f36779fe..213e5b13a629 100644 --- a/dev-java/openjfx/Manifest +++ b/dev-java/openjfx/Manifest @@ -1,3 +1,6 @@ +AUX 11/0001-c99.patch 940 BLAKE2B a7373ca3c6348ae0d179842995f6a753c2c4c4cea2f99504dbc82d3676f276e0de89aab72d1d40b1978ff318966a12ecaafb186b0b974c3116522b82733481ad SHA512 8b95a6a49e72f1885f70cd520422092151b0776303b12d0dd6f6ff91acf849e3d7d28f78ab5af53dcea83f6dd93c06b1382d25b402dd7c51bcff6581b10783c1 +AUX 11/0002-c99.patch 733 BLAKE2B c45e98d374f34a705997bea00bf947e3ff1d78c425f69883e4f42508b1f612f87e6ed97be164573ab3d1063faf4a4f911faa45843614449a34de0b3674338b47 SHA512 c25521cb97982034c0cbb3f82e3e7a0ce5ff189a611f4d5cb9a4fb38fb002621cc982534e972804356886256860feffca0ed0c689c1d713a75ac0d5b9e17c513 +AUX 11/0003-c99.patch 876 BLAKE2B 259143a4c4783caab50ff07174079f65cab5a42c1595d27d1f021483fcb8f1b70d7ad6287acc05d86be344498b5470f6aec6632e24696b453b87000366fa646a SHA512 911f019a62be6c419787b9c5e5bf709778c1cda6d0f747948e1e0bb5e251d4ea141cea525ffe37942dcb31e5e0ebbc0d9651ab4eb6219055fe90d162db9ed546 AUX 11/11.0.9_p0-version.patch 691 BLAKE2B 33cfcd3c615e9dec14e2df985b48dc85b895d12ff127ffc3df08b670ad1bcc3790efec63c68b639288c44f7cf5da8dcb2de72195df24c049692df109b20e42ac SHA512 472bb5debb929d4191b2dc2bd0b2e2370f3c93671e581fe42616e4ed6fc3e4a34638a90f04ed756acb5e10d404694267cd861ecf698c7c926cd4c6fe6d6fe8ba AUX 11/disable-architecture-verification.patch 1288 BLAKE2B 2c228eedfbc9b8642d26c7b92580172b83d492735bd59301fc2506f4a2ab77c002220d728fb2fa57e251c760e77cc224c54e831b15a594186750138336b78c3c SHA512 6d66b16833c61532521666d888cfb1a495c9f2b6bda87e0519ecb907b0c1bb99a267cb059a4ed8428edeb44a34ae6bcfac0c7ca6bd880ba6f08161e851e36252 AUX 11/disable-buildSrc-tests.patch 534 BLAKE2B d1cb4da89602fa9a48e5509586d1909d10b9d62e167bdd4d57b9615f2896704dd0ee925d14a86753bf53182f85fc9c21f195c3f044a0c6d38c960ee4f5494332 SHA512 ffbc3d671cea448ffddd8d92e4a4031a941008c067d5a7acb358fb82ed217c9388ef1916aa04cf4693ff2a83e0bdcf3fc5bdc919196a6231d57c8341e44ddede @@ -6,8 +9,10 @@ AUX 11/don-t-force-msse.patch 4621 BLAKE2B e715f5e8a7aa9c7e6637baa4e90169e0cd63e AUX 11/ffmpeg5.patch 840 BLAKE2B 957f1ee06f9cae7de78e68f45051653f3b91d7c5e36d9b94de399db2ff94037457d9e163840bac9a4e896a54b25e508ad2a946658a64647ec1afac3778fbbcb7 SHA512 bd9346c84f8e42c16bd3d9dd9afa8e70a5d94056ca7127421869de41acd81be5ebb5603810cf8738008b9b4f9459e6c7cc057c905ced14b650f77905a302a442 AUX 11/glibc-compatibility.patch 547 BLAKE2B e63e83d708765dc7ad5013ff3a5bf0885fa426290e4fa164684739c15e7c15652c41256b98e9720c35682193086ec19c0225dd202fabc9bd9c9f99fb0fd6d5ff SHA512 abb08198b94e38fe8fb16229f506e2cad78869ed9c4fcabe22490a87884b1851373ee4a92ae4d7dbecaf3fc9a784911d932fad2457b0611a102e63a983113981 AUX 11/gstreamer-CVE-2021-3522.patch 1347 BLAKE2B 90684659ce6e199c599cc287c02cafecb8311d4c0d7c926bdb8a7cd8b725053225013dcdd3fd3cbd2d12ea99a8f810af041f48320df2eac8c74ed1f253b9deb2 SHA512 5d29de9cc019c1b74e17a9885e9742b110ef7b7b8d866a4d42556b434316c030dd235bc276e132ed621bfb67fbcf299a113a5b95eb71b57565bdb1cc4c5338f2 +AUX 11/respect-cc.patch 638 BLAKE2B 30aac53bc44a2ffe63f8cd425156baabd7c115c1752b55acf16632e668b7511161ae05b6a3732c2626f037652de0f8cef60084e11a692b651bd77007be70e05a SHA512 df30ee8b5f2b930c8cecb66ccec742da5d9114645929d5522f9f540eeddbc784b73513cd8da820f3b6c4e81282b9692b654d9c0b284c6f507a787885b9d8f132 AUX 11/respect-user-cflags-11.0.11.patch 8591 BLAKE2B 918563c92d309da47c61198a4349f97f1b44213b6776478f930d824ec9d54e93edb6b98fd8e135c7d9d1e18aa6352afcd741a3b73ba811f1a0976c448746d2e4 SHA512 ded33c5b41f076afd771eb88019525126dea7ab182f98dd05e58aa6802d1eb9fced712c5165d0b3b50bd3770e952cc1db3403693f16d68d0af091ce96e351baa AUX 11/respect-user-cflags.patch 8609 BLAKE2B 865e8c2b10cc24c7ce45a4d6b039a1e852902f702fee06102273565f22ed870391f5f072c59db51fa48077516a8072b41252fdce961cde20581d8f520eb67afe SHA512 ab77752add6fe7b708d7e7eb94cad722b6016d50bc3ba40505107db0e70e642dfd7d48550cba344ee2e88bf2ea7f55d58140f5eeb7b025c112b87be0ce71e74c +AUX 11/strip-blank-elements-flags.patch 1016 BLAKE2B ca9d4a8c471469943878e00f2989bc143ceafc88f3c0173444199cd5d873ecb1a0ed1ea415c2ea910d3a6ee9eed5232ec0722009c5c94c75793490e35ab11509 SHA512 ad8b87c56e9b782db4b72d47e7a900278b991b1facb4926bd4b951d6237b47476ac1552e5a0f52084ac2f6f5175b687130bc6ed9ada70cee18b52f56042b6b28 AUX 11/use-system-swt-jar.patch 608 BLAKE2B b0083c54f5f42e6c0069812913c800c9366073e34a401187e90c498ee9cb67b619baa87b7d140cda5a1330076c3b04ff3114898cd264cd51ec4b99498acfd894 SHA512 a700c33639603a26d21b89a4f8a9299cdf42cf7f7a0dc082ec9cd4c9c2235184add1685b05d2a62f3a52bd2251b4c133476e5944471092a2c0c269c973d2604f AUX 11/wno-error-11.0.11.patch 1974 BLAKE2B 67172eaee34729fbc90e3eba1a9aee421ffdaa60411a6a8f86f8a7fa08969cfef3119f70eb2f69a5c2340716f5f46e9b323b708756358d5a705a17b7ff16ba63 SHA512 3ecfbf76a6dc58c2075b31bab259e17e835395f34895c779b6d70efc9348243de55731ae29fccf4c4312dc331f4b4de76088591ee5d090023954f90bb55c35a6 AUX 11/wno-error.patch 1894 BLAKE2B 8b4380c97942cc542164ab1673eb4e5701ae17aab7b6673c3b01518fdce91d2daac1e52dd5d7dad09b619093d0b4a153f0aadf060c32ffab19428ab2f307661c SHA512 0d808836b0f52e911ea6172b3c573cfea84035611ce797da7cf58b5eaa51d8c4ef536eb21d3a0c2139311e3c7ba702f13dc96b9e1d3b6cefaaca88188e409f3b @@ -38,6 +43,7 @@ DIST openjfx-11.0.9_p0.tar.bz2 64148934 BLAKE2B 317fb1c9ea99816ecbd8ab64ed3a6ad0 DIST openjfx-8.1000-backports.tar.bz2 9142182 BLAKE2B 58ea420ec015c49d2755105a3d11675a92ecab337c7bda5a1ad72e84d0b35f04ed4252cee24da89b1e7b1b5b8b8b9fea7db93364434800246b87827b21970cc3 SHA512 077392368947cb9da1b5c7e14b641d6edcddd9821eb4f16dbea33e8986568211e93799aca29e70b490c8ef2125d69f8372abd1b1ce428a95420f62ff15c414d6 DIST openjfx-8.1000.tar.bz2 62286455 BLAKE2B c9a714a618d9ae02768dae6128756d64b2b6299a36a6ad9828bf2213dc641cbbcaa2d3f3e0b4913bb60893419a2d5c730ca2db88f759bbd94b3e83112199278c SHA512 6049730b72e569939fed3d62b46a409e949b4c2309f4355253c8c891799c7fb5138e20aa217454fbbd78b1dd99c254b34b3fe6c9cbb35854bd8656993655bf32 EBUILD openjfx-11.0.11_p1-r1.ebuild 6572 BLAKE2B 0ef177a2b7de0722455433cc89535bc9a0f5c25be7260488e6e08859f375ade524b56469881b15cdb4a8359b5b23b2eef0b526c0a28b25ed04d7d67a29153f86 SHA512 65827cc97c0b6c56a7e4e186321542229bf9de5ff673309beb2ee7b4d37e004b07628eb0bdd251f9b8eee4f70e15eaec3b0a7724c3dfe47ab03372d4a9eb22ce +EBUILD openjfx-11.0.11_p1-r2.ebuild 6817 BLAKE2B eb20b117c350362f8b89e41cbf326bbcbbdb2723bcecc01b8a86ad30f62ba7445222e59d75263699a01ca157eeb0c161e331b5a38222f9632f65185c84024d16 SHA512 30119277d9a64d68e7e25cb0a7117ca638263f356b0f98f7d08142d31551137e5a665b88709477f6cc3d046fbab7253dfc875c387121edfd15c7f41430006082 EBUILD openjfx-11.0.9_p0-r1.ebuild 6538 BLAKE2B 06a23d77d9190f339d4d52f918328c2d8cbfc6d113e06f700110fe0a04b305e913fe2557cb3efadacbeddc7ba69fa05f87c3198d05065e50c6d48cacf637bfed SHA512 a7b77c4f065a121b22874eb613e101d3708037776b85134ba411f07c25c1c160e7b0d55b057676e94e11f70a89944dc8587c2a1f453c1a32f1699b951fc12ee3 EBUILD openjfx-8.1000-r2.ebuild 5582 BLAKE2B 0071331e7290b18814249581f7733a01f5ce312656e623da110c7774db335f7a09178c6cbb46c5102a35545e3e890d6b98937c9ba552f2845fa0d86990d3daa6 SHA512 4af920664da56da987c1a031b6797817e9432a7d717245c9669fd3a63bf92a3f0b0b56b96394dc7ded612dfacdb8fc1c5d1df082152e75fd179ca7f5961e7c49 MISC metadata.xml 567 BLAKE2B d892bbd4cccfad57f17203e63e0cde8b8b8ccdda71de101f0fbd4fdf95a2490e43a7e50bac91a69956f125712b6af9d4a9f5bd586ad968af0d6586f5b6f4b6c8 SHA512 5884a9a487485c39816b58552e8b39c10474a3aebb0929845b3940d228a7d41080cc0515521d11b88533fcb34f94fef2742a9e39787146d02e46a9b594102912 diff --git a/dev-java/openjfx/files/11/0001-c99.patch b/dev-java/openjfx/files/11/0001-c99.patch new file mode 100644 index 000000000000..f553d2858801 --- /dev/null +++ b/dev-java/openjfx/files/11/0001-c99.patch @@ -0,0 +1,22 @@ +https://bugs.gentoo.org/919413 +https://src.fedoraproject.org/rpms/openjfx/c/9e893037f3a20273c79603220b7a18a44be60fcc?branch=rawhide + +commit 42321838b98d2ebb3d8384c88a764ff2b4d70581 +Author: Florian Weimer <fweimer@openjdk.org> +Date: Fri Jun 16 12:19:10 2023 +0000 + + 8307542: Call to FcConfigAppFontAddFile uses wrong prototype, arguments + + Reviewed-by: kcr + +--- a/modules/javafx.graphics/src/main/native-font/pango.c ++++ b/modules/javafx.graphics/src/main/native-font/pango.c +@@ -243,7 +243,7 @@ JNIEXPORT jboolean JNICALL OS_NATIVE(FcConfigAppFontAddFile) + if (text) { + // rc = (jboolean)FcConfigAppFontAddFile(arg0, text); + if (fp) { +- rc = (jboolean)((jboolean (*)(void *, const char *))fp)(arg0, text); ++ rc = (jboolean)((int (*)(void *, const char *))fp)((void *)arg0, text); + } + (*env)->ReleaseStringUTFChars(env, arg1, text); + } diff --git a/dev-java/openjfx/files/11/0002-c99.patch b/dev-java/openjfx/files/11/0002-c99.patch new file mode 100644 index 000000000000..4cdc5ed35e50 --- /dev/null +++ b/dev-java/openjfx/files/11/0002-c99.patch @@ -0,0 +1,18 @@ +https://bugs.gentoo.org/919413 +https://src.fedoraproject.org/rpms/openjfx/c/9e893037f3a20273c79603220b7a18a44be60fcc?branch=rawhide + +8323078: Incorrect length argument to g_utf8_strlen in pango.c + +Submitted upstream: <https://github.com/openjdk/jfx/pull/1320> + +--- a/modules/javafx.graphics/src/main/native-font/pango.c ++++ b/modules/javafx.graphics/src/main/native-font/pango.c +@@ -402,7 +402,7 @@ JNIEXPORT jlong JNICALL OS_NATIVE(g_1utf8_1strlen) + (JNIEnv *env, jclass that, jlong str, jlong pos) + { + if (!str) return 0; +- return (jlong)g_utf8_strlen((const gchar *)str, (const gchar *)pos); ++ return (jlong)g_utf8_strlen((const gchar *)str, (gssize)pos); + } + + JNIEXPORT jlong JNICALL OS_NATIVE(g_1utf16_1to_1utf8) diff --git a/dev-java/openjfx/files/11/0003-c99.patch b/dev-java/openjfx/files/11/0003-c99.patch new file mode 100644 index 000000000000..8779f882b799 --- /dev/null +++ b/dev-java/openjfx/files/11/0003-c99.patch @@ -0,0 +1,19 @@ +https://bugs.gentoo.org/919413 +https://src.fedoraproject.org/rpms/openjfx/c/9e893037f3a20273c79603220b7a18a44be60fcc?branch=rawhide + +8323077: C type error (incompatible function pointer) in X11GLContext.c + +Submitted upstream: <https://github.com/openjdk/jfx/pull/1319> + +--- a/modules/javafx.graphics/src/main/native-prism-es2/x11/X11GLContext.c ++++ b/modules/javafx.graphics/src/main/native-prism-es2/x11/X11GLContext.c +@@ -275,7 +275,8 @@ JNIEXPORT jlong JNICALL Java_com_sun_prism_es2_X11GLContext_nInitialize + dlsym(RTLD_DEFAULT, "glXSwapIntervalSGI"); + + if (ctxInfo->glXSwapIntervalSGI == NULL) { +- ctxInfo->glXSwapIntervalSGI = glXGetProcAddress("glXSwapIntervalSGI"); ++ ctxInfo->glXSwapIntervalSGI = (PFNGLXSWAPINTERVALSGIPROC) ++ glXGetProcAddress((const GLubyte *)"glXSwapIntervalSGI"); + } + + } diff --git a/dev-java/openjfx/files/11/respect-cc.patch b/dev-java/openjfx/files/11/respect-cc.patch new file mode 100644 index 000000000000..85b742f3a630 --- /dev/null +++ b/dev-java/openjfx/files/11/respect-cc.patch @@ -0,0 +1,15 @@ +diff --git a/buildSrc/linux.gradle b/buildSrc/linux.gradle +index 2295566..ce54c3f 100644 +--- a/buildSrc/linux.gradle ++++ b/buildSrc/linux.gradle +@@ -214,8 +214,8 @@ setupTools("linux_freetype_tools", + } + ) + +-def compiler = IS_COMPILE_PARFAIT ? "parfait-gcc" : "${toolchainDir}gcc"; +-def linker = IS_STATIC_BUILD ? "ar" : IS_COMPILE_PARFAIT ? "parfait-g++" : "${toolchainDir}g++"; ++def compiler = IS_COMPILE_PARFAIT ? "parfait-gcc" : System.getenv("CC"); ++def linker = IS_STATIC_BUILD ? "ar" : IS_COMPILE_PARFAIT ? "parfait-g++" : System.getenv("CXX"); + + LINUX.glass = [:] + LINUX.glass.variants = ["glass", "glassgtk2", "glassgtk3"] diff --git a/dev-java/openjfx/files/11/strip-blank-elements-flags.patch b/dev-java/openjfx/files/11/strip-blank-elements-flags.patch new file mode 100644 index 000000000000..87f0279979f7 --- /dev/null +++ b/dev-java/openjfx/files/11/strip-blank-elements-flags.patch @@ -0,0 +1,29 @@ +Without this, you'll get bizarre errors where linking fails because it looks for +a literal "" arg. + +https://bugs.gentoo.org/715092 +https://bugs.gentoo.org/719484 +https://bugs.gentoo.org/799227 +https://bugs.gentoo.org/915727 +--- a/buildSrc/linux.gradle ++++ b/buildSrc/linux.gradle +@@ -47,7 +47,8 @@ def commonFlags = [ + "-Wno-error=cast-function-type", + "-Wextra", "-Wall", "-Wformat-security", "-Wno-unused", "-Wno-parentheses", "-Werror=trampolines"] // warning flags + +-commonFlags.addAll(System.getenv("CFLAGS").trim().split(" ")) ++commonFlags.addAll(System.getenv("CFLAGS").strip().split(" ")) ++commonFlags.removeAll([""]) + + if (!IS_64) { + commonFlags += "-m32" +@@ -75,7 +76,8 @@ def staticLinkFlags = [].flatten() + + def linkFlags = IS_STATIC_BUILD ? staticLinkFlags : dynamicLinkFlags; + +-linkFlags.addAll(System.getenv("LDFLAGS").trim().split(" ")) ++linkFlags.addAll(System.getenv("LDFLAGS").strip().split(" ")) ++linkFlags.removeAll([""]) + + if (IS_DEBUG_NATIVE) { + linkFlags += "-g" diff --git a/dev-java/openjfx/openjfx-11.0.11_p1-r2.ebuild b/dev-java/openjfx/openjfx-11.0.11_p1-r2.ebuild new file mode 100644 index 000000000000..4f4331a06705 --- /dev/null +++ b/dev-java/openjfx/openjfx-11.0.11_p1-r2.ebuild @@ -0,0 +1,231 @@ +# Copyright 2019-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +MY_PV="${PV/_p/+}" +SLOT="${MY_PV%%[.+]*}" +EGRADLE_VER="4.10.3" + +inherit flag-o-matic java-pkg-2 multiprocessing toolchain-funcs + +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 +" + +S="${WORKDIR}/rt-${MY_PV}" + +LICENSE="GPL-2-with-classpath-exception" +KEYWORDS="-* ~amd64 ~ppc64" +IUSE="cpu_flags_x86_sse2 debug doc source +media" +REQUIRED_USE="amd64? ( cpu_flags_x86_sse2 )" + +RDEPEND=" + app-accessibility/at-spi2-core + dev-java/swt:4.10[cairo,opengl] + dev-libs/glib:2 + dev-libs/libxml2:2 + dev-libs/libxslt + media-libs/freetype:2 + media-libs/fontconfig:1.0 + media-libs/libjpeg-turbo + 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/opengl + doc? ( dev-java/openjdk:${SLOT}[doc] ) + !doc? ( + || ( + dev-java/openjdk-bin:${SLOT} + dev-java/openjdk:${SLOT} + ) + ) +" + +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 +" + +PATCHES=( + "${FILESDIR}"/11/disable-buildSrc-tests.patch + "${FILESDIR}"/11/glibc-compatibility.patch + "${FILESDIR}"/11/respect-user-cflags-11.0.11.patch + "${FILESDIR}"/11/use-system-swt-jar.patch + "${FILESDIR}"/11/wno-error-11.0.11.patch + "${FILESDIR}"/11/don-t-force-msse-11.0.11.patch + "${FILESDIR}"/11/disable-architecture-verification.patch + "${FILESDIR}"/11/gstreamer-CVE-2021-3522.patch + "${FILESDIR}"/11/ffmpeg5.patch + "${FILESDIR}"/11/respect-cc.patch + "${FILESDIR}"/11/strip-blank-elements-flags.patch +) + +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" + #--debug + ) + + export GRADLE_HOME + + # FIXME: build.gradle believes $ANT_HOME/bin/ant shoud exist + unset ANT_HOME + + einfo "gradle "${gradle_args[@]}" ${@}" + # TERM needed, otherwise gradle may fail on terms it does not know about + TERM="xterm" "${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 -b dev-java/openjdk:${SLOT}; then + export JAVA_HOME=${EPREFIX}/usr/$(get_libdir)/openjdk-${SLOT} + export JDK_HOME="${JAVA_HOME}" + export ANT_RESPECT_JAVA_HOME=true + else + if [[ ${MERGE_TYPE} != "binary" ]]; then + JDK_HOME=$(best_version -b 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=true + 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() { + append-flags -Wno-error -fcommon + # This package is ridiculously brittle and fails when building e.g. + # bundled gstreamer with LTO. + filter-lto + tc-export AR CC CXX + + # FIXME: still calls pkg-config etc by name without chost prefix + # FIXME: should we enable webkit? doubt so + + # build is very sensitive to doc presence, take extra steps + if use doc; then + local jdk_doc + if has_version -b dev-java/openjdk:${SLOT}[doc]; then + jdk_doc="${EPREFIX}/usr/share/doc/openjdk-${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 + docinto html + dodoc -r build/javadoc/. + dosym ../../../usr/share/doc/"${PF}" /usr/share/doc/"${PN}-${SLOT}" + fi +} |