Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 390975 - dev-java/icedtea-bin-7.2.0-r1 pulls in cups for +X
Summary: dev-java/icedtea-bin-7.2.0-r1 pulls in cups for +X
Status: RESOLVED UPSTREAM
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Java (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Java team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-19 00:05 UTC by Sven E.
Modified: 2015-08-31 12:14 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
icedtea-7-no_cups.patch (nocups.patch,2.38 KB, patch)
2012-06-28 00:34 UTC, Kent Fredric (IRC: kent\n) (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sven E. 2011-11-19 00:05:27 UTC
dev-java/icedtea-bin-7.2.0-r1 pulls in cups when +X is set.

Reproducible: Always

Steps to Reproduce:
1. Try emerging icedtea-bin[X]
Actual Results:  
pulls in cups/depends on cups

Expected Results:  
Working GUI JVM without the need of having cups polluting the system.

The same holds true for icedtea, which allways pulls in cups/depends on it.

As for icedtea, having the cups headers during build time should be sufficient.

As for icedtea-bin, having X and a desktop env. does NOT imply having a printer. Such an assumption should not be made and thus icedtea-bin should not depend on cups.
Comment 1 Vlastimil Babka (Caster) (RETIRED) gentoo-dev 2011-11-28 09:08:27 UTC
The cups dep was added due to bug 390945. Apparently Icedtea7 now links its X libraries to cups directly, instead of dlsym. You are right that this is not optimal, but I can only recommend to take this upstream or reopen with a patch. Sorry.
Comment 2 Kent Fredric (IRC: kent\n) (RETIRED) gentoo-dev 2012-06-27 02:48:42 UTC
"Apparently Icedtea7 now links its X libraries to cups directly, instead of dlsym."

Shouldn't this not be applicable when building Icedtea from Source? 

Or are the IcedTea "sources" not really pure sources?
Comment 3 Kent Fredric (IRC: kent\n) (RETIRED) gentoo-dev 2012-06-27 23:10:37 UTC
(In reply to comment #2)
> "Apparently Icedtea7 now links its X libraries to cups directly, instead of
> dlsym."
> 
> Shouldn't this not be applicable when building Icedtea from Source? 
> 
> Or are the IcedTea "sources" not really pure sources?

Somewhat answering my own question, for the sake of others: 

 Built a fresh IcedTea-7  with USE="-cups"

qlist -e icedtea  | xargs scanelf  -n  | grep -i cups                                                                                                                                                          
ET_DYN libpthread.so.0,libm.so.6,libawt.so,libXext.so.6,libX11.so.6,libXrender.so.1,libdl.so.2,libXtst.so.6,libXi.so.6,libgtk-x11-2.0.so.0,libgdk-x11-2.0.so.0,libatk-1.0.so.0,libgio-2.0.so.0,libpangoft2-1.0.so.0,libpangocairo-1.0.so.0,libgdk_pixbuf-2.0.so.0,libcairo.so.2,libpango-1.0.so.0,libfreetype.so.6,libfontconfig.so.1,libgobject-2.0.so.0,libgmodule-2.0.so.0,libgthread-2.0.so.0,librt.so.1,libglib-2.0.so.0,libcups.so.2,libjava.so,libjvm.so,libc.so.6 /usr/lib64/icedtea7/jre/lib/amd64/xawt/libmawt.so 
ET_DYN libcups.so.2,libjvm.so,libstdc++.so.6,libawt.so,libm.so.6,libfontconfig.so.1,libjava.so,libc.so.6 /usr/lib64/icedtea7/jre/lib/amd64/headless/libmawt.so 

So yes, alas, even with USE="-cups", cups is stil required. It'd be nice to know /why/ libmawt is linked against cups, and wether or not we can remove this.

I can't seem to find the string 'mawt' anywhere in the icedtea sources, and the number of references to 'cups' are pretty minimal:

 grep 'cups' -R .
./acinclude.m4:  AC_CHECK_LIB([cups], [cupsServer],
./acinclude.m4:  AC_CHECK_HEADERS([cups/cups.h cups/ppd.h],
./acinclude.m4:      , [AC_MSG_ERROR([Could not find CUPS headers; install CUPS (including cups-devel on binary distros).])])
./acinclude.m4:  CUPS_LIBS="-lcups"
./configure:    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cupsServer in -lcups" >&5
./configure:$as_echo_n "checking for cupsServer in -lcups... " >&6; }
./configure:if ${ac_cv_lib_cups_cupsServer+:} false; then :
./configure:LIBS="-lcups  $LIBS"
./configure:char cupsServer ();
./configure:return cupsServer ();
./configure:  ac_cv_lib_cups_cupsServer=yes
./configure:  ac_cv_lib_cups_cupsServer=no
./configure:{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cups_cupsServer" >&5
./configure:$as_echo "$ac_cv_lib_cups_cupsServer" >&6; }
./configure:if test "x$ac_cv_lib_cups_cupsServer" = xyes; then :
./configure:  LIBS="-lcups $LIBS"
./configure:  for ac_header in cups/cups.h cups/ppd.h
./configure:  as_fn_error $? "Could not find CUPS headers; install CUPS (including cups-devel on binary distros)." "$LINENO" 5
./configure:  CUPS_LIBS="-lcups"

So, it should be feasible to nuke this.
Comment 4 Kent Fredric (IRC: kent\n) (RETIRED) gentoo-dev 2012-06-28 00:06:41 UTC
Just to save anyone else time hacking on this: 

As I suspected would happen, 

1. Removing CUPS 
2. Hacking the ebuild to not depend on CUPS

presently results in a ./configure failure

checking for cupsServer in -lcups... no
configure: error: Could not find CUPS library; install CUPS.


So, in order to patch around this, ^ has to be solved.
Comment 5 Kent Fredric (IRC: kent\n) (RETIRED) gentoo-dev 2012-06-28 00:34:44 UTC
Created attachment 316489 [details, diff]
icedtea-7-no_cups.patch

I can't see any use of cups in the actual code for iced tea. So, just going shotgun and seeing what happens if I tell automake and friends if we don't need it, and not to link against it.

Patch attached, applies, and passes ./configure 

 ( 
     epatch "${FILESDIR}"/${P}-pax_mark_rmic_java.patch #422525
+    epatch "${FILESDIR}"/${PN}-${SLOT}-no_cups.patch
     eautoreconf
 }

Compiling!

Wouldn't be so bad if upstream documented *why* they link to cups seemingly arbitrarily without reason. >_>
Comment 6 Kent Fredric (IRC: kent\n) (RETIRED) gentoo-dev 2012-06-28 00:45:58 UTC
Hm, ok. 

Seems a lot of stuff gets unpacked during compile that my greps weren't turning up: 

./bootstrap/boot/jre/lib/rt.jar
./bootstrap/boot/include/g++-v4/javax/print/PrintServiceLookup.h
./bootstrap/boot/include/g++-v4/gnu/javax/print/CupsMediaMapping.h
./bootstrap/boot/include/g++-v4/gnu/javax/print/CupsIppOperation.h
./bootstrap/boot/include/g++-v4/gnu/javax/print/CupsPrintServiceLookup.h
./bootstrap/boot/include/g++-v4/gnu/javax/print/CupsPrintService.h
./bootstrap/boot/include/g++-v4/gnu/javax/print/CupsServer.h
./bootstrap/jdk1.6.0/jre/lib/rt.jar
./bootstrap/jdk1.6.0/include/g++-v4/javax/print/PrintServiceLookup.h
./bootstrap/jdk1.6.0/include/g++-v4/gnu/javax/print/CupsMediaMapping.h
./bootstrap/jdk1.6.0/include/g++-v4/gnu/javax/print/CupsIppOperation.h
./bootstrap/jdk1.6.0/include/g++-v4/gnu/javax/print/CupsPrintServiceLookup.h
./bootstrap/jdk1.6.0/include/g++-v4/gnu/javax/print/CupsPrintService.h
./bootstrap/jdk1.6.0/include/g++-v4/gnu/javax/print/CupsServer.h
./openjdk.build-boot/sanityCheckMessages.txt
./openjdk.build-boot/sanityCheckErrors.txt
./ChangeLog
./openjdk/hotspot/test/compiler/7070134/words
./openjdk/hotspot/make/solaris/makefiles/reorder_COMPILER2_i486
./openjdk/hotspot/make/solaris/makefiles/reorder_TIERED_i486
./openjdk/hotspot/make/solaris/makefiles/reorder_TIERED_amd64
./openjdk/hotspot/make/solaris/makefiles/reorder_COMPILER2_sparcv9
./openjdk/hotspot/make/solaris/makefiles/reorder_TIERED_sparcv9
./openjdk/hotspot/make/solaris/makefiles/reorder_COMPILER2_amd64
./openjdk/hotspot/make/solaris/makefiles/reorder_COMPILER2_sparc
./openjdk/hotspot/make/solaris/makefiles/reorder_TIERED_sparc
./openjdk/README-builds.html
./openjdk/jdk/src/solaris/native/sun/awt/CUPSfuncs.c
./openjdk/jdk/src/solaris/native/common/deps/cups_fp.h
./openjdk/jdk/src/solaris/native/common/deps/cups_fp.c
./openjdk/jdk/src/solaris/classes/sun/print/IPPPrintService.java
./openjdk/jdk/src/solaris/classes/sun/print/UnixPrintJob.java
./openjdk/jdk/src/solaris/classes/sun/print/UnixPrintServiceLookup.java
./openjdk/jdk/src/solaris/classes/sun/print/CUPSPrinter.java
./openjdk/jdk/make/sun/lwawt/FILES_c_macosx.gmk
./openjdk/jdk/make/sun/awt/mapfile-mawt-vers
./openjdk/jdk/make/sun/awt/FILES_c_unix.gmk
./openjdk/jdk/make/sun/awt/mawt.gmk
./openjdk/jdk/make/sun/xawt/mapfile-vers
./openjdk/jdk/make/sun/xawt/FILES_c_unix.gmk
./openjdk/jdk/make/sun/xawt/Makefile
./openjdk/jdk/make/sun/headless/mapfile-vers
./openjdk/jdk/make/Makefile
./openjdk/jdk/make/common/Sanity.gmk
./openjdk/jdk/make/common/shared/Defs.gmk
./openjdk/jdk/make/common/shared/Sanity.gmk
./openjdk/jdk/make/common/shared/Defs-linux.gmk
./openjdk/jdk/make/common/shared/Sanity-Settings.gmk
./openjdk/jdk/make/common/shared/Defs-solaris.gmk
./openjdk/jdk/make/common/shared/Defs-macosx.gmk
./openjdk/Makefile
./openjdk-boot/hotspot/test/compiler/7070134/words
./openjdk-boot/hotspot/make/solaris/makefiles/reorder_COMPILER2_i486
./openjdk-boot/hotspot/make/solaris/makefiles/reorder_TIERED_i486
./openjdk-boot/hotspot/make/solaris/makefiles/reorder_TIERED_amd64
./openjdk-boot/hotspot/make/solaris/makefiles/reorder_COMPILER2_sparcv9
./openjdk-boot/hotspot/make/solaris/makefiles/reorder_TIERED_sparcv9
./openjdk-boot/hotspot/make/solaris/makefiles/reorder_COMPILER2_amd64
./openjdk-boot/hotspot/make/solaris/makefiles/reorder_COMPILER2_sparc
./openjdk-boot/hotspot/make/solaris/makefiles/reorder_TIERED_sparc
./openjdk-boot/README-builds.html
./openjdk-boot/jdk/src/solaris/native/sun/awt/CUPSfuncs.c
./openjdk-boot/jdk/src/solaris/native/common/deps/cups_fp.h
./openjdk-boot/jdk/src/solaris/native/common/deps/cups_fp.c
./openjdk-boot/jdk/src/solaris/classes/sun/print/IPPPrintService.java
./openjdk-boot/jdk/src/solaris/classes/sun/print/UnixPrintJob.java
./openjdk-boot/jdk/src/solaris/classes/sun/print/UnixPrintServiceLookup.java
./openjdk-boot/jdk/src/solaris/classes/sun/print/CUPSPrinter.java
./openjdk-boot/jdk/make/sun/lwawt/FILES_c_macosx.gmk
./openjdk-boot/jdk/make/sun/awt/mapfile-mawt-vers
./openjdk-boot/jdk/make/sun/awt/FILES_c_unix.gmk
./openjdk-boot/jdk/make/sun/awt/mawt.gmk
./openjdk-boot/jdk/make/sun/xawt/Makefile.orig
./openjdk-boot/jdk/make/sun/xawt/mapfile-vers
./openjdk-boot/jdk/make/sun/xawt/FILES_c_unix.gmk
./openjdk-boot/jdk/make/sun/xawt/Makefile
./openjdk-boot/jdk/make/sun/headless/mapfile-vers
./openjdk-boot/jdk/make/Makefile
./openjdk-boot/jdk/make/common/Sanity.gmk
./openjdk-boot/jdk/make/common/shared/Defs.gmk
./openjdk-boot/jdk/make/common/shared/Sanity.gmk
./openjdk-boot/jdk/make/common/shared/Defs-linux.gmk
./openjdk-boot/jdk/make/common/shared/Sanity-Settings.gmk
./openjdk-boot/jdk/make/common/shared/Defs-solaris.gmk
./openjdk-boot/jdk/make/common/shared/Defs-macosx.gmk
./openjdk-boot/Makefile
./INSTALL
./Defs.gmk.bak


I think its safe to assume that "cups" is infrastructural to Java somehow, and not really simple to remove.

I'm not even 100% sure that " X ? ( cups ) " is good enough really, seems there are functions outside of X support that look like they might require cups

Either way, getting rid of this downstream is obviously not as simple as it might look at a first glance, and it almost looks like cups is a mandatory requirement, not merely X dependent. 

So, my suggestion, in order to reduce confusion on users, is to drop the "cups" useflag, as its "confusing" specifying USE="-cups" and then still seeing cups get pulled anyway.

Alternatively, you could make 

REQUIRED_USE="X? ( cups )" so the user is at least informed via portage that USE="X" will force "USE=cups"
Comment 7 Dylan Simon 2013-08-27 19:34:12 UTC
FWIW, I do icedtea 7 builds from scratch where I manually remove all the cups dependencies from openjdk, and it works just fine.  I could provide a patch, but the problem is it's hard to apply during the ebuild, since it has to happen in the middle of make (when I do it, I run make, wait for it to fail, patch, and run make again).
Comment 8 mluppov 2015-03-02 13:19:07 UTC
It still pulls in cups. Not by icedtea itself, but by package it depends on. app-text/ghostscript-gpl have cups enabled no matter what USE flags you put in global variable or for this package.
Comment 9 James Le Cuirot gentoo-dev 2015-08-31 12:14:47 UTC
This is already closed but this is just a note to say that this will be fixed better in the 7.2.6.1 release, both in the source and binary version. The binary version will use the OpenJDK dlopen behaviour. The source version will also do this if the cups flag is disabled.