Package Details: swt 4.34-2

Git Clone URL: https://aur.archlinux.org/swt.git (read-only, click to copy)
Package Base: swt
Description: An open source widget toolkit for Java
Upstream URL: https://www.eclipse.org/swt/
Licenses: EPL-2.0
Submitter: arojas
Maintainer: gpepi
Last Packager: gpepi
Votes: 6
Popularity: 0.41
First Submitted: 2021-04-22 20:25 (UTC)
Last Updated: 2024-12-06 21:33 (UTC)

Dependencies (13)

Sources (2)

Latest Comments

« First ‹ Previous 1 2 3 Next › Last »

cknoblauch commented on 2022-09-30 02:18 (UTC)

I had the same issue as last time with the latest version (4.25-1). I have java-11-temurin installed, which includes the missing jni.h file and also fulfills the necessary jdk11-openjdk dependency; however, the PKGBUILD sets the JAVA_HOME to /usr/lib/jvm/java-11-openjdk regardless of whether the openjdk version is installed or not. I could build the package by changing the path to /usr/lib/jvm/java-11-temurin.

It would be great if you could consider cases like this for building the package, @carsme. In the meantime, I'll leave this comment with the workaround for me or anyone else to find the next time I stumble with the same problem.

df8oe commented on 2022-09-28 16:29 (UTC)

Does not build:
Caught an exception while logging the end of the build. Exception was:
java.lang.ClassFormatError: Invalid pc in LineNumberTable in class file sun/util/calendar/CalendarDate
at java.base/sun.util.calendar.Gregorian.newCalendarDate(Gregorian.java:85)
at java.base/java.util.GregorianCalendar.<init>(GregorianCalendar.java:739)
at java.base/java.util.Calendar$Builder.build(Calendar.java:1493)
at java.base/sun.util.locale.provider.CalendarProviderImpl.getInstance(CalendarProviderImpl.java:87)
at java.base/java.util.Calendar.createCalendar(Calendar.java:1696)
at java.base/java.util.Calendar.getInstance(Calendar.java:1660)
at java.base/java.text.SimpleDateFormat.initializeCalendar(SimpleDateFormat.java:676)
at java.base/java.text.SimpleDateFormat.<init>(SimpleDateFormat.java:620)
at org.apache.tools.ant.util.DateUtils.<clinit>(DateUtils.java:72)
at org.apache.tools.ant.DefaultLogger.formatTime(DefaultLogger.java:304)
at org.apache.tools.ant.DefaultLogger.buildFinished(DefaultLogger.java:175)
at org.apache.tools.ant.Project.fireBuildFinished(Project.java:2111)
at org.apache.tools.ant.Main.runBuild(Main.java:830)
at org.apache.tools.ant.Main.startAnt(Main.java:223)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:284)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:101)
There has been an error prior to that:
java.lang.ClassFormatError: Invalid pc in LineNumberTable in class file sun/util/calendar/CalendarDate
at java.base/sun.util.calendar.Gregorian.newCalendarDate(Gregorian.java:85)
at java.base/java.util.GregorianCalendar.<init>(GregorianCalendar.java:739)
at java.base/java.util.Calendar$Builder.build(Calendar.java:1493)
at java.base/sun.util.locale.provider.CalendarProviderImpl.getInstance(CalendarProviderImpl.java:87)
at java.base/java.util.Calendar.createCalendar(Calendar.java:1696)
at java.base/java.util.Calendar.getInstance(Calendar.java:1629)
at org.apache.tools.zip.ZipUtil.dosToJavaTime(ZipUtil.java:128)
at org.apache.tools.zip.ZipFile.readCentralDirectoryEntry(ZipFile.java:513)
at org.apache.tools.zip.ZipFile.populateFromCentralDirectory(ZipFile.java:472)
at org.apache.tools.zip.ZipFile.<init>(ZipFile.java:217)
at org.apache.tools.zip.ZipFile.<init>(ZipFile.java:178)
at org.apache.tools.ant.helper.ProjectHelper2.parse(ProjectHelper2.java:258)
at org.apache.tools.ant.helper.ProjectHelper2.parseUnknownElement(ProjectHelper2.java:134)
at org.apache.tools.ant.helper.ProjectHelper2.parseAntlibDescriptor(ProjectHelper2.java:114)
at org.apache.tools.ant.taskdefs.Antlib.createAntlib(Antlib.java:95)
at org.apache.tools.ant.taskdefs.Definer.loadAntlib(Definer.java:416)
at org.apache.tools.ant.taskdefs.Definer.execute(Definer.java:275)
at org.apache.tools.ant.ComponentHelper.checkNamespace(ComponentHelper.java:853)
at org.apache.tools.ant.ComponentHelper.getDefinition(ComponentHelper.java:308)
at org.apache.tools.ant.ComponentHelper.createComponent(ComponentHelper.java:285)
at org.apache.tools.ant.ComponentHelper.createComponent(ComponentHelper.java:264)
at org.apache.tools.ant.UnknownElement.makeObject(UnknownElement.java:434)
at org.apache.tools.ant.UnknownElement.maybeConfigure(UnknownElement.java:166)
at org.apache.tools.ant.Task.perform(Task.java:349)
at org.apache.tools.ant.Target.execute(Target.java:449)
at org.apache.tools.ant.helper.ProjectHelper2.parse(ProjectHelper2.java:184)
at org.apache.tools.ant.ProjectHelper.configureProject(ProjectHelper.java:104)
at org.apache.tools.ant.Main.runBuild(Main.java:793)
at org.apache.tools.ant.Main.startAnt(Main.java:223)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:284)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:101)
==> FEHLER: Ein Fehler geschah in build().
Breche ab...
-> Fehler beim Erstellen: swt

