Is there a way to get CLI-only LibreOffice on a server?

I am looking for a way to convert generated DOCX files to DOC format on a FreeBSD server. LibreOffice’s –convert-to parameter would be very well, but I couldn’t compile LibreOffice on the server. As far as I understood the messages, LibreOffice’s dependencies require X to be installed.

How can I get a no-GUI, CLI-only version of LibreOffice with just –convert-to support?

The --headless option will cause no GUI at all, so use that.

There is no special CLI only version, and yes, to build LO you would need the X11 development packages. Running it headless doesn’t require X.

Compilation ends with this:
gtk-update-icon-cache-2.24.6_1: Needs cairo built with X11 support.
What do I need to do?
(Sorry, I’m very new to FreeBSD, and I don’t know anything about ports system.)