# Libreoffice with CUPS option off



## nickednamed (Apr 27, 2017)

Hi all,

Is it possible to print from Libreoffice having compiled it without CUPS support?

I went through quite a bit of trouble getting my printer to work with LPD (works flawlessly), and was encouraged to do so because it's is the base system, and can do everything I need it to, etc.

I've also moved to using ports-mgmt/synth to manage my packages, and I would like to disable unneeded options to keep build time to a minimum.

Now it seems after all that I need to keep CUPS on my system (and keep rebuilding it and its build/runtime dependencies), even if I don't use it directly.

I thought THIS and THIS meant the problem had been solved, but I guess not.

I've tried copying /usr/local/lib/libreoffice/share/psprint/psprint.conf to ~/.config/libreoffice/user/psprint/psprint.conf, editing it as described HERE, but it didn't help.


----------



## MarcoB (Apr 27, 2017)

This problem exists for a long time afaik. I try to use lpd and avoid cups too, but it always gets pulled in by some dependency. Qt5 applications require cups too for printing unfortunately. The solution lies upstream at LibreOffice, they removed the ability to print with lpd.


----------



## nickednamed (Apr 28, 2017)

Bummer. It seems strange that editors/libreoffice won't work with print/cups disabled, seeing as how there is a compile-time option to disable it. Unless someone out there knows otherwise...

Worse still, it was still downloaded, built and installed by something even when I had added `OPTIONS_UNSET = CUPS` to my /etc/make.conf. So I tried to find out what.

`pkg info -r cups-2.2.2_1`

```
cups-2.2.2_1:
   qt5-printsupport-5.7.1
   gtk2-2.24.29_3
   ghostscript9-agpl-base-9.16_5
   qt4-gui-4.8.7_2
   scribus-1.4.6_6
   libreoffice-5.2.6_1
   foomatic-filters-4.0.17_9
```

Of these, x11-toolkits/qt4-gui, print/scribus have a hard-coded dependency on print/cups, as there is no option to disable it. And according to `make all-depends-list` print/foomatic-filters will need print/cups (though indirectly) even with the option "CUPS_IMAGE" turned off.

I once wrote about trying to get my printer working with LPD (without CUPS); turns out I was only half-successful :/


----------



## MarcoB (Apr 28, 2017)

Yeah, I also have a lot of Gnome stuff in my /etc/make.conf. But it's really hard to keep things like CUPS off your system. There's always some dependency of a dependency which requires Gnome ports. The requirement of GTK3 is becoming a problem now too imo (Firefox, LibreOffice in the near future).


----------



## Deleted member 9563 (Apr 28, 2017)

MarcoB said:


> But it's really hard to keep things like CUPS off your system. There's always some dependency of a dependency . . .  .



I've noticed this CUPS problem too. Since it's not actually a dependency I would have hoped that developers would have control over it. This situation reminds me of the MS-Windows horror stories that I hear.


----------



## MarcoB (Apr 28, 2017)

I think CUPS is pulled in by GTK3, and when more and more applications make the switch to GTK3, CUPS is becoming inevitable. I've noticed that most Qt5 applications require CUPS for printing and LPD is discarded, same for LO. In these cases I just print to PDF and use Xpdf for printing.


----------



## nickednamed (Oct 22, 2017)

So in case anyone stumbles onto this thread wondering whether it is possible to print from Libreoffice CUPS=OFF - I haven't managed it.

I actually even went as far as to configure CUPS for use, seeing as it is installed anyway.

Now I am able to use a few more of my printer's options (such as long-side duplex) thanks to CUPS.


----------



## sidetone (Oct 22, 2017)

Use Apache OpenOffice editors/openoffice-4, instead of Libreoffice. I'm not sure how its printing ability is without cups, but it is meant for FreeBSD.


----------



## Deleted member 9563 (Oct 23, 2017)

I print directly from LibreOffice without CUPS. No special setup is required as far as I know and I didn't configure anything here.


----------



## rigoletto@ (Oct 23, 2017)