carsme commented on 2022-06-07 07:59 (UTC)

@cknoblauch I cannot reproduce your issue. Installing works fine in the standard Arch Linux Docker image..

jni.h should be included in jdk11-openjdk:

$ pacman -Ql jdk11-openjdk  | grep jni
jdk11-openjdk /usr/lib/jvm/java-11-openjdk/include/jni.h

Can you provide the exact changes to the PKGBUILD that fixed your issue?

cknoblauch commented on 2022-06-06 19:17 (UTC)

Just in case anyone else runs into the same problem: I had both java-11-openjdk and java-11-temurin installed. openjdk is a dependency of this package, and does not include either libawt.so or the jni.h header, at least in my installation.

After manually changing the java-11-openjdk dependency and library path to temurin in the PKGBUILD, the package built correctly. You might consider switching the dependency in the package, @carsme.

cknoblauch commented on 2022-06-06 14:21 (UTC)

I cannot build the latest version (4.23-1). This is the output I get:

Building swt...
==> Making package: swt 4.23-1 (Mon 06 Jun 2022 11:17:05 AM -03)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Found swt-4.23-gtk-linux-x86_64.zip
  -> Found build-swt.xml
  -> Found fix-libjawt-detection.patch
==> Validating source files with sha256sums...
    swt-4.23-gtk-linux-x86_64.zip ... Passed
    build-swt.xml ... Passed
    fix-libjawt-detection.patch ... Passed
==> Removing existing $srcdir/ directory...
==> Extracting sources...
==> Starting prepare()...
patching file build.sh
==> Removing existing $pkgdir/ directory...
==> Starting build()...
Buildfile: /tmp/pamac-build-cknoblauch/swt/src/build-swt.xml

init:
   [tstamp] Honouring environment variable SOURCE_DATE_EPOCH which has been set to 1654525023
    [mkdir] Created dir: /tmp/pamac-build-cknoblauch/swt/src/build

compile:
    [javac] Compiling 446 source files to /tmp/pamac-build-cknoblauch/swt/src/build
    [javac] Note: Some input files use or override a deprecated API.
    [javac] Note: Recompile with -Xlint:deprecation for details.

BUILD SUCCESSFUL
Total time: 14 seconds
Buildfile: /tmp/pamac-build-cknoblauch/swt/src/build-swt.xml

jar:
      [jar] Building jar: /tmp/pamac-build-cknoblauch/swt/src/swt.jar

BUILD SUCCESSFUL
Total time: 1 second
==> Entering fakeroot environment...
==> Starting package()...
Cairo found, compiling SWT support for the cairo graphics library.
libjawt.so found, the SWT/AWT integration library will be compiled.
Building SWT/GTK+ for Architectures: linux x86_64
Note: When building multiple GTK versions, a cleanup is required (and automatically performed) between them.
Cleaning up...
rm -f *.o *.so
Building GTK4 bindings:
gcc -O -Wall -fPIC -DSWT_VERSION=4950r5    -DLINUX -DGTK -I/usr/lib/jvm/java-11-openjdk/include -I/usr/lib/jvm/java-11-openjdk/include/linux -DJNI64 -Werror -c swt.c
gcc -O -Wall -fPIC -DSWT_VERSION=4950r5    -DLINUX -DGTK -I/usr/lib/jvm/java-11-openjdk/include -I/usr/lib/jvm/java-11-openjdk/include/linux -DJNI64 -Werror   -c -o c.o c.c
gcc -O -Wall -fPIC -DSWT_VERSION=4950r5    -DLINUX -DGTK -I/usr/lib/jvm/java-11-openjdk/include -I/usr/lib/jvm/java-11-openjdk/include/linux -DJNI64 -Werror   -c -o c_stats.o c_stats.c
gcc -O -Wall -fPIC -DSWT_VERSION=4950r5    -DLINUX -DGTK -I/usr/lib/jvm/java-11-openjdk/include -I/usr/lib/jvm/java-11-openjdk/include/linux -DJNI64 -Werror `pkg-config --cflags gtk4 gtk4-x11 gtk4-unix-print` -DUSE_ASSEMBLER -c callback.c
gcc -O -Wall -fPIC -DSWT_VERSION=4950r5    -DLINUX -DGTK -I/usr/lib/jvm/java-11-openjdk/include -I/usr/lib/jvm/java-11-openjdk/include/linux -DJNI64 -Werror `pkg-config --cflags gtk4 gtk4-x11 gtk4-unix-print` -c os.c
gcc -O -Wall -fPIC -DSWT_VERSION=4950r5    -DLINUX -DGTK -I/usr/lib/jvm/java-11-openjdk/include -I/usr/lib/jvm/java-11-openjdk/include/linux -DJNI64 -Werror `pkg-config --cflags gtk4 gtk4-x11 gtk4-unix-print` -c os_structs.c 
gcc -O -Wall -fPIC -DSWT_VERSION=4950r5    -DLINUX -DGTK -I/usr/lib/jvm/java-11-openjdk/include -I/usr/lib/jvm/java-11-openjdk/include/linux -DJNI64 -Werror `pkg-config --cflags gtk4 gtk4-x11 gtk4-unix-print` -c os_custom.c
gcc -O -Wall -fPIC -DSWT_VERSION=4950r5    -DLINUX -DGTK -I/usr/lib/jvm/java-11-openjdk/include -I/usr/lib/jvm/java-11-openjdk/include/linux -DJNI64 -Werror `pkg-config --cflags gtk4 gtk4-x11 gtk4-unix-print` -c os_stats.c
gcc -O -Wall -fPIC -DSWT_VERSION=4950r5    -DLINUX -DGTK -I/usr/lib/jvm/java-11-openjdk/include -I/usr/lib/jvm/java-11-openjdk/include/linux -DJNI64 -Werror `pkg-config --cflags gtk4 gtk4-x11 gtk4-unix-print` -c gtk4.c
In file included from swt.c:15:
swt.h:26:10: fatal error: jni.h: No such file or directory
   26 | #include "jni.h"
      |          ^~~~~~~
