summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolkmar W. Pogatzki <gentoo@pogatzki.net>2023-01-02 19:38:42 +0100
committerMiroslav Šulc <fordfrog@gentoo.org>2023-03-19 07:30:39 +0100
commitf827629c3b99735e623babe93c76624251cd2fd2 (patch)
tree59fbf6860e51b62db784d76e17bcbecb7bcdef2b /dev-java
parentdev-java/commons-logging: add 1.3.0_pre20230317 (diff)
downloadgentoo-f827629c3b99735e623babe93c76624251cd2fd2.tar.gz
gentoo-f827629c3b99735e623babe93c76624251cd2fd2.tar.bz2
gentoo-f827629c3b99735e623babe93c76624251cd2fd2.zip
dev-java/swt: add 4.27
- adds arm64 to conditional sources, to be keyworded - switches to java-pkg-simple.eclass - drops osgi stuff, not used upstream - reworks swt-4.27-as-needed-and-flag-fixes.patch from 4.10 - re-uses src_compile() from 4.10 except "eant compile" Signed-off-by: Volkmar W. Pogatzki <gentoo@pogatzki.net> Closes: https://github.com/gentoo/gentoo/pull/29142/commits/0cace839b2d3e8c310b1371dcd12f9626c90a147 Signed-off-by: Miroslav Šulc <fordfrog@gentoo.org>
Diffstat (limited to 'dev-java')
-rw-r--r--dev-java/swt/Manifest3
-rw-r--r--dev-java/swt/files/swt-4.27-as-needed-and-flag-fixes.patch82
-rw-r--r--dev-java/swt/swt-4.27.ebuild142
3 files changed, 227 insertions, 0 deletions
diff --git a/dev-java/swt/Manifest b/dev-java/swt/Manifest
index a1e00f9e4f9c..296f28fcfb56 100644
--- a/dev-java/swt/Manifest
+++ b/dev-java/swt/Manifest
@@ -3,3 +3,6 @@ DIST swt-3.7.2-gtk-linux-x86.zip 5374609 BLAKE2B 04d44b9fffcedc6ce255e2651377ac6
DIST swt-3.7.2-gtk-linux-x86_64.zip 5671443 BLAKE2B 953fc9eab6d1f2750b1a1345cddf4aa6969567cb75977f87ee50668d367e55dda8be2ff836d87b780005c22132fa783b475f422c093617fd02f478eadd96076d SHA512 d60ae1d3f3b0577f7e3018139f93069c89d021064fec2f3f4074f95cfae56abdc0c7d531cb904ad3911482543cddcc3f6646ff47192073f4bde97c79e13612b7
DIST swt-4.10-gtk-linux-ppc64le.zip 3848264 BLAKE2B 214861fde6987906fb24f3187936f3bcb49aebed54fe242427c3737bf6761e8f77d049c376f30ca0fc33e74a1e8a48b6aff6d9863775ee9c33fea7cb2edd1309 SHA512 1b3ede58c2b41abae76f58a303bd3fbf1849ba8be3fd6518325bc22400e960c3ab542e7351b1bc08053e2746ea3e28812e04c2d1789cb1e19ea28745c8a5f39a
DIST swt-4.10-gtk-linux-x86_64.zip 3844306 BLAKE2B 0e0ed21708acce347fd025920ee635f586c460f8a9c05a7067fd70eed9da999b4a62a5febd17f0c5546ab15198336038e4ab49a1bd588d49ffb39450353a1911 SHA512 9dd946cb7c11446f553f06b8af516167519bab00d4a89f626cd612be6d18e50023fc537aa3d844a8f7a56a767df00410efe4dd20e2bfd930639330a1e279a7a0
+DIST swt-4.27-gtk-linux-aarch64.zip 3849438 BLAKE2B b07daa4942c450d5cca5a323b0649a645fe9a283b272a73a9675f3bd07fbae859c41f451521231a93f4fb56ae4093d57474545611c4789c076abad2e9e1c911f SHA512 a3ba011258e5906beb15ffd5deaa73fc9a5ed5f7bce78a4a683ad8ad12a5cca1fa3a0d89fed6da9f4ade530ea3bda09093ad43202993b522a060a9dcd98746d3
+DIST swt-4.27-gtk-linux-ppc64le.zip 3872996 BLAKE2B 58ae779b7103da932719fe702674e211f8f0068c3b6094172b4c58e939de96d8d43ef80d40740c29f6fcd802a252a87ba850e9e6320d881c958b0161700e4e8c SHA512 6f8f1fce502e0980ced3f201dcdeb3397a583a9ba9ebe76d82c713c440d614c4ff38efe5f596a9da25940f931e3c651c36b18211faea4fab31872d25566b060a
+DIST swt-4.27-gtk-linux-x86_64.zip 3869518 BLAKE2B d0eb7d1be59944cbffe5556c258043d084f7f1a8fa1d9ad9c3738896adc12aa015f85b675ba72af31de566ae451280bb83d82082b3f589c8da643631bf1f7bfb SHA512 efa89c1752340978e1aa1d2343a07df001fa952092aef959bdeedf53a31270d24ebe34ccb50e72ef2221da810ed08c53b188a80aab8a37e5932f85f6771ea1ef
diff --git a/dev-java/swt/files/swt-4.27-as-needed-and-flag-fixes.patch b/dev-java/swt/files/swt-4.27-as-needed-and-flag-fixes.patch
new file mode 100644
index 000000000000..fffbc910c521
--- /dev/null
+++ b/dev-java/swt/files/swt-4.27-as-needed-and-flag-fixes.patch
@@ -0,0 +1,82 @@
+diff -Naur a/make_linux.mak b/make_linux.mak
+--- a/make_linux.mak 2019-01-07 14:08:00.269147198 +0100
++++ b/make_linux.mak 2019-01-07 14:10:28.645155241 +0100
+@@ -98,7 +98,7 @@
+ WEBKIT_OBJECTS = swt.o webkitgtk.o webkitgtk_structs.o webkitgtk_stats.o webkitgtk_custom.o
+ GLX_OBJECTS = swt.o glx.o glx_structs.o glx_stats.o
+
+-CFLAGS := $(CFLAGS) \
++CFLAGS += -fPIC \
+ -DSWT_VERSION=$(SWT_VERSION) \
+ $(NATIVE_STATS) \
+ $(SWT_DEBUG) \
+@@ -130,13 +130,13 @@
+ make_swt: $(SWT_LIB) $(SWTPI_LIB)
+
+ $(SWT_LIB): $(SWT_OBJECTS)
+- $(CC) $(LFLAGS) -o $(SWT_LIB) $(SWT_OBJECTS)
++ $(CC) $(LDFLAGS) $(LFLAGS) -o $(SWT_LIB) $(SWT_OBJECTS)
+
+ callback.o: callback.c callback.h
+ $(CC) $(CFLAGS) $(GTKCFLAGS) -DUSE_ASSEMBLER -c callback.c
+
+ $(SWTPI_LIB): $(SWTPI_OBJECTS)
+- $(CC) $(LFLAGS) -o $(SWTPI_LIB) $(SWTPI_OBJECTS) $(GTKLIBS)
++ $(CC) $(LDFLAGS) $(LFLAGS) -o $(SWTPI_LIB) $(SWTPI_OBJECTS) $(GTKLIBS)
+
+ swt.o: swt.c swt.h
+ $(CC) $(CFLAGS) -c swt.c
+@@ -169,7 +169,7 @@
+ make_cairo: $(CAIRO_LIB)
+
+ $(CAIRO_LIB): $(CAIRO_OBJECTS)
+- $(CC) $(LFLAGS) -o $(CAIRO_LIB) $(CAIRO_OBJECTS) $(CAIROLIBS)
++ $(CC) $(LDFLAGS) $(LFLAGS) -o $(CAIRO_LIB) $(CAIRO_OBJECTS) $(CAIROLIBS)
+
+ cairo.o: cairo.c cairo.h swt.h
+ $(CC) $(CFLAGS) $(CAIROCFLAGS) -c cairo.c
+@@ -184,7 +184,7 @@
+ make_awt:$(AWT_LIB)
+
+ $(AWT_LIB): $(AWT_OBJECTS)
+- $(CC) $(AWT_LFLAGS) -o $(AWT_LIB) $(AWT_OBJECTS) $(AWT_LIBS)
++ $(CC) -fPIC $(LDFLAGS) $(AWT_LFLAGS) -o $(AWT_LIB) $(AWT_OBJECTS) $(AWT_LIBS)
+
+ #
+ # Atk lib
+@@ -192,7 +192,7 @@
+ make_atk: $(ATK_LIB)
+
+ $(ATK_LIB): $(ATK_OBJECTS)
+- $(CC) $(LFLAGS) -o $(ATK_LIB) $(ATK_OBJECTS) $(ATKLIBS)
++ $(CC) $(LDFLAGS) $(LFLAGS) -o $(ATK_LIB) $(ATK_OBJECTS) $(ATKLIBS)
+
+ atk.o: atk.c atk.h
+ $(CC) $(CFLAGS) $(ATKCFLAGS) -c atk.c
+@@ -209,7 +209,7 @@
+ make_webkit: $(WEBKIT_LIB)
+
+ $(WEBKIT_LIB): $(WEBKIT_OBJECTS)
+- $(CC) $(LFLAGS) -o $(WEBKIT_LIB) $(WEBKIT_OBJECTS) $(WEBKITLIBS)
++ $(CC) $(LDFLAGS) $(LFLAGS) -o $(WEBKIT_LIB) $(WEBKIT_OBJECTS) $(WEBKITLIBS)
+
+ webkitgtk.o: webkitgtk.c webkitgtk_custom.h
+ $(CC) $(CFLAGS) $(WEBKITCFLAGS) -c webkitgtk.c
+# @@ -217,7 +217,7 @@
+# make_webkit2extension: $(WEBKIT_EXTENSION_LIB)
+#
+# $(WEBKIT_EXTENSION_LIB) : webkitgtk_extension.o
+# - $(CC) $(LFLAGS) -o $@ $^ $(WEBKIT_EXTENSION_LFLAGS)
+# + $(CC) $(LDFLAGS) $(LFLAGS) -o $@ $^ $(WEBKIT_EXTENSION_LFLAGS)
+#
+# webkitgtk_extension.o : webkitgtk_extension.c
+# $(CC) $(CFLAGS) $(WEBKIT_EXTENSION_CFLAGS) ${SWT_PTR_CFLAGS} -fPIC -c $^
+@@ -229,7 +229,7 @@
+ make_glx: $(GLX_LIB)
+
+ $(GLX_LIB): $(GLX_OBJECTS)
+- $(CC) $(LFLAGS) -o $(GLX_LIB) $(GLX_OBJECTS) $(GLXLIBS)
++ $(CC) $(LDFLAGS) $(LFLAGS) -o $(GLX_LIB) $(GLX_OBJECTS) $(GLXLIBS)
+
+ glx.o: glx.c
+ $(CC) $(CFLAGS) $(GLXCFLAGS) -c glx.c
diff --git a/dev-java/swt/swt-4.27.ebuild b/dev-java/swt/swt-4.27.ebuild
new file mode 100644
index 000000000000..e21194ce71dd
--- /dev/null
+++ b/dev-java/swt/swt-4.27.ebuild
@@ -0,0 +1,142 @@
+# Copyright 1999-2023 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}-202303020300"
+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 )"
+
+LICENSE="CPL-1.0 LGPL-2.1 MPL-1.1"
+SLOT="4.27"
+KEYWORDS="~amd64 ~ppc64"
+IUSE="cairo opengl webkit"
+
+COMMON_DEP="
+ app-accessibility/at-spi2-core:2
+ dev-libs/glib
+ x11-libs/gtk+:2
+ x11-libs/libXtst
+ cairo? ( x11-libs/cairo )
+ opengl? (
+ virtual/glu
+ virtual/opengl
+ )
+ webkit? (
+ net-libs/webkit-gtk:4.1
+ )"
+DEPEND="${COMMON_DEP}
+ >=virtual/jdk-11:*[-headless-awt]
+ x11-base/xorg-proto
+ x11-libs/libX11
+ x11-libs/libXrender
+ x11-libs/libXt
+ x11-libs/libXtst"
+RDEPEND="${COMMON_DEP}
+ >=virtual/jre-1.8:*"
+BDEPEND="
+ app-arch/unzip
+ virtual/pkgconfig
+"
+
+HTML_DOCS=( about.html )
+
+JAVA_RESOURCE_DIRS="resources"
+JAVA_SRC_DIR="src"
+
+PATCHES=(
+ "${FILESDIR}/${P}-as-needed-and-flag-fixes.patch"
+)
+
+src_unpack() {
+ default
+ unpack "./src.zip"
+}
+
+src_prepare() {
+ default
+ 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
+ mkdir src || die "mkdir failed"
+ mv org src || die "moving java sources failed"
+ find src -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"
+ ${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
+}