diff options
Diffstat (limited to 'dev-java')
-rw-r--r-- | dev-java/swt/Manifest | 3 | ||||
-rw-r--r-- | dev-java/swt/swt-4.33.ebuild | 152 |
2 files changed, 155 insertions, 0 deletions
diff --git a/dev-java/swt/Manifest b/dev-java/swt/Manifest index 166e78f0c03c..c5cc743a6940 100644 --- a/dev-java/swt/Manifest +++ b/dev-java/swt/Manifest @@ -15,3 +15,6 @@ DIST swt-4.31-gtk-linux-x86_64.zip 4039479 BLAKE2B 6f7e434acf57cd03dd5e938b1b1c5 DIST swt-4.32-gtk-linux-aarch64.zip 3991281 BLAKE2B 99fece9547e801661bb65f699780eb95cb626efd78e1bd79dec15d5fb63e03805ab6c6f75b98648cfad194d800c11cbe6a3c23250f4c4084072aea2aa4cde10c SHA512 adf5d207ba35bfa43fad2c4c64d72a4b56e8830efa0f817b158ad0bd4508eca9c83c43ebebb843c4fb75cb33835a6490b8b0b2a993bfa3507b62fba50345607a DIST swt-4.32-gtk-linux-ppc64le.zip 4028301 BLAKE2B 1ed2590ffe01836dc9209b8323db25204c157a829f4af10f20509c30f268c88e89a9e252aebd9a4a0d3337fa20b1a3d76040b768918f7a2f7c8a6313314d14b8 SHA512 713f762fab2d5eea125844912fafdc3eb42bfb76c2caac5612972714e07b66de0e2a71ae29a51c86b2ad76c32761842ad209f8b59c931ea727dc03b2161b40f2 DIST swt-4.32-gtk-linux-x86_64.zip 4011746 BLAKE2B 5d2784f9a18684d539ea576560bb5fecbbf59960cbd8ce901c9b152df087decb2db28ebf9fbf12c710f6dde71583e9002ca0ac85d5ca7a7ce17286ad1666c5c8 SHA512 f4d511595cccf104cda35c6f314e3689508e18e5da85bb2e8bdd408d9b8d4ab3371e851b3b96ba0f835b3ff0a079c4ed887661e586ab0ce06a52abf69ba243be +DIST swt-4.33-gtk-linux-aarch64.zip 3929090 BLAKE2B 60cc67c7b197cb31c68622c2d78090a50b4d3eca9c8c5f919b230ebed8f65a588c941f32e89ed0126d5bb5558b664a61661535b158bc7b26928556768f83fb5c SHA512 5a01ffd19c62de4fc1d0df4dae7c93ba8235af7e00713f49cf9cb591843f891bb8151a33dd51bca45c31b068edf65b59a1826cec1a1f3b9d14366d30e7efd430 +DIST swt-4.33-gtk-linux-ppc64le.zip 3966353 BLAKE2B 0ab4a75ac1efdedfcacdd235f45b1b0de04ab762cf64957ca1761e2f6a7e1571e106b26ab08b9ecd600ddf89f2abcd151dcd236c303bfe7d8cfabbce2910b2b4 SHA512 8f54cce4e5ac9e0043c8e3861aeed193f919b7bc4291f5812a568fcf4206cf4875d14d9cd7836235414cbde6a837fe38a2a6380c7d50ca04d3aa366dab733d81 +DIST swt-4.33-gtk-linux-x86_64.zip 3950557 BLAKE2B 6cf4f48e32bcfa40082c08a78dd8d64e9454db3859533696c7cc7cd37639ac7df980d9cfd13abaa80e95e44ad619b96944387363d2fb93d7de34f5f25052bd54 SHA512 3211a5480b886c542f99e29b715b5b1221ba679b572f1de6ca68bdb7b06eec6863c68fbddb9b70d74f13e501c3d76a220c7c8b466031b6c0a25bba5c011f8a63 diff --git a/dev-java/swt/swt-4.33.ebuild b/dev-java/swt/swt-4.33.ebuild new file mode 100644 index 000000000000..444346927d00 --- /dev/null +++ b/dev-java/swt/swt-4.33.ebuild @@ -0,0 +1,152 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +JAVA_PKG_IUSE="doc source" + +inherit flag-o-matic java-pkg-2 java-pkg-simple toolchain-funcs + +MY_PV="${PV/_rc/RC}" +MY_DMF="https://download.eclipse.org/eclipse/downloads/drops4/R-${MY_PV}-202409030240" +MY_P="${PN}-${MY_PV}" + +DESCRIPTION="GTK based SWT Library" +HOMEPAGE="https://www.eclipse.org/swt/" +SRC_URI=" + amd64? ( ${MY_DMF}/${MY_P}-gtk-linux-x86_64.zip ) + arm64? ( ${MY_DMF}/${MY_P}-gtk-linux-aarch64.zip ) + ppc64? ( ${MY_DMF}/${MY_P}-gtk-linux-ppc64le.zip )" +S="${WORKDIR}/library" + +LICENSE="CPL-1.0 LGPL-2.1 MPL-1.1" +SLOT="4.33" +KEYWORDS="~amd64 ~arm64 ~ppc64" +IUSE="cairo opengl webkit" + +BDEPEND=" + app-arch/unzip + virtual/pkgconfig +" +COMMON_DEP=" + app-accessibility/at-spi2-core:2 + dev-libs/glib + x11-libs/gtk+:3 + x11-libs/libXtst + cairo? ( x11-libs/cairo ) + opengl? ( + virtual/glu + virtual/opengl + ) + webkit? ( + net-libs/webkit-gtk:4.1 + )" +DEPEND="${COMMON_DEP} + >=virtual/jdk-17:*[-headless-awt] + x11-base/xorg-proto + x11-libs/libX11 + x11-libs/libXrender + x11-libs/libXt + x11-libs/libXtst" +# error: pattern matching in instanceof is not supported in -source 11 +RDEPEND="${COMMON_DEP} + >=virtual/jre-17:* + x11-libs/libX11" + +HTML_DOCS=( ../about.html ) + +JAVA_RESOURCE_DIRS="../resources" +JAVA_SRC_DIR="../src" + +PATCHES=( + "${FILESDIR}/swt-4.27-as-needed-and-flag-fixes.patch" +) + +src_unpack() { + default + unpack "./src.zip" +} + +src_prepare() { + default #780585 + java-pkg-2_src_prepare + # .css stuff is essential at least for running net-p2p/biglybt + unzip ../swt.jar 'org/eclipse/swt/internal/gtk/*.css' -d resources || die + java-pkg_clean + cd .. || die + mkdir resources src || die "mkdir failed" + find org -type f -name '*.java' \ + | xargs \ + cp --parent -t src -v \ + || die "copying resources failed" + find org -type f ! -name '*.java' \ + | xargs \ + cp --parent -t resources -v \ + || die "copying resources failed" + cp version.txt resources || die "adding version.txt failed" +} + +src_compile() { + append-cflags -fcommon # https://bugs.gentoo.org/707838 + + local JAWTSO="libjawt.so" + IFS=":" read -r -a ldpaths <<< $(java-config -g LDPATH) + + for libpath in "${ldpaths[@]}"; do + if [[ -f "${libpath}/${JAWTSO}" ]]; then + export AWT_LIB_PATH="${libpath}" + break + # this is a workaround for broken LDPATH in <=openjdk-8.292_p10 and <=dev-java/openjdk-bin-8.292_p10 + elif [[ -f "${libpath}/$(tc-arch)/${JAWTSO}" ]]; then + export AWT_LIB_PATH="${libpath}/$(tc-arch)" + break + fi + done + + if [[ -z "${AWT_LIB_PATH}" ]]; then + eerror "${JAWTSO} not found in the JDK being used for compilation!" + die "cannot build AWT library" + fi + + # Fix the pointer size for AMD64 + export SWT_PTR_CFLAGS=-DJNI64 + + # Bug #461784, g_thread_init is deprecated since glib-2.32. + append-cflags -DNO__1g_1thread_1init + + local make="emake -f make_linux.mak NO_STRIP=y CC=$(tc-getCC) CXX=$(tc-getCXX)" + + einfo "Building AWT library" + export SWT_JAVA_HOME="$(java-config -g JAVA_HOME)" + ${make} make_awt AWT_LIBS="-L\$(AWT_LIB_PATH) -Wl,-rpath,\$(AWT_LIB_PATH) -ljawt \`pkg-config --libs x11\`" + + einfo "Building SWT library" + ${make} make_swt + + einfo "Building JAVA-AT-SPI bridge" + ${make} make_atk + + if use cairo ; then + einfo "Building CAIRO support" + ${make} make_cairo + fi + + if use opengl ; then + einfo "Building OpenGL component" + ${make} make_glx + fi + + if use webkit ; then + einfo "Building WebKit component" + ${make} make_webkit + fi + + java-pkg-simple_src_compile +} + +src_install() { + java-pkg-simple_src_install + + java-pkg_sointo "/usr/$(get_libdir)/swt" + java-pkg_doso *.so +} |