BiglyBT icon indicating copy to clipboard operation
BiglyBT copied to clipboard

add support for raspberrypi

Open moham96 opened this issue 7 years ago • 24 comments

Hi, I'm running biglybt on raspberrypi using the swt jar that comes with the raspberrypi and was wondering if you could add upstream support without the need to modifly files ? what i did is after extracting biglybt files i installed the libswt package apt install libswt-gtk-4-java libswt-cairo-gtk-4-jni then i copy the lib to biglybt folder cp /usr/lib/java/swt-gtk-4.6.0.jar ~/biglybt/swt.jar then biglybt runs without problem Could you add these changes upstream ? Ps:I think that in the moveInSWT function uname -p needs to be changed to uname -m uname -p output unknown uname -m output armv7l

moham96 avatar Jan 19 '18 06:01 moham96

@TuxPaper any update on this?

moham96 avatar Aug 26 '18 08:08 moham96

Is the libswt for raspberry pi the same as the debian one? https://packages.debian.org/search?keywords=libswt-gtk-4

Perhaps we could support both at the same time. I'd need a way to detect debian and/or raspberypi similar to uname. Preferably if raspberry pi returns 'debian' somewhere then there'd only need to be one check.

TuxPaper avatar Dec 23 '18 19:12 TuxPaper

@TuxPaper Yes I think the package is the same(the raspbian package is packaged and signed by the debian team) it just uses different architecture. but don't you think it's better to find a way to use the distro's own swt.jar instead of packaging it with each release of biglybt ?for example I've migrated my raspberry pi from using raspbian to archlinuxarm which uses different packages but should contain a package for swt.

moham96 avatar Jan 07 '19 09:01 moham96

Historically, we didn't use distros SWT because they were either several versions behind, or we couldn't guarantee crashing on newer SWT versions. This mainly stems from years ago when many widgets would act differently from week to week, and we couldn't code workarounds for so many variations.

Linux SWT is somewhat more stable now, and we tend to not use new SWT features anymore, so we may re-examine the police of bundling every SWT.

Thanks for the information on the package. I'll look into it some more when I have more time

TuxPaper avatar Jan 07 '19 11:01 TuxPaper

Hi, Debian maintainer here, the SWT package is fairly up to date nowadays, Ubuntu 18.04 LTS has SWT 4.9, Debian 10 has SWT 4.10 and the next Ubuntu LTS should have at least 4.12, maybe 4.14.

ebourg avatar Dec 29 '19 21:12 ebourg

Our startup script has some interesting code and comments related to finding the jar files. Namely, we add jna.jar to the classpath, by searching several paths ending in */share/java, but also comment that SWT is stored in /usr/lib/java.
This begs the question of whether it's truly always installed to /usr/lib/java, or perhaps on some distros it gets installed to /usr/share or some weird place. Presumably (or hopefully), there's a XDG path variable we could use to hunt for the swt.jar. I'd want to avoid a "just call whereis and loop through" situation, but if there's no path variable, perhaps there's a standard command now that returns the path of an installed package (although that introduces the problem of different distros using different package names for SWT)

SHARED_JAR_CHECK_DIRS="/usr/share/java /usr/local/share/java ${LOCALBASE}/share/java"
for JNADIR in $SHARED_JAR_CHECK_DIRS; do
	if [ -f "${JNADIR}/jna.jar" ]; then
		CLASSPATH="${CLASSPATH:+${CLASSPATH}:}${JNADIR}/jna.jar"
		break
	fi
done

#Note: package eclipse-swt is stored in /usr/lib/java, but is usually outdated
#      and often has different UI quirks that we haven't worked around yet

TuxPaper avatar Dec 30 '19 18:12 TuxPaper

On Debian and its derivatives (Ubuntu, Mint, etc) the system jar files are installed in /usr/share/java.

ebourg avatar Dec 30 '19 20:12 ebourg

I previously had everything working on a Raspberry pi 4 stretch and then buster but after a clean install with bullseye I can't seem to fix the swt library issues

I tried the following but it complains about having the wrong .so file (when I check it, the file is indeed not for ARM via the following command)

apt install libswt-gtk-4-java libswt-cairo-gtk-4-jni then i copy the lib to biglybt folder cp /usr/lib/java/swt-gtk-4.6.0.jar ~/biglybt/swt.jar

I tried getting another .so file but then I get some internal swt errors

Shusshu avatar Dec 20 '21 15:12 Shusshu

