Bug 265747 - x11-toolkits/swt: openjdk with debug breaks build (libswt-awt-gtk-*)
Summary: x11-toolkits/swt: openjdk with debug breaks build (libswt-awt-gtk-*)
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Max Brazhnikov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-08-09 23:36 UTC by chadf
Modified: 2022-11-09 18:58 UTC (History)
0 users

See Also:
bugzilla: maintainer-feedback? (makc)


Attachments
swt-build.sh.patch (285 bytes, patch)
2022-08-09 23:36 UTC, chadf
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description chadf 2022-08-09 23:36:21 UTC
Created attachment 235818 [details]
swt-build.sh.patch

When openjdk has debug enabled, it breaks building AWT component of SWT.

Cause:
 The build.sh script looks for libjawt.*, which also matches libjawt.debuginfo, causing the auto-detect to fail.

Fix:
 Patch build.sh to look for libjawt.so explicitly. [patch attached -- post port's existing build.sh patch]

Note:
 Only tested with openjdk8. May break if another JDK uses a filename different than just "libjawt.so". Optionally could change patch to look for "libjawt.*so".

Build Log:
# make install
===>  License EPL accepted by the user
===>   swt-4.21 depends on file: /usr/local/sbin/pkg - found
===> Fetching all distfiles required by swt-4.21 for building
===>  Extracting for swt-4.21
=> SHA256 Checksum OK for swt-4.21-gtk-linux-x86_64.zip.
===>   swt-4.21 depends on file: /usr/local/bin/unzip - found
===>  Patching for swt-4.21
===>  Applying FreeBSD patches for swt-4.21 from /usr/ports/x11-toolkits/swt/files
/usr/bin/sed -e 's|freebsd|dragonfly|g' /usr/obj/usr/ports/x11-toolkits/swt/work/swt-4.21/make_freebsd.mak  > /usr/obj/usr/ports/x11-toolkits/swt/work/swt-4.21/make_dragonfly.mak
===>   swt-4.21 depends on file: /usr/local/openjdk8/bin/java - found
===>   swt-4.21 depends on file: /usr/local/bin/ant - found
===>   swt-4.21 depends on package: gmake>=4.3 - found
===>   swt-4.21 depends on package: pkgconf>=1.3.0_1 - found
===>   swt-4.21 depends on package: xorgproto>=0 - found
===>   swt-4.21 depends on package: xorgproto>=0 - found
===>   swt-4.21 depends on file: /usr/local/libdata/pkgconfig/xtst.pc - found
===>   swt-4.21 depends on shared library: libGLU.so - found (/usr/local/lib/libGLU.so)
===>   swt-4.21 depends on shared library: libGL.so - found (/usr/local/lib/libGL.so)
===>   swt-4.21 depends on shared library: libatk-1.0.so - found (/usr/local/lib/libatk-1.0.so)
===>   swt-4.21 depends on shared library: libcairo.so - found (/usr/local/lib/libcairo.so)
===>   swt-4.21 depends on shared library: libgdk_pixbuf-2.0.so - found (/usr/local/lib/libgdk_pixbuf-2.0.so)
===>   swt-4.21 depends on shared library: libglib-2.0.so - found (/usr/local/lib/libglib-2.0.so)
===>   swt-4.21 depends on shared library: libintl.so - found (/usr/local/lib/libintl.so)
===>   swt-4.21 depends on shared library: libgtk-3.so - found (/usr/local/lib/libgtk-3.so)
===>   swt-4.21 depends on shared library: libpango-1.0.so - found (/usr/local/lib/libpango-1.0.so)
===>  Configuring for swt-4.21
===>  Building for swt-4.21
Buildfile: /usr/obj/usr/ports/x11-toolkits/swt/work/swt-4.21/build.xml

init:

build.classes:
    [mkdir] Created dir: /usr/obj/usr/ports/x11-toolkits/swt/work/swt-4.21/classes
    [javac] /usr/obj/usr/ports/x11-toolkits/swt/work/swt-4.21/build.xml:32: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
    [javac] Compiling 440 source files to /usr/obj/usr/ports/x11-toolkits/swt/work/swt-4.21/classes
    [javac] Note: Some input files use or override a deprecated API.
    [javac] Note: Recompile with -Xlint:deprecation for details.

build.nativeLibraries:
     [exec] [: /usr/local/openjdk8/jre/lib/amd64/libjawt.debuginfo: unexpected operatorCairo found, compiling SWT support for the cairo graphics library.
     [exec] *** libjawt.so not found, the SWT/AWT integration library will not be compiled.
     [exec] Building SWT/GTK+ for Architectures: freebsd x86_64
     [exec] *** Warning: Cannot compile Webkit2 Extension because 'pkg-config --exists webkit2gtk-web-extension-4.0' check failed. Please install webkitgtk4-devel.ARCH on your system.
     [exec] Building GTK3 bindings:
     [exec] gmake[2]: Entering directory '/usr/obj/usr/ports/x11-toolkits/swt/work/swt-4.21'
     [exec] cc -O -Wall -fPIC -DSWT_VERSION=4946r21    -DLINUX -DGTK -I/usr/local/openjdk8/include -I/usr/local/openjdk8/include/freebsd -I/usr/local/include -DJNI64 -Werror -c swt.c

.
.
.

     [exec] cc -shared -fPIC  -s -o libswt-cairo-gtk-4946r21.so swt.o cairo.o cairo_structs.o cairo_stats.o `pkg-config --libs-only-L cairo` -lcairo
     [exec] gmake[2]: Leaving directory '/usr/obj/usr/ports/x11-toolkits/swt/work/swt-4.21'
     [exec] GTK3 Build succeeded

build.jar:
      [jar] Building jar: /usr/obj/usr/ports/x11-toolkits/swt/work/swt-4.21/swt.jar

BUILD SUCCESSFUL
Total time: 23 seconds
===>  Staging for swt-4.21
===>   swt-4.21 depends on file: /usr/local/openjdk8/bin/java - found
===>   swt-4.21 depends on file: /usr/local/libdata/pkgconfig/xtst.pc - found
===>   Generating temporary packing list
install  -s -m 0644 /usr/obj/usr/ports/x11-toolkits/swt/work/swt-4.21/libswt-*.so /usr/obj/usr/ports/x11-toolkits/swt/work/stage/usr/local/lib
install  -m 0644 /usr/obj/usr/ports/x11-toolkits/swt/work/swt-4.21/swt.jar /usr/obj/usr/ports/x11-toolkits/swt/work/stage/usr/local/share/java/classes/
====> Compressing man pages (compress-man)
===>  Installing for swt-4.21
===>   Registering installation for swt-4.21
pkg-static: Unable to access file /usr/obj/usr/ports/x11-toolkits/swt/work/stage/usr/local/lib/libswt-awt-gtk-4946r21.so:No such file or directory
*** Error code 1
Comment 1 commit-hook freebsd_committer freebsd_triage 2022-11-09 18:57:39 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=8630a2a43b0b883813694548fe5783f11ad7330f

commit 8630a2a43b0b883813694548fe5783f11ad7330f
Author:     Max Brazhnikov <makc@FreeBSD.org>
AuthorDate: 2022-11-09 18:56:22 +0000
Commit:     Max Brazhnikov <makc@FreeBSD.org>
CommitDate: 2022-11-09 18:56:22 +0000

    x11-toolkits/swt: fix build with OpenJDK debug enabled

    PR:             265747
    Submitted by:   chadf at triularity.org

 x11-toolkits/swt/files/patch-build.sh | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)
Comment 2 Max Brazhnikov freebsd_committer freebsd_triage 2022-11-09 18:58:20 UTC
Committed, thank you!