All of lore.kernel.org
 help / color / mirror / Atom feed
From: Martin Jansa <martin.jansa@gmail.com>
To: openembedded-core@lists.openembedded.org
Subject: Re: [PATCHv2 3/5] package.bbclass: add SHLIBSSEARCHDIRS to define where to search for shlib providers
Date: Sun, 19 Jan 2014 16:25:15 +0100	[thread overview]
Message-ID: <20140119152515.GC5565@jama> (raw)
In-Reply-To: <6b2c74bfb8b8a787273dc0a2f75ddc91573d1c8b.1390144972.git.Martin.Jansa@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 3505 bytes --]

On Sun, Jan 19, 2014 at 04:23:35PM +0100, Martin Jansa wrote:
> * when package contains some files matching "^.*\.so", but in directory
>   not default linker search paths (e.g. /opt/package/bundled-lib/libfoo.so)
>   don't register it as libfoo provider, because it's possible that there
>   is different package providing libfoo.so in ${libdir} and that would
>   be better shlib provider for other packages to depend on
> * recipes providing libs intentionally in some other directory can
>   define own SHLIBSSEARCHDIRS value

This one is the same as v1, sent by accident when sending v3 of 2/5.

> [YOCTO #4628]
> 
> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
> ---
>  meta/classes/package.bbclass | 26 +++++++++++++++++++++++---
>  1 file changed, 23 insertions(+), 3 deletions(-)
> 
> diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass
> index 9b511a6..a9e32f2 100644
> --- a/meta/classes/package.bbclass
> +++ b/meta/classes/package.bbclass
> @@ -1322,6 +1322,9 @@ python package_do_filedeps() {
>  SHLIBSDIRS = "${PKGDATA_DIR}/${MLPREFIX}shlibs"
>  SHLIBSWORKDIR = "${PKGDESTWORK}/${MLPREFIX}shlibs"
>  
> +# default search path when searching for shlibs provided by package
> +SHLIBSSEARCHDIRS ?= "${baselib} ${libdir}"
> +
>  python package_do_shlibs() {
>      import re, pipes
>  
> @@ -1332,6 +1335,20 @@ python package_do_shlibs() {
>  
>      lib_re = re.compile("^.*\.so")
>      libdir_re = re.compile(".*/%s$" % d.getVar('baselib', True))
> +    
> +    shlibs_search_dirs = d.getVar('SHLIBSSEARCHDIRS', True)
> +    shlibs_search_dirs_re_txt = ""
> +    for dir in shlibs_search_dirs.split(' '):
> +        # strip leading and trailing slash, it's added in regexp
> +        if dir.endswith("/"):
> +            dir = dir[:-1]
> +        if dir.startswith("/"):
> +            dir = dir[1:]
> +        if shlibs_search_dirs_re_txt:
> +            shlibs_search_dirs_re_txt += "|"
> +        shlibs_search_dirs_re_txt += "(^.*/%s/.*$)" % dir
> +    shlibs_search_dirs_re = re.compile(shlibs_search_dirs_re_txt)
> +    bb.debug(2, "will use following RE to search for provides sonames %s" % shlibs_search_dirs_re_txt)
>  
>      packages = d.getVar('PACKAGES', True)
>      targetos = d.getVar('TARGET_OS', True)
> @@ -1390,9 +1407,12 @@ python package_do_shlibs() {
>              if m:
>                  this_soname = m.group(1)
>                  if not this_soname in sonames:
> -                    # if library is private (only used by package) then do not build shlib for it
> -                    if not private_libs or -1 == private_libs.find(this_soname):
> -                        sonames.append(this_soname)
> +                    if shlibs_search_dirs_re.match(file):
> +                        # if library is private (only used by package) then do not build shlib for it
> +                        if not private_libs or -1 == private_libs.find(this_soname):
> +                            sonames.append(this_soname)
> +                    else:
> +                        bb.debug(2, "ignoring soname %s from %s, because path doesn't match %s" % (this_soname, file, shlibs_search_dirs_re_txt))
>                  if libdir_re.match(os.path.dirname(file)):
>                      needs_ldconfig = True
>                  if snap_symlinks and (os.path.basename(file) != this_soname):
> -- 
> 1.8.5.2
> 

-- 
Martin 'JaMa' Jansa     jabber: Martin.Jansa@gmail.com

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 205 bytes --]

  reply	other threads:[~2014-01-19 15:25 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-18 14:02 [PATCH 0/5] shlibs providers improvements Martin Jansa
2014-01-18 14:02 ` [PATCH 1/5] package.bbclass: move reading shlibs providers to separate function Martin Jansa
2014-01-18 14:02 ` [PATCH 2/5] package.bbclass: show warning when package is trying to provide already provided shlib Martin Jansa
2014-01-19 13:13   ` Martin Jansa
     [not found]   ` <cover.1390138091.git.Martin.Jansa@gmail.com>
2014-01-19 13:28     ` [PATCHv2 " Martin Jansa
2014-01-19 14:42       ` Phil Blundell
2014-01-19 15:23         ` [PATCHv2 3/5] package.bbclass: add SHLIBSSEARCHDIRS to define where to search for shlib providers Martin Jansa
2014-01-19 15:25           ` Martin Jansa [this message]
2014-01-19 15:24         ` [PATCHv3 2/5] package.bbclass: show warning when package is providing already provided shlib Martin Jansa
2014-01-18 14:02 ` [PATCH 3/5] package.bbclass: add SHLIBSSEARCHDIRS to define where to search for shlib providers Martin Jansa
2014-01-19 17:13   ` Richard Purdie
2014-01-19 18:55     ` Martin Jansa
2014-01-18 14:02 ` [PATCH 4/5] package.bbclass: Don't search for prividers of PRIVATE_LIBS Martin Jansa
2014-01-18 14:02 ` [PATCH 5/5] package.bbclass: Show which files require given dependency in debug output Martin Jansa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140119152515.GC5565@jama \
    --to=martin.jansa@gmail.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.