Page MenuHomeFreeBSD

Add all-in-one port for `net-mgmt/unifi5` based on `java/openjdk11`, `java/openjdk12` or `java/openjdk13`
Needs ReviewPublic

Authored by lev on May 27 2019, 3:21 PM.



Now net-mgmt/unifi5 port depends on java/openjdk8 which is huge and it could not be packaged with openjdk8-jre without manual editing manifests (baaaad!).
New JDKs (9, 10, 11, 12) doesn't have JREs, but they have ability to anayze application (jdeps utility) and prepare JRE with modules which are required (jlink utility).

This port allows to make self-contained unifi5 controller, packed with such custom JRE. It doesn't include databases/mongodb36, buit it needs only mongodb36 as runtime dependency and nothing more.

Embedded JRE adds about 47MiB (unpacked) and openjdk8 (default installation) is 190MiB, it is 147MiB improvement. openjdk8-jre is 95MiB, so it is 54MiB improvement, and installation with openjdk8-jre requires mending with packages and/or installation with -f flag to skip required dependency.

It could be useful for embedded-like platforms.

I like to make this port to be option to net-mgmt/unifi5 but it is very hard to do, as it could not use USE_JAVA infrastructure. This port copy content of built (!) archivers/snappy-java package inside itself, so it requires both openjdk8 (for snappy-java) and openkdk11 (or 12) for build time and conflicts with snappy-java on installation.

If @feld have some ideas how to merge this port with net-mgmt/unifi5, I'm happy to listen and don't make separate port!

Diff Detail

Lint Skipped
Unit Tests Skipped

Event Timeline

lev created this revision.May 27 2019, 3:21 PM
mat added inline comments.Jun 8 2019, 6:21 PM

Options should happen later in the Makefile. See Chapter 15. Order of Variables in Port Makefiles.


Why +=?


Should happen later in the Makefile.


This case can never happen. OPTIONS_SINGLE means that one option MUST be selected.


No need for a second target here, put it in do-install.

lev updated this revision to Diff 68114.Feb 11 2020, 2:24 PM

Address comments.
Add JDK13 support.

lev marked 4 inline comments as done.Feb 11 2020, 2:25 PM
lev updated this revision to Diff 68115.Feb 11 2020, 2:29 PM
lev marked an inline comment as done.
lev updated this revision to Diff 68119.Feb 11 2020, 4:06 PM

portlint nitpicks have been fixed.

lev updated this revision to Diff 68121.Feb 11 2020, 5:06 PM
lev retitled this revision from Add all-in-one port for `net-mgmt/unifi5` based on `java/openjdk11` or `java/openjdk12` to Add all-in-one port for `net-mgmt/unifi5` based on `java/openjdk11`, `java/openjdk12` or `java/openjdk13`.

Add license

mat added a comment.Feb 12 2020, 2:26 PM

What is gained by this port? Doesn't net-mgmt/unifi5 just work?


So, basically, a package that will never ever be created.

Why add it in the first place?


This is getting too clever, it is better to write your own do-extract target.

lev added a comment.Feb 12 2020, 4:59 PM
In D20429#518971, @mat wrote:

What is gained by this port? Doesn't net-mgmt/unifi5 just work?

It works, but it requires full (and old, EOL) java/openjdk8 as runtime dependency which results in additional 147MiB of files installed (please, look at diff summary for numbers). When you build NanoBSD image for small system, additional 147MiB could double your image size easily. There is no official way to install java/openjdk8-jre as runtime dependency, and if your hack package (by editing manifest) or install net-mgmt/unifi5 without java/openjdk8 (with pkg add -f), combination of net-mgmt/unifi5 and java/openjdk8-jre will be 54MiB larger than result of this port, still.

So, basically, a package that will never ever be created.

This package WILL be created by user's local poudriere, which is goal for me. Nothing forbids user to re-pack this software for its own use, without redistribution. This port allows people who builds their own routers, NASes and such, to add this software in consistent and FreeBSD'ish way, without hacks or custom scripts, as any other package which is needed on such systems, like unbound, isc-dhcpd, and alike.

To be honest, such license and restrictions MUST be added to net-mgmt/unifi5 too. Absence of custom license (EULA) is bug in net-mgmt/unifi5 port (and I have plans to report it, too).