compilation terminated.
In file included from c_stats.c:18:
swt.h:26:10: fatal error: jni.h: No such file or directory
   26 | #include "jni.h"
      |          ^~~~~~~
compilation terminated.
In file included from c.c:18:
swt.h:26:10: fatal error: jni.h: No such file or directory
   26 | #include "jni.h"
      |          ^~~~~~~
compilation terminated.
make: *** [<builtin>: c.o] Error 1
make: *** Waiting for unfinished jobs....
make: *** [make_linux.mak:151: swt.o] Error 1
make: *** [<builtin>: c_stats.o] Error 1
In file included from callback.h:21,
                 from callback.c:18:
swt.h:26:10: fatal error: jni.h: No such file or directory
   26 | #include "jni.h"
      |          ^~~~~~~
compilation terminated.
In file included from os_stats.c:19:
swt.h:26:10: fatal error: jni.h: No such file or directory
   26 | #include "jni.h"
      |          ^~~~~~~
compilation terminated.
make: *** [make_linux.mak:159: os_stats.o] Error 1
In file included from os_structs.c:19:
swt.h:26:10: fatal error: jni.h: No such file or directory
   26 | #include "jni.h"
      |          ^~~~~~~
compilation terminated.
make: *** [make_linux.mak:145: callback.o] Error 1
make: *** [make_linux.mak:155: os_structs.o] Error 1
In file included from gtk4.c:18:
swt.h:26:10: fatal error: jni.h: No such file or directory
   26 | #include "jni.h"
      |          ^~~~~~~
compilation terminated.
make: *** [make_linux.mak:169: gtk4.o] Error 1
In file included from os.c:19:
swt.h:26:10: fatal error: jni.h: No such file or directory
   26 | #include "jni.h"
      |          ^~~~~~~
compilation terminated.
make: *** [make_linux.mak:153: os.o] Error 1
In file included from os_custom.c:16:
swt.h:26:10: fatal error: jni.h: No such file or directory
   26 | #include "jni.h"
      |          ^~~~~~~
compilation terminated.
make: *** [make_linux.mak:157: os_custom.o] Error 1
*** GTK4 Build failed, aborting further actions..
==> ERROR: A failure occurred in package().
    Aborting...

joarod commented on 2021-07-06 19:54 (UTC) (edited on 2021-07-07 08:51 (UTC) by joarod)

Compiling gives javac errors: error: unmappable character for encoding ASCII
Modify file build-swt.xml and include compiler option encoding="UTF-8", line remains like:
<javac srcdir="${src}" destdir="${build}" source="1.8" encoding="UTF-8" />
Update sha256sum in PKGBUILD file: aa13e4954df299c8c450f35677ed14476bb3f467453c2631d2f58d5414c2900d for build-swt.xml
Now makepkg -si should work!

solnce commented on 2021-07-06 09:26 (UTC)

Disowned the package. Turns out I don't need it anymore.

solnce commented on 2021-07-05 17:27 (UTC) (edited on 2021-07-05 17:28 (UTC) by solnce)

Nothing I can do about this, I think.

Edit: Maybe report upstream?

bjo commented on 2021-07-05 17:17 (UTC)

After updating the package:

(2/2) Aktualisierung läuft swt [##############################################] 100% Neue optionale Abhängigkeiten für swt gtk4 ldconfig: /usr/lib/libswt-awt-gtk-4944r26.so ist keine ELF-Datei - sie weist falsche »magische Bytes« am Beginn auf.