java.lang.unsatisfiedlinkerror 'int org.eclipse.swt.internal.c.ptr_sizeof()'

Shusshu avatar Dec 22 '21 15:12 Shusshu

I don't have anything to test with I'm afraid :(

parg avatar Dec 22 '21 16:12 parg

Are you running 64-bit Java? If so what happens if you grab the swt-4.20-gtk-linux-aarch64.zip zip from https://download.eclipse.org/eclipse/downloads/drops4/R-4.20-202106111600/#SWT and use the swt.jar from that?

parg avatar Dec 22 '21 17:12 parg

32 bit java

Shusshu avatar Dec 22 '21 19:12 Shusshu

I took swt 4.9 from the official source too https://archive.eclipse.org/eclipse/downloads/drops4/R-4.9-201809060745/ but it never works

maybe something to do with the .so files in /home/pi/.swt/lib/linux/arm

Shusshu avatar Dec 22 '21 19:12 Shusshu

You need the aarch version, no? Can you install 64 bit java?

parg avatar Dec 22 '21 20:12 parg

I'm running Raspberry pi bullseye OS in 32 bit so I guess I can't run java 64 bit

Shusshu avatar Dec 23 '21 09:12 Shusshu

ah, thought it was 64 bit. oh well

parg avatar Dec 23 '21 09:12 parg

FYI recent versions of SWT no longer support 32 bit

ebourg avatar Dec 23 '21 16:12 ebourg

exactly

parg avatar Dec 23 '21 17:12 parg

Could someone with a working biglybt on raspberry pi send me the swt.jar ?

Shusshu avatar Jan 01 '22 15:01 Shusshu

swt.zip

extract the .jar from the .zip

parg avatar Jan 01 '22 16:01 parg

Capture2

this is driving me nuts

Shusshu avatar Jan 01 '22 19:01 Shusshu

swt.zip I managed to get it working with this swt.jar But I can't open the option screen. It says BiglyBt core needs to initialise...

Shusshu avatar Jan 22 '22 13:01 Shusshu

No errors logged in the console or to the debug_1/2.log files?

parg avatar Jan 23 '22 10:01 parg

swt problems ofc The console is broken too debug files contains this issue [stderr] java.lang.NoClassDefFoundError: Could not initialize class org.eclipse.swt.internal.accessibility.gtk.ATK

and also

[14:59:49] [stderr] DEBUG::Sun Jan 23 14:59:49 CET 2022::com.biglybt.ui.swt.pifimpl.UISWTViewImpl::triggerEvent::299:
[14:59:49] [stderr]   ViewID=LoggerView; EventID=Init; data=Composite {}
[14:59:49] [stderr]     BaseMdiEntry::triggerEvent::657, UISWTViewImpl::swt_triggerInitialize::659, UISWTViewImpl::triggerBooleanEvent::363, UISWTViewImpl::triggerEvent::299, BaseMdiEntry::triggerEvent::657, BaseMdiEntry::show::718, SideBarEntrySWT::swt_show::596, SideBarEntrySWT::access$1500::64, SideBarEntrySWT$7::runSupport::570, AERunnable::run::36, RunnableLock::run::40, Synchronizer::runAsyncMessages::185, Display::runAsyncMessages::4906, Display::readAndDispatch::4475, SWTThread::<init>::400, SWTThread::createInstance::58, Initializer::<init>::181, UI::takeMainThread::136, Main::main::247, NativeMethodAccessorImpl::invoke0::-2, NativeMethodAccessorImpl::invoke::62, DelegatingMethodAccessorImpl::invoke::43, Method::invoke::498, Launcher$1::run::48, Thread::run::748
[14:59:49] [stderr] java.lang.UnsatisfiedLinkError: Could not load SWT library. Reasons: 
	no swt-atk-gtk-4922r32 in java.library.path
	no swt-atk-gtk in java.library.path
	/usr/lib/jni/libswt-atk-gtk-4922r32.so: /usr/lib/jni/libswt-atk-gtk-4922r32.so: file too short
	Can't load library: /usr/lib/jni/libswt-atk-gtk.so
	Can't load library: /home/pi/.swt/lib/linux/arm/libswt-atk-gtk-4922r32.so
	Can't load library: /home/pi/.swt/lib/linux/arm/libswt-atk-gtk.so
[14:59:49] [stderr] 

Shusshu avatar Jan 23 '22 14:01 Shusshu