1) opencv installed without tesseract useflag: [ebuild R ~] media-libs/opencv-3.1.0-r6:0/3.1::gentoo USE="contrib eigen ffmpeg gphoto2 jpeg opencl opengl openmp png python qt5 tiff v4l vaapi webp -contrib_cvv -contrib_hdf -contrib_sfm -cuda -examples -gdal -gflags -glog -gstreamer -gtk -ieee1394 (-ipp) -java -jpeg2k -libav -openexr (-pch) -tesseract -testprograms -threads -vtk -xine" PYTHON_TARGETS="python2_7 python3_4 -python3_5" 0 KiB 2) emerge app-text/tesseract [ebuild N ] media-libs/leptonica-1.71-r1::gentoo USE="gif jpeg png tiff webp zlib -jpeg2k -static-libs {-test} -utils" 0 KiB [ebuild N ] app-text/tesseract-3.04.00-r2::gentoo USE="jpeg opencl png scrollview tiff webp -doc -examples -osd -static-libs -training" L10N="de -ar -bg -ca -chr -cs -da -el -es -fi -fr -he -hi -hu -id -it -ja -ko -lt -lv -nl -no -pl -pt -ro -ru -sk -sl -sr -sv -th -tl -tr -uk -vi -zh-CN -zh-TW" 0 KiB 3) Rebuild media-libs/opencv 4) Remove app-text/tesseract and media-libs/leptonica Result: !!! existing preserved libs: >>> package: app-text/tesseract-3.04.00-r2 * - /usr/lib64/libtesseract.so.3 * - /usr/lib64/libtesseract.so.3.0.4 * used by /usr/lib64/libopencv_text.so.3.1.0 (media-libs/opencv-3.1.0-r6) >>> package: media-libs/leptonica-1.71-r1 * - /usr/lib64/liblept.so.4 * - /usr/lib64/liblept.so.4.0.2 * used by /usr/lib64/libtesseract.so.3 (preserved) * used by /usr/lib64/libtesseract.so.3.0.4 (preserved) Use emerge @preserved-rebuild to rebuild packages using these libraries
It looks like leptonica is only being preserved because it's used by tesseract.
(In reply to Michael Palimaka (kensington) from comment #1) > It looks like leptonica is only being preserved because it's used by > tesseract. You're right Michael. I just checked it.
You are using experimental useflag "contrib" (Install user contributed scripts from opencv_contrib (Experimental!)) This experimental useflag uses autodetect on your dependencies thus it is experimental. We are unfortunately not able to rewrite whole opencv_contrib repo to not use autodetect but patches are welcome. Tesseract useflag only enables dependency on tesseract which ensures that tesseract is installed on your system. Thank you.
What about building with -DCMAKE_DISABLE_FIND_PACKAGE_Tesseract=$(usex tesseract) ?
(In reply to Michael Palimaka (kensington) from comment #4) > What about building with -DCMAKE_DISABLE_FIND_PACKAGE_Tesseract=$(usex > tesseract) ? Patches are welcome if it works for you :) It didnt work on version before.
(In reply to Michael Palimaka (kensington) from comment #4) > What about building with -DCMAKE_DISABLE_FIND_PACKAGE_Tesseract=$(usex > tesseract) ? Sorry, that should say -DCMAKE_DISABLE_FIND_PACKAGE_Tesseract=$(usex !tesseract). Tests OK locally.