Solved How to find all [installed] that depend on a lib?

Greetings, all.
I just finished updating a system building the packages locally to perform the update. Everything went pretty smoothly. But now I find I'm unable to view any Jpeg images with anything but the graphics/gimp, and my web browser (firefox). I did read the entry in UPDATING regarding the switch from graphics/jpeg, to graphics/turbo-jpeg, and rebuilt all my image viewers without using graphics/jpeg. But no joy. So. I was wondering if anyone knew how I might find out which (installed) ports depend on graphics/jpeg, if any? Can't I use ldd(1), or something against /usr/local/lib/jpeg.(a|so).N ?

Thanks, for any hints!

--Chris
 
ldd(1) might be helpful to find out which libraries are involved. Please see the example below
Code:
$ ldd /usr/local/bin/xv
/usr/local/bin/xv:
   libXext.so.6 => /usr/local/lib/libXext.so.6 (0x80091c000)
   libX11.so.6 => /usr/local/lib/libX11.so.6 (0x800b2d000)
   libjpeg.so.8 => /usr/local/lib/libjpeg.so.8 (0x800e66000)
   libtiff.so.5 => /usr/local/lib/libtiff.so.5 (0x8010bf000)
   libpng16.so.16 => /usr/local/lib/libpng16.so.16 (0x801331000)
   libjasper.so.4 => /usr/local/lib/libjasper.so.4 (0x801566000)
   libz.so.6 => /lib/libz.so.6 (0x8017c4000)
   libm.so.5 => /lib/libm.so.5 (0x8019da000)
   libc.so.7 => /lib/libc.so.7 (0x801c03000)
   libxcb.so.1 => /usr/local/lib/libxcb.so.1 (0x801fb0000)
   librpcsvc.so.5 => /usr/lib/librpcsvc.so.5 (0x8021cf000)
   liblzma.so.5 => /usr/lib/liblzma.so.5 (0x8023d8000)
   libjbig.so.2 => /usr/local/lib/libjbig.so.2 (0x802601000)
   libXau.so.6 => /usr/local/lib/libXau.so.6 (0x80280e000)
   libpthread-stubs.so.0 => /usr/local/lib/libpthread-stubs.so.0 (0x802a10000)
   libXdmcp.so.6 => /usr/local/lib/libXdmcp.so.6 (0x802c11000)
   libthr.so.3 => /lib/libthr.so.3 (0x802e16000)
Then pkg shlib SOME_LIB.so might be helpful to find out which one uses some interesting library. On my system an example shows
Code:
$ pkg shlib libjpeg.so.8
libjpeg.so.8 is provided by the following packages:
jpeg-turbo-1.4.2
libjpeg.so.8 is linked to by the following packages:
jasper-1.900.1_15
tiff-4.0.6_1
gdk-pixbuf2-2.32.1
lcms2-2.7_2
ghostscript9-base-9.06_11
libwmf-0.2.8.4_15
webp-0.4.4_1
ImageMagick-6.9.3.1,1
open-motif-2.3.4_2
xv-3.10a_16
mplayer-1.2.r20151219_2
libv4l-1.6.3_1
firefox-43.0.4_1,1
I am not sure if this answers your question, but I hope it helps.
 
chrbr the pkg shlib ... returned a list, alright. But in my efforts to ensure that graphics/jpeg wasn't available. I performed a make deinstall in it's folder. So nothing turned up for libjpeg.so.8.4.0, nor libjpeg.so.8.4. Sadly, both graphics/jpeg, and graphics/jpeg-turbo, use libjpeg.so.8. So I'm probably going to need to "bone up" on my ldd(1) foo. Or my pkg(8) foo, as marino@ has suggested. Thanks chrbr !

marino@ Thanks for the "bone", John. I'm more of a ports(7) man, so my pkg(8) foo isn't too sharp. But I can probably discover the correct incantation, soon enough. :) Thanks, John!
 
OK. Just in case somebody can answer conclusively. The following was returned. but please note; I performed the query after having make deinstalling graphics/jpeg
Code:
libjpeg.so.8 is provided by the following packages:
jpeg-turbo-1.4.2
libjpeg.so.8 is linked to by the following packages:
wv-1.2.9_3
webp-0.4.4_1
webkit-gtk3-2.4.9
tiff-4.0.6_1
libv4l-1.6.3_1
lcms2-2.7_2
jasper-1.900.1_15
gstreamer1-plugins-jpeg-1.6.2
gdk-pixbuf2-2.32.1
argyllcms-1.7.0_1
webkit2-gtk3-2.8.5
lcms-1.19_6,1
libgd-2.1.0_7,1
libgphoto2-2.5.9
poppler-0.34.0
ghostscript9-base-9.06_11
libopenraw-0.0.9_3
webkit-gtk2-2.4.9
libwmf-0.2.8.4_15
libmng-1.0.10_2
gegl-0.2.0_14
xfce4-tumbler-0.1.31_1
spandsp-0.0.6
libgxps-0.2.3.2
gimp-app-2.8.16,1
djvulibre-3.5.25.3_3
compiz-plugins-main-0.8.8_1
libraw-0.17.1
wx30-gtk2-3.0.2_3
pwcbsd-1.4.1_12
open-motif-2.3.4_2
GraphicsMagick-1.3.23_2,1
gegl3-0.3.4
xscreensaver-gnome-5.12_3
mplayer-1.2.r20151219_1
motion-3.2.12_4
libsvg-cairo-0.1.6_8
imlib2-1.4.6_7,2
gimp-gmic-plugin-1.6.0.0_4
firefox-esr-38.5.2,1
py27-pillow-2.9.0
eog-3.16.3
tracker-1.4.1_1
gpicview-0.2.4
graphviz-2.38.0_10
ImageMagick-6.9.3.0,1
Command used was pkg shlib libjpeg.so.8

Thanks!

--Chris
 
This is what you can do with pkg-query(8) to get a bit more machine parseable output for scripts:

Provided shared libraries for each package:
pkg query "%n-%v: %b"

Required shared libraries for each package:
pkg query "%n-%v: %B"
 
Perfect, kpa !

Thanks!

Given the output; both listed above, and generated by the pkg query listing(s). It looks like I'm going to have to repeat the builds on those mentiond in the lists, in hopes of reconciling the issue. :( Problem, given that both libraries install a libjpeg.so.8. I can't be sure which one installed the current link, or which application built against which header(s). :(

Thanks again, kpa!

--Chris
 
Well, all is good in the land of libjpeg.
FWIW using an educated guess, or call it a stab in the dark; I managed to now be able to render Jpeg's again, only rebuilding the following, from the original list
Code:
tiff-4.0.6_1
lcms2-2.7_2
jasper-1.900.1_15
gdk-pixbuf2-2.32.1
argyllcms-1.7.0_1
lcms-1.19_6,1
libgd-2.1.0_7,1
poppler-0.34.0
gegl-0.2.0_14
GraphicsMagick-1.3.23_2,1
gegl3-0.3.4
imlib2-1.4.6_7,2
ImageMagick-6.9.3.0,1
removed, and rebuilt the packages, as well.

Thanks to you all, for lending a hand!

--Chris
 
Back
Top