I have editors/libreoffice and x11-toolkits/gtk30 (but I do not use Gnome) installed and I do not have cups installed. CUPS can be disabled in x11-toolkits/gtk30, but you must also disable it in the print/ghostscript9-agpl-base ports.

You can use `pkg info -r cups` to find out what is requiring it.


----------



## nickednamed (Oct 23, 2017)

OJ said:


> I print directly from LibreOffice without CUPS. No special setup is required as far as I know and I didn't configure anything here.


Do you mean that you don't have CUPS installed as a dependency, or that you have configured LibreOffice to not use CUPS?

My main problem was that LibreOffice doesn't print AT ALL when compiled without CUPS support (not even using LPD). I can, however live with having CIUPS as a dependency of my LPD-based setup.



lebarondemerde said:


> You can use  pkg info -r cups to find out what is requiring it.


See post #3. I know what is installing CUPS. It is print/ghostscript9-agpl-x11, among others. Each magic filter I tried (print/magicfilter, print/foomatic-rip, print/ghostscript9-agpl-x11) pulled in  CUPS as a dependency of ghostscript.

I'm sure I tried disabling the CUPS option for ghostscript (via my make.conf, and by port-specific options), resulting in circular dependency build failure; I will check it again later - I'm using a computer that uses packages right now.

But for now, I'm happy to leave as it is: LibreOffice won't print with CUPS=OFF, even via LPD. But that is OK because I can leave CUPS=ON, continue to use LPD, and just ignore CUPS (or use it).


----------



## MarcoB (Oct 23, 2017)

Unfortunately there is a tendency to remove lpd/lpr support in several applications. A Linux thing I guess. LO is one of them, also Qt5 applications. Solution for me is printing to file/pdf and use Xpdf3 for sending it to my printer for real (that is because the new Xpdf4 is a Qt5 application and cannot print using lpd/lpr anymore).


----------



## sidetone (Oct 23, 2017)

I believe it is from a Qt4 _related_ dependency (also). This happens to be one set of software I really like.


*Edit:* It gets pulled in with multimedia/vlc-qt4, or as mentioned above with print/scribus.
*
Edit:* devel/qt4 pulls in CUPS. (Perhaps this was a recent change.)


----------



## Deleted member 45312 (Oct 23, 2017)

I don't use CUPS.
I recently switched from graphics/xpdf3 (I don't like xpdf4) to graphics/atril-lite and it prints to lpd.
editors/libreoffice prints to lpd too.


----------



## MarcoB (Oct 23, 2017)

sidetone said:


> I believe it is from a Qt4 related dependency (also). This happens to be one set of software I really like.


Qt4 applications are able to print with lpd/lpr, this ability was removed in Qt5.


----------



## sidetone (Nov 1, 2017)

/etc/make.conf

```
QT4_OPTIONS= -CUPS
OPTIONS_UNSET=CUPS
```
disables building CUPS for devel/qt4, a dependency of editors/libreoffice, when it is unsettable from `make config`, and where OPTIONS_UNSET=CUPS by itself is not enough in make.conf.

This setting can be found in /usr/ports/Mk/bsd.qt.mk.
*

Edit:* for Apache editors/openoffice-4 with CUPS setting turned off, dependency java/openjdk8 brings in print/cups. openjdk8 forces use of cups from c. According to https://www.infoworld.com/article/2...-openoffice-4-vs--libreoffice-4-1.html?page=2, they intend to remove Java from Apache Openoffice, but it won't happen soon.


----------



## Deleted member 9563 (Nov 1, 2017)

nickednamed said:


> Do you mean that you don't have CUPS installed as a dependency, or that you have configured LibreOffice to not use CUPS?



My apologies.  I was a mistake when I said that. I don't knowingly use CUPS and always print with `lpd`. When I said it worked without CUPS I had just printed a page directly from LibreOffice to check - and it worked. When I investigated later, it turns out that CUPS actually _was_ installed, though I had nothing to do with that, or had ever looked at any configuration of it.


----------

