From owner-freebsd-ports@FreeBSD.ORG Tue Aug 13 04:25:18 2013 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 09C32BC9 for ; Tue, 13 Aug 2013 04:25:18 +0000 (UTC) (envelope-from kob6558@gmail.com) Received: from mail-pd0-x232.google.com (mail-pd0-x232.google.com [IPv6:2607:f8b0:400e:c02::232]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D6DF42589 for ; Tue, 13 Aug 2013 04:25:17 +0000 (UTC) Received: by mail-pd0-f178.google.com with SMTP id w10so4366183pde.9 for ; Mon, 12 Aug 2013 21:25:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=msMVlKIqWWBrlxlvUivOUIyWz5Lq5Z+iUPGo46SBsqw=; b=AZlrUpybY3FMm/pWW+XchqRFJPnpkB2b5XIhWCacqlsEUbP8nKKnzh6tmsLNP37Hdz NyRUW/0cD6AQ+IVvjBfX5p5Arh2nlTX6gqSWhRF0k8PBX/YUr5NOwuVElOXKTTEF44d+ 5z3s01S8Kx3aLHxJs5nEQaZ62foIqgop7Oqf9Lb6wAfUPqyBBVAi/ZA4E8WuAeXN5csY HfqYZpPvZrH4VMXAVaho6dUtgwPNwAVFXGKpPTjUqD4N0ar4qrlXtHEWMz/D++3Goaxi /q+ulpB+dXSDkyCh40TGfWzFc9zQArFkYkeVCLGkhvoX77b13MgTH7aa6gr8VwRRzhf3 CIrQ== MIME-Version: 1.0 X-Received: by 10.68.226.234 with SMTP id rv10mr2476156pbc.1.1376367917500; Mon, 12 Aug 2013 21:25:17 -0700 (PDT) Sender: kob6558@gmail.com Received: by 10.67.14.66 with HTTP; Mon, 12 Aug 2013 21:25:17 -0700 (PDT) In-Reply-To: <52093464.2030601@passap.ru> References: <52093464.2030601@passap.ru> Date: Mon, 12 Aug 2013 21:25:17 -0700 X-Google-Sender-Auth: C7KmB3CCnnEvHHW5Xz_vB6QL0Vc Message-ID: Subject: Re: How to create lib (and run) dependency list at Makefile From: Kevin Oberman To: Boris Samorodov Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: FreeBSD ports list X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Aug 2013 04:25:18 -0000 On Mon, Aug 12, 2013 at 12:15 PM, Boris Samorodov wrote: > Hi All, > > recently I've upgaded my ports. Then I get: > ----- > % pkg_libchk -a > rasqal-0.9.30: /usr/local/bin/roqet misses libcurl.so.6 > rasqal-0.9.30: /usr/local/lib/librasqal.so.3 misses libcurl.so.6 > ----- > > So, I assume that textproc/rasqal was not bumped after ftp/curl update. > The dependency was not specified. I tested a patch and filed a PR. > But while working with port I get strange (at least to me) results. > > The binary file which is installed by textproc/rasqal is bin/roqet. > Let's see which libraries (installed from ports) it uses: > ----- > % ldd -f '%p\n' /usr/local/bin/roqet | grep '/usr/local' > /usr/local/lib/librasqal.so.3 > /usr/local/lib/libraptor2.so.0 > /usr/local/lib/libicuuc.so.50 > /usr/local/lib/libxslt.so.2 > /usr/local/lib/libyajl.so.2 > /usr/local/lib/libxml2.so.5 > /usr/local/lib/libiconv.so.3 > /usr/local/lib/libcurl.so.7 > /usr/local/lib/libicudata.so.50 > ----- > > That means this file depends upon (origins): > ----- > converters/libiconv > devel/icu > devel/yajl > ftp/curl > textproc/libxml2 > textproc/libxslt > textproc/raptor2 > ----- > > Am I right that those ports should be specified as LIB (or RUN) > dependencies for textproc/rasqal? > > Here is the current run dependencies (for the whole port, not just > one binary file!): > ----- > % make -C /usr/ports/textproc/rasqal run-depends-list > /usr/ports/devel/pcre > /usr/ports/textproc/raptor2 > ----- > > Seems that I'm mistaken somewhere, because 6(!) library dependencies > are not registered! > > PS. All those ports shows up as indirect dependencies (checked with > 'make all-depends-list'). But imho they should be a _direct_ ones. > > Am I wrong here? Thanks! > -- > WBR, Boris Samorodov (bsam) > FreeBSD Committer, http://www.FreeBSD.org The Power To Serve > _______________________________________________ > freebsd-ports@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-ports > To unsubscribe, send any mail to "freebsd-ports-unsubscribe@freebsd.org" > Yes, you are wrong, but it's not obvious. When a program links to a sharable library, it also links to any library to which the sharable links. As it turns out, libraptor2.so does, in fact, link to libcurl.so (and a bunch of others). First, when rolling a port it is impractical to try to track down every library that a library I need links to. And it is totally unnecessary For the port and package, as the ports system automagically take care of including dependencies of dependencies. When running he executable, the rtld takes care of all of this. There are some real complications that pop up now an again. One is figuring out which ports need to be re-built. You can't just scan Makefiles for LIBDEPENDS. That's why I prefer running pkg_libchk. Then I KNOW what ports need rebuilding after a library version bump. port(master|upgrade) -r will also do this correctly, but will also cause many ports that DON'T link to the sharable that had a version bump. They're safe, but not efficient. pkg_libchk is both safe and efficient, but takes a little thought. (The magic incantation is: pkg_libchk -o | grep BUMPED_LIB | cut -d: -f1 | sort | uniq This will provide a list of what needs rebuilding. (Similar commands using other tools like awk will also work, of course). -- R. Kevin Oberman, Network Engineer E-mail: rkoberman@gmail.com