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.
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.
"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?
(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.
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.
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. >_>
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"
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).
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.
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.