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)
Oct 18 2024, 11:40 AM
Unknown Object (File)
Oct 9 2024, 6:56 AM
Unknown Object (File)
Oct 7 2024, 1:21 AM
Unknown Object (File)
Oct 3 2024, 6:56 PM
Unknown Object (File)
Oct 1 2024, 12:43 PM
Unknown Object (File)
Oct 1 2024, 10:36 AM
Unknown Object (File)
Oct 1 2024, 8:10 AM
Unknown Object (File)
Sep 28 2024, 3:12 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 Skipped
Unit
Tests Skipped

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
110

Can't the dynamic library be used there?

140

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
110

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

140

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
110

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

140

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

games/lwjgl3/Makefile
110

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

140

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

games/lwjgl3/Makefile
140

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

games/lwjgl3/Makefile
140

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
140

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.