lwjgl3: FreeBSD support is missing

Environment

  • LWJGL version: 3.2
  • LWJGL build #: unknown
  • Java version: openjdk 8
  • Platform: FreeBSD 11.1
  • Module: core

Description

The Minecraft 1.12.x game worked just fine under FreeBSD with lwjgl 2.9.x but then when Minecraft 1.13.x came out, they moved up to lwjgl 3.x. Currently the lwjgl 3.x doesn’t have support for FreeBSD.

Seeing as v2.9.x did, is there any changes somebody here could try and add v3.x support for FreeBSD, so we can get the wonderful Minecraft game working again. 😃

Somebody in the FreeBSD web forums have tried to get lwjgl 3.2 to build under FreeBSD 11.1, and here is how far they can. Hopefully this is a good start for anybody with more knowledge, to add the missing piece, or understand the compilation errors. I don’t.

https://forums.freebsd.org/threads/minecraft-11-2-failed-to-locate-library-liblwjgl-so.66923/#post-402189

Here is a copy of that forum message:

With some help on #freebsd freenode, I am attempting to compile lwjgl 3.2 on FreeBSD 11.1-STABLE. I have modified lwjgl’s build.xml file to compile using gcc8.

https://github.com/LWJGL/lwjgl3/blob/2359eb7b5a9e7e629beae95d3cdab8e997c59039/config/linux/build.xml

And here is my modified build.xml, to work with gcc8:

https://paste.pound-python.org/show/Akuv2tbz32OTgSyqZKfJ/

Using the build instruction found here: https://www.lwjgl.org/guide#build-instructions

I am getting the following output: https://paste.pound-python.org/show/8GO6dhwjNrQFu1ddtx2a/

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 3
  • Comments: 67 (13 by maintainers)

Commits related to this issue

Most upvoted comments

I installed FreeBSD on an old machine, resolved the jemalloc issue and made all necessary changes to the LWJGL core. All tests pass and demos work great.

Thanks everyone, 3.3.4-snapshot+2 will include FreeBSD artifacts!

@ivan-volnov 3.3.4-snapshot+2 is now available and includes FreeBSD artifacts. https://www.lwjgl.org/customize has been updated too.

I built lwjgl3 version 3.3.3 (latest at the moment)

I was lazy to learn ant build system so custom cmake file is used here just to build newer glfw (release one doesn’t work)

Most modules were built which is more than enough to run latest version of minecraft

lwjgl3.tar.gz

I’m working on it in my personal capacity, so I can play Minecraft 2.20.2 onwards. This time I’m not backporting the missing functions to a older LWJGL [what I did for MC 1.19.4 to work]. I’m trying a native port with the latest code. I’m going to publish a personal branch this week, and hope the LWJGL devs (or general community) could possibly give me some guidance with some of the C/C++ compiler errors I’m getting during the compile-native-platform stage of building LWJGL. I’m not a C/C++ dev at all, so the compiler errors are somewhat confusing. :face_with_spiral_eyes:

I’ve created a new release for 3.2.3 with the backported GLFW method - required to get MC 1.19.3 to work. 🥳 You can download it here: http://geldenhuys.co.uk/~graemeg/minecraft-freebsd/lwjgl-3.2.3.1-freebsd.tar.7z

It works for the 1.19.4-pre1 release as well.

my motivation is low, seeing as the LWJGL developers aren’t really interested in supporting FreeBSD at all

This is not accurate. We obviously want LWJGL to be usable on more platforms, but every platform/architecture added means increased maintenance burden. Every platform has its quirks (e.g. the libc nightmare on Linux) and LWJGL has a lot of dependencies with all kinds of weirdness, build systems, etc. It has to be worth the effort. Please, don’t forget that LWJGL is maintained by a single person.

But, hey, good news! LWJGL-CI accepts contributions! We already have https://github.com/LWJGL-CI/lwjgl3/pull/3 and I’m sure we can get it to work. The FreeBSD-VM-on-macOS-runner solution seems to be viable. Doing the same for some critical dependencies (e.g. libffi, GLFW, OpenAL-Soft) would be a great step towards adding official support for FreeBSD.

@Spasi FreeBSD 14.0 compilation error about realpath because tinyfd defines old _POSIX_C_SOURCE. I had this patch for it

-#ifndef __sun
+#if !defined(__sun) && !defined(__FreeBSD__)
 #ifndef _POSIX_C_SOURCE
 #define _POSIX_C_SOURCE 2 /* to accept POSIX 2 in old ANSI C standards */
 #endif

Glad to see that there are still people interested in getting this working

For sure. 👍 I have done many comparisons/tests between Linux and FreeBSD on my same hardware. I get way more consistent, and higher FPS under FreeBSD and less lag spikes. So FreeBSD still stays my favourite operating system, to run my favourite game. 😄

As for the various minecraft lwjgl forks. They all pretty much do the same thing. Someone (can’t remember who) just realised that they can tweak the minecraft runtime script (included with those forks) so it ignores the exact LWJGL version that MC needs. Minecraft 1.17 -> 1.19.2 don’t seem to use different API calls, even though Minecraft changed the LWJGL versions they use. So the original LWJGL 3.2.2 still works. But as I mentioned, we need to update it for 1.19.3 to work - I’m on it!

I’m on FreeBSD 13.1 and the forks work for Minecraft up to MC v1.19.2 without issue. I’m using the [https://github.com/patrickSpaceSurfer/lwjgl3-port] fork.

The Minecraft 1.19.3 release uses a new LWJGL API call org.lwjgl.glfw.GLFWImage.malloc(int intArg, org.lwjgl.system.MemoryStack memStack) that isn’t in the forks. I tried to backport that API call, but the code that auto-generates the JNI java code, doesn’t seem to see my change for some reason. To be honest, I haven’t tried very hard to get it working, as there isn’t a big change in 1.19.2 and 1.19.3 (regarding game features). I do want to look at it again though, before the 1.20 Minecraft release comes out. 😃

On a side note: I am working on implementing full FreeBSD support in LWJGL though (not using the “linux” workaround that the forks do) - but my motivation is low, seeing as the LWJGL developers aren’t really interested in supporting FreeBSD at all. Multiple people (including myself) offered to supply a CI build environment etc, but still nothing. So us FreeBSD folks will have to keep at it the hard way. 😦

I’m looking forward to seeing freebsd support added

I think this page could help a little bit about FreeBSD CI: https://wiki.freebsd.org/HostedCI