Page MenuHomeFreeBSD

games/lwjgl3: new port - required for games/minecraft-client 1.20.x
ClosedPublic

Authored by vvd on Mar 7 2024, 3:53 PM.
Tags
Referenced Files
Unknown Object (File)
Fri, Apr 26, 4:00 AM
Unknown Object (File)
Mon, Apr 22, 2:32 AM
Unknown Object (File)
Sun, Apr 21, 6:59 PM
Unknown Object (File)
Sun, Apr 7, 6:49 AM
Unknown Object (File)
Fri, Apr 5, 10:40 AM
Unknown Object (File)
Fri, Mar 29, 1:58 PM
Unknown Object (File)
Mar 14 2024, 5:24 PM
Unknown Object (File)
Mar 14 2024, 11:55 AM

Details

Summary

This port required for games/minecraft-client (Java Minecraft Client) 1.20.x run on FreeBSD without linux compatibility layer.

Upstream support FreeBSD on amd64 only, but on linux they support i386, arm* and ppc* too - if somebody can and want to add support for other arches - welcome.

Tested build in poudriere and in live system 13.2-p10 amd64.

Some details are here: https://github.com/LWJGL/lwjgl3/issues/421#issuecomment-1964114740

The port have a lot of "controversial decisions" and hacks now.

Diff Detail

Repository
R11 FreeBSD ports repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

vvd requested review of this revision.Mar 7 2024, 3:53 PM
vvd updated this revision to Diff 135498.
vvd created this revision.
games/lwjgl3/Makefile
109

Can't the dynamic library be used there?

139

libc.so.[0-9] would be better there.

I get a linker error on current:

   [Linker] ld: error: relocation R_X86_64_32S cannot be used against symbol '.Lswitch.table.ffi_prep_cif_machdep_efi64'; recompile with -fPIC
   [Linker] >>> defined in /wrkdirs/usr/ports/games/lwjgl3/work/lwjgl3-de8bd86/bin/libs/native/freebsd/x64/org/lwjgl/libffi.a(ffiw64.o)
   [Linker] >>> referenced by ffiw64.o:(ffi_prep_cif_machdep_efi64) in archive /wrkdirs/usr/ports/games/lwjgl3/work/lwjgl3-de8bd86/bin/libs/native/freebsd/x64/org/lwjgl/libffi.a
   [Linker]
[...]

I get a linker error on current:

   [Linker] ld: error: relocation R_X86_64_32S cannot be used against symbol '.Lswitch.table.ffi_prep_cif_machdep_efi64'; recompile with -fPIC
   [Linker] >>> defined in /wrkdirs/usr/ports/games/lwjgl3/work/lwjgl3-de8bd86/bin/libs/native/freebsd/x64/org/lwjgl/libffi.a(ffiw64.o)
   [Linker] >>> referenced by ffiw64.o:(ffi_prep_cif_machdep_efi64) in archive /wrkdirs/usr/ports/games/lwjgl3/work/lwjgl3-de8bd86/bin/libs/native/freebsd/x64/org/lwjgl/libffi.a
   [Linker]
[...]

I forgot to say that devel/libffi must be build with CFLAGS+=-fPIC in Makefile.
Added kbowling@ (maintainer of the devel/libffi) to CC.

games/lwjgl3/Makefile
109

This is more of a question for upstream - they did so.

139

What to do when becomes libc.so.10?

games/lwjgl3/files/patch-modules_lwjgl_jemalloc_src_generated_java_org_lwjgl_system_jemalloc_JEmalloc.java
53

This part can be removed.

games/lwjgl3/Makefile
109

Well, try the .so, don't blindly follow upstream.

139

Right, maybe libc.so.[0-9]* then...

games/lwjgl3/Makefile
109

The build system aims to link statically with this library. For all platforms.
I don't know how to fix this quickly.

139

How is this different from libc.so.* then?

games/lwjgl3/Makefile
139

I checked 11.4, 12.4, 13.2, 13.3, 14.0 - all have libc.so.7.
No bumps.

games/lwjgl3/Makefile
139

How is this different from libc.so.* then?

Who knows what this wildcard might match. I've seen libraries ending with .full and it also might be a .debug suffix. I still think that [0-9] is fine and when we get to 10, the port would just need to be updated.

Statically linking to libffi is still a show-stopper. It shouldn't be required.

Explanation why upstream use static link with libffi: https://github.com/LWJGL/lwjgl3/issues/421#issuecomment-1992147241
I also ask to help explain to upstream what ports are and what the work of maintainers is.
My English is too bad to do this correctly even with the help of online translators.

vvd added inline comments.
games/lwjgl3/Makefile
139

I hardcoded in patch libc.so.7.
After bump (in 15? in 16?) I'll update port.

Replaced static link with libffi with dynamic!

vvd marked 2 inline comments as done.Mar 14 2024, 9:42 AM
This revision is now accepted and ready to land.Mar 14 2024, 11:54 AM

Don't forget to add the port to games/Makefile.

Better handle with libffi.

This revision now requires review to proceed.Mar 14 2024, 4:22 PM
This revision is now accepted and ready to land.Mar 14 2024, 4:28 PM
This revision was automatically updated to reflect the committed changes.