Easy lib­rary de­pend­en­cies de­tec­tion for ports

In the last days I com­mit­ted some scripts to $PORTSDIR/​Tools/​scripts which help in de­tect­ing the ex­pli­cit lib­rary de­pend­en­cies of in­stalled ports. You just have to run $PORTSDIR/Tools/scripts/explicit_lib_depends.sh with the package-​name of the in­stalled port (al­tern­at­ively you can give the path to the re­gistered port, e.g. /​var/​db/​pkg/​gnome–terminal-2.18.1). One of the scripts which are called needs por­tup­grade in­stalled. As an ex­ample here’s the com­plete out­put of a script run with the gnome-​terminal port:

# /usr/ports/Tools/scripts/explicit_lib_depends.sh gnome-terminal-2.18.1
USE_FREETYPE=yes
USE_GETTEXT=yes
USE_GNOME+=atk
USE_GNOME+=esound
USE_GNOME+=gconf2
USE_GNOME+=glib20
USE_GNOME+=gnomevfs2
USE_GNOME+=gtk20
USE_GNOME+=libartlgpl2
USE_GNOME+=libbonobo
USE_GNOME+=libbonoboui
USE_GNOME+=libglade2
USE_GNOME+=libgnome
USE_GNOME+=libgnomecanvas
USE_GNOME+=libgnomeui
USE_GNOME+=libxml2
USE_GNOME+=orbit2
USE_GNOME+=pango
USE_GNOME+=vte
USE_ICONV=yes
USE_XORG+=ice
USE_XORG+=sm
USE_XORG+=x11
USE_XORG+=xau
USE_XORG+=xcursor
USE_XORG+=xdmcp
USE_XORG+=xext
USE_XORG+=xfixes
USE_XORG+=xft
USE_XORG+=xi
USE_XORG+=xinerama
USE_XORG+=xrandr
USE_XORG+=xrender
audiofile:${PORTSDIR}/audio/libaudiofile
avahi-client:${PORTSDIR}/net/avahi
avahi-common:${PORTSDIR}/net/avahi
avahi-glib:${PORTSDIR}/net/avahi
cairo:${PORTSDIR}/graphics/cairo
dbus-1:${PORTSDIR}/de­vel/​dbus
dbus-glib-1:${PORTSDIR}/devel/dbus-glib
expat:${PORTSDIR}/textproc/expat2
fontconfig:${PORTSDIR}/x11-fonts/fontconfig
gnome-keyring:${PORTSDIR}/se­cur­ity/​gnome-​keyring
jpeg:${PORTSDIR}/graphics/jpeg
png:${PORTSDIR}/graphics/png
popt:${PORTSDIR}/devel/popt
startup-notification-1:${PORTSDIR}/x11/startup-notification

All those lib­rar­ies are dir­ectly ref­er­enced (dy­nam­ic­ally linked in) in the bin­ar­ies or libs of the gnome-​terminal port, in­dir­ect (de­pend­en­cies of de­pend­en­cies) ones are not lis­ted (and not needed). So the script al­lows to quickly pro­duce a list of libs/​ports which

  • should be ref­er­enced in the port Make­file (new port de­vel­op­ment, port up­dates)
  • al­lows to check if a port lists all ref­er­enced LIB_​DEPENDS (port main­ten­ance)

To do this with all your ports you can run

for port in /​var/​db/​pkg/​*; do
echo $port:
/usr/ports/Tools/scripts/explicit_lib_depends.sh $port
done > explicit_depends.txt

Not all USE_​* switches of the Ports Col­lec­tion are handled yet, if you stumble upon such a case, feel free to send me a mail.

StumbleUponXINGBalatarinBox.netDiggGoogle GmailNetvouzPlurkSiteJotTypePad PostYahoo BookmarksVKSlashdotPocketHacker NewsDiigoBuddyMarksRedditLinkedInBibSonomyBufferEmailHatenaLiveJournalNewsVinePrintViadeoYahoo MailAIMBitty BrowserCare2 NewsEvernoteMail.RuPrintFriendlyWaneloYahoo MessengerYoolinkWebnewsStumpediaProtopage BookmarksOdnoklassnikiMendeleyInstapaperFarkCiteULikeBlinklistAOL MailTwitterGoogle+PinterestTumblrAmazon Wish ListBlogMarksDZoneDeliciousFlipboardFolkdJamespotMeneameMixiOknotiziePushaSvejoSymbaloo FeedsWhatsAppYouMobdiHITTWordPressRediff MyPageOutlook.comMySpaceDesign FloatBlogger PostApp.netDiary.RuKindle ItNUjijSegnaloTuentiWykopTwiddlaSina WeiboPinboardNetlogLineGoogle BookmarksDiasporaBookmarks.frBaiduFacebookGoogle ClassroomKakaoQzoneSMSTelegramRenrenKnownYummlyShare/​Save

Leave a Reply

Your email address will not be published. Required fields are marked *