Bug 255349

Summary: [new port] games/minecraft16: lets you run latest Minecraft on FreeBSD
Product: Ports & Packages Reporter: glowiak1111
Component: Individual Port(s)Assignee: Kubilay Kocak <koobs>
Status: Open ---    
Severity: Affects Only Me CC: Alexander88207, freebsd, fuz, gac, glowiak1111, grahamperrin, ivan, koobs
Priority: --- Keywords: feature, needs-qa
Version: Latest   
Hardware: Any   
OS: Any   
URL: http://codeberg.org/glowiak/minecraft16
See Also: https://github.com/LWJGL/lwjgl3/issues/421
Description Flags
minecraft16v4.shar.bz2 none

Description glowiak1111 2021-04-23 18:54:09 UTC
LWJGL3 Minecraft Client
Comment 1 Kubilay Kocak freebsd_committer freebsd_triage 2021-04-24 01:35:56 UTC

 - Is this a new port request?

If so, please provide a patch against the ports tree to add the port. If you need help/support porting, /join #freebsd-ports on freenode and checkout the Porters Handbook: https://www.freebsd.org/doc/en_US.ISO8859-1/books/porters-handbook/

 - How is this related to the existing games/minecraft-client port?
Comment 2 glowiak1111 2021-04-24 07:39:12 UTC
(In reply to Kubilay Kocak from comment #1)
This port provides LWJGL3, which is needed to play latest Minecraft
Comment 3 glowiak1111 2021-04-24 08:16:58 UTC
(In reply to Kubilay Kocak from comment #1)
games/minecraft16 already contains games/minecraft-client's things + LWJGL3 + LWJGL3 java runtime
Comment 4 Kubilay Kocak freebsd_committer freebsd_triage 2021-04-24 09:45:24 UTC
(In reply to glowiak1111 from comment #3)

If this port is committed, would/should games/minecraft-client then use it?

What is this (lwgl3) codes relation to games/lwjgl (2.9.x)? 

Is it the same thing or duplicative, as in, should that port be updated to 3.x using these sources?

I note games/lwjgl was last updated in Jan 2015.

Also noting that https://github.com/LWJGL/lwjgl3 exists, shouldn't that be ported/added to replace or live along side games/lwjgl ?
Comment 5 Kubilay Kocak freebsd_committer freebsd_triage 2021-04-24 09:46:47 UTC
See Also: https://github.com/johalun/lwjgl3-port
Comment 6 glowiak1111 2021-04-24 11:10:41 UTC
(In reply to Kubilay Kocak from comment #4)
This port should replace games/minecraft-client.
Comment 7 glowiak1111 2021-04-24 12:41:29 UTC
(In reply to Kubilay Kocak from comment #5)
The orginal lwjgl3-port doesn't work with Minecraft newer than 1.14.2 and isn't official port
Comment 8 Kubilay Kocak freebsd_committer freebsd_triage 2021-04-25 00:18:21 UTC
(In reply to glowiak1111 from comment #7)

What's the most official source(s) for minecraft client?
Comment 9 IvanV 2021-04-25 05:44:40 UTC
Hello, as I understand it's a binary only port. Contains precompilled binaries for x64.
So we can't port it to the other archs.

It also don't include the game launcher. So it can't replace games/minecraft-client. I's a java library for using with any other launcher, for instance games/multimc 

I believe the best thing we can do is to help upstream libraries with FreeBSD support.
Yesterday I managed to help with FreeBSD CI on LWJGL project. I hope my PR will be merged.

I also tried to build LWJGL v3 on FreeBSD, but currently no luck. 

My unfinished PR I is posted here:

If anybody can help, please do it. I have no experience in Java. I suggest we can ask current maintainer of lwjgl port to update.
Comment 10 IvanV 2021-04-25 05:54:50 UTC
(In reply to Kubilay Kocak from comment #8)

The most official source for minecraft client is:

There is also https://github.com/Mojang but they haven't posted the code of the laucher yet.

We can look at Arch's package. Currently it's the most feature-rich one.
It's exactly the link you go from the official site to download Arch release.
Comment 11 IvanV 2021-04-25 06:07:05 UTC
For better understanding:

Game Launcher (auth, download java binaries, update, manage versions, configs) -> Java Game -> Libraries (one of them is LWJGL)
Comment 12 glowiak1111 2021-04-25 07:06:14 UTC
(In reply to IvanV from comment #9)
No, this isn't x64 only. You even know anything about java? java binaries are multiplatform, multiarch. You can use it even on powerpc64 or something like that
Comment 13 glowiak1111 2021-04-25 11:16:06 UTC
(In reply to IvanV from comment #9)
minecraft16 includes unofficial Mineshafter Launcher, so can replace minecraft-client. The Libraries are multiplatform, and are stored in /usr/local/share/minecraft16/lwjgl3/native-libs and /usr/local/share/minecraft16/lwjgl3/lwjgl3/bin
Comment 14 IvanV 2021-04-25 12:02:26 UTC
(In reply to glowiak1111 from comment #12)
While editing build.xml file of LWJGL library I found out that It also has native libraries.

In the file:
A lot of mentions about .so, .dylib and .dll libraries.
Comment 15 IvanV 2021-04-25 12:04:02 UTC
So, native-libs - is a native. Not cross platform. They must be compilled for every single platform
Comment 16 Kubilay Kocak freebsd_committer freebsd_triage 2021-04-26 00:58:29 UTC
(In reply to IvanV from comment #9)

Thank you for your feedback Ivan

Can you point/reference us to the freebsd ci pr/issue mentioned ("FreeBSD CI on LWJGL") or is LWJGL/lwjgl3/pull/645 that?

Id like to understand the goal in terms of a 'good target state' including:

 - minecraft server & client (as official as possible)
 - launcher
 - required or related or additional libraries

What is the ideal target port/package structure/list at the end?
Comment 17 IvanV 2021-04-26 03:35:49 UTC
(In reply to Kubilay Kocak from comment #16)

The CI PR I mentioned is:
This link has been already in See Also section of this bug.

Minecraft server's official site is:

The games/minecraft-server port is actual and full featured.

The ideal minecraft-client port is a port of this:
Or from this link (Other distributions):
May be we can try it with linux compatibility layer?

There is also a bug on the game developer site:

Minecraft client as it is - is hosted on the developer's site and there are a lot of their versions available. So, no point to add it into the ports. Just add a launcher.

glowiak knows more about the depended libraries, because he managed it to build. But I suppose we need build scripts instead of build resulting binaries
Comment 18 glowiak1111 2021-04-26 06:11:58 UTC
(In reply to IvanV from comment #15)
native-libs is only directory name. Do you even know anything about java? This libs works on every platform that supports Java
Comment 19 glowiak1111 2021-04-26 06:15:57 UTC
(In reply to IvanV from comment #17)
Do you even play Minecraft??? Latest version that runs on FreeBSD is 1.6.89-j, while the newest 921. This old launcher doesn't support running newer Minecraft than 1.14.2, so minecraft16 uses unofficial Mineshafter ( http://mineshafter.info )launcher, which is one of launcher that supports it (1.6.89-j was released in 2018 - before switching to LWJGL3)
Comment 20 glowiak1111 2021-04-26 11:46:50 UTC
(In reply to IvanV from comment #17)
Read this: https://codeberg.org/glowiak/minecraft16/#a-problem section of project site, to know why I'm providing binaries instead of build scripts
Comment 21 Alexander Vereeken 2021-05-01 13:39:46 UTC
Created attachment 224594 [details]

Hello, glowiak1111@yandex.com

I admire your enthusiasm to run modern versions of minecraft on FreeBSD and am glad to help.

Using an external launcher is correct and not really objectionable since MS no longer provides java binaries.

AFAIK, the thing that might be a problem is that you have to build, provide and maintain your binaries for all FreeBSD versions do you want to continue to go that way?

FYI: https://github.com/LWJGL/lwjgl3/pull/645
Comment 22 Alexander Vereeken 2021-05-01 13:47:15 UTC
PS: games/multimc seems to be a good replacement to run modern versions so I think it should first taken care of lwjgl3.
Comment 23 glowiak1111 2021-05-05 06:28:45 UTC
(In reply to Alexander Vereeken from comment #21)
I'm creating universal installer, that fixes not-build bug (you have to rm -rf /usr/local/lib/cmake). Should be done today.
Comment 24 glowiak1111 2021-05-05 06:53:41 UTC
(In reply to Alexander Vereeken from comment #21)
Okay, the build script is done and works (it deleted /usr/local/lib/cmake dir). Now I'm creating Makefile that build libs from source and places everything in correct places. Today I'll complete it and I'll submit the final shar
Comment 25 glowiak1111 2021-05-05 07:56:26 UTC
Created attachment 224681 [details]
Comment 26 glowiak1111 2021-05-05 07:59:51 UTC
(In reply to Alexander Vereeken from comment #21)
Okay, the Makefile is done. pkg-plist is pretty large (1mb), so the shar is compressed with bzip2. The file is named minecraft16v2.shar.bz2. The new Makefile, builds libs from source, and places files in correct places.
Comment 27 Alexander Vereeken 2021-05-05 10:30:04 UTC

RUN_DEPENDS=	openjdk8>0:java/openjdk8

Please use USE_JAVA for that.

RUN_DEPENDS=   cmake>0:devel/cmake

This looks like a build depedency user BUILD_DEPENDS= for that.

@fetch --no-verify-peer -o ${STAGEDIR}/usr/loca.......

Fechting during the build, install phase doesnt look right.

You can define more master sites and distfiles.
Comment 28 glowiak1111 2021-05-05 11:29:36 UTC
(In reply to Alexander Vereeken from comment #27)
This is like FreeBSD and OpenBSD. FreeBSD places all the things under one partition, while in OpenBSD every directory is on separated partition. openjdk8 is needed to build, so I placed it in RUN_DEPENDS. That's a lot easier and suckless.
I did with suckless method. I don't want huge, complicated Makefiles. One, suckless Makefile that does all the things in one function.
Comment 29 Alexander Vereeken 2021-05-05 21:46:48 UTC
I did not want to annoy you but a correct makefile is important because it is important to avoid unnecessary things... For example, cmake is installed for every user, even those who use the port in binary form. This is not correct.

You may like such makefiles it, but those who review it will give you the same and more advice's until it looks perfect.

I can help you with this with pleasure if you want that.
Comment 30 glowiak1111 2021-05-06 05:21:44 UTC
(In reply to Alexander Vereeken from comment #29)
Ahhh, you mean this. So, I'll move git, cmake, ant and some other build deps to BUILD_DEPENDS
Comment 31 glowiak1111 2021-05-06 05:27:31 UTC
Created attachment 224720 [details]
Comment 32 glowiak1111 2021-05-06 05:29:13 UTC
(In reply to Alexander Vereeken from comment #29)
Okay, I fixed it
Comment 33 IvanV 2021-05-08 04:12:59 UTC
What is traktor.txt and why does it present there?
Comment 34 IvanV 2021-05-08 04:27:19 UTC
I also believe some directories doesn't have to be installed, for instance:

And may be the whole source dir isn't expected to be installed?

Open the shar file in a text editor and look at it
Comment 35 glowiak1111 2021-05-08 06:33:00 UTC
(In reply to IvanV from comment #33)
This is file needed only to create directories in git services
Comment 36 glowiak1111 2021-05-08 06:34:01 UTC
(In reply to IvanV from comment #34)
This is needed to work
Comment 37 glowiak1111 2021-05-08 08:43:00 UTC
Created attachment 224767 [details]

Fixed "_" version bug
Comment 38 Robert Clausecker 2021-05-16 09:36:04 UTC
How is this bug fixed?  I don't see the port committed anywhere.
Comment 39 Kubilay Kocak freebsd_committer freebsd_triage 2021-06-09 01:22:12 UTC
^Triage: Re-open pending resolution. 

We'd like to get minecraft updated in ports using as close to official sources as possible. I need help understanding the various parts and how that maps to changes that need to be made in ports.