On 2023/04/21 14:56, Steve Williams (Contractor) wrote:
> Hi,
>
> I am running Nextcloud and it can now use an external service to
> render thumbnails that's (allegedly) much faster than the php
> Imagick stuff.
>
> Of course, it's built for docker... I was considering to see if
> it's possible/worth the effort to do a port for it.
>
> https://github.com/h2non/imaginary
Written to work easily in Docker but it isn't needed.
> From following the ports list, I believe there's support for
> easily porting go applications in the OpenBSD ports
> infrastructure.
It's easy if the program only uses things which work in OpenBSD, doesn't
need patching, and is supported by "portgen go" - fortunately this is
the case here. For some other software it's a complete nightmare.
Start with "portgen go github.com/h2non/imaginary", add a LIB_DEPENDS
on graphics/libvips (also fortunately this is already ported). That
will be enough to get it building, then you need to add a license marker
in place of the "unknown" and set PERMIT_PACKAGE (remove portgen's
default PERMIT_DISTFILES line as that defaults to the value of
PERMIT_PACKAGE).
Then you are into standard ports things like generating PLIST, setting
WANTLIB (use "make port-lib-depends-check"), writing DESCR, and as it's
a daemon providing an rc script (crib from another go port that provides
a web service - www/honk is probably a good one to borrow from, though
try to avoid setting a pexp with .*, use the default if it works but if
not then try to include ${daemon_flags} in the string). You'll also need
to create a uid (@newuser in PLIST) so it doesn't run as root.