package.bbclass: support dangling path components

Commit ec2aab09769f4b6817d74d2175afa2b7c7598750 introduced a regression
on packages which contain symlinks with unresolvable path components
(e.g. lsof-dbg).  While assigning a variable, an exception was raised
and the exception handler accessed this variable.

Patch deals both with the dangling path components by assuming them as
valid directories and by avoiding the broken assignment.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
lib/oe/path.py: support missing directory components in realpath()

Some use cases in OE operate on symlinks which dangling path components.
Assume that these are directories instead of raising ENOENT.

Signed-off-by: Enrico Scholz <enrico.scholz@sigma-chemnitz.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
fontconfig: remove unexplainable and broken build tweaking

The build flag twiddling in do_configure_append was unexplainable and clearly
wrong (native flags for a cross build), remove it all.

Parallel make appears to be working now, so enable it.

The tarball doesn't contain read only sources, remove the unpack hacking.

The pkgconfig doesn't need patching as the freetype link lines are the same.

Don't need to specify where freetype is, it's found automatically.

Merge fontconfig-util-dbg into fontconfig-dbg.

Don't export HASDOCBOOK, --disable-docs is sufficient to turn off documentation
building.

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
fontconfig: drop explicit -native recipe

Instead, use BBCLASSEXTEND=native in fontconfig.

We can drop the installation of fc-lang/fc-glyphname, they are not used by
fontconfig's build anymore as it ships the generated files in the tarball.

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
fontconfig: rename the patches directory

Rename the patches directory to files as we only have one version of fontconfig,
so the hassle of moving these files every upgrade can be avoided.

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
systemd.bbclass: use PACKAGESPLITFUNCS instead of populate_packages_prepend

This is cleaner and leads to more accurate profiles.

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
multilib.bbclass: save multilib variables before executing the gcc-cross-canadian statements

Signed-off-by: Constantin Musca <constantinx.musca@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
gcc-cross-canadian: enable multilib support

Signed-off-by: Constantin Musca <constantinx.musca@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
qt4: use system SQLite

We've always been depending on external SQLite, however by default Qt
builds using its own internal copy of SQLite. Add the configure option
to actually use the external SQLite library and make it clearer which
version is in use.

Fixes [YOCTO #2514].

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
oe-buildenv-internal: Remove GIT variables from BB_ENV_EXTRAWHITE

The following variables perform no function outside of bitbake:

    GIT_CONFIG
    GIT_PROXY_HOST
    GIT_PROXY_PORT
    GIT_PROXY_IGNORE

GIT_CONFIG only affects the git-config command which is not relevant to
the fetcher. This was previously used with the OE GIT_CORE_CONFIG
variable which would provide a basic git config to use instead of the
user's config. This usage was deprecated by git for over a year now:

http://git.661346.n2.nabble.com/Overriding-gitconfig-using-GIT-CONFIG-td6680977

GIT_PROXY_HOST and GIT_PROXY_PORT are not used by git.

GIT_PROXY_IGNORE was an OE construct used to create the custom git
config and had no meaning outside of the OE environment. It is not used
by git.

Remove these variables from the fetcher environment.

Users wishing to configure git to work with a proxy should define the
GIT_PROXY_COMMAND environment variable to use an external script.
NO_PROXY can be used within this script to skip the proxy for certain
hosts.

Signed-off-by: Darren Hart <dvhart@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
oe-buildenv-internal: Add upper and lower case proxy vars to BB_ENV_EXTRAWHITE

Applications are inconsistent in their use of upper and lower case proxy
variables. Curl, for example, specifies NO_PROXY (not no_proxy) in the
man page (changed in 2009 [1]). Avoid proxy issues by ensuring both the
upper and lower case versions of each proxy variable are available in
the environment for the fetcher commands.

Add FTPS_PROXY and ftps_proxy to the list as well.

1. http://curl.haxx.se/mail/tracker-2009-04/0012.html

Signed-off-by: Darren Hart <dvhart@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
base.bbclass: Remove generate_git_config()

git no longer supports the use of GIT_CONFIG which defeats the purpose of
GIT_CORE_CONFIG and the generate_git_config() function. Remove it.

Signed-off-by: Darren Hart <dvhart@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
oe-git-proxy: Add a new comprehensive git proxy script

oe-git-proxy.sh is a simple tool to be used via GIT_PROXY_COMMAND. It
uses BSD netcat to make SOCKS5 or HTTPS proxy connections. It uses
ALL_PROXY to determine the proxy server, protocol, and port. It uses
NO_PROXY to skip using the proxy for a comma delimited list of hosts,
host globs (*.example.com), IPs, or CIDR masks (192.168.1.0/24). It is
known to work with both bash and dash shells.

V2: Implement recommendations by Enrico Scholz:
    o Use exec for the nc calls
    o Use "$@" instead of $* to avoid quoting issues inherent with $*
    o Use bash explicitly and simplify some of the string manipulations
    Also:
    o Drop the .sh in the name per Otavio Salvador
    o Remove a stray debug statement

V3: Implement recommendations by Otavio Salvador
    o GPL license blurb
    o Fix minor typo in comment block

Signed-off-by: Darren Hart <dvhart@linux.intel.com>
Cc: Enrico Scholz <enrico.scholz@sigma-chemnitz.de>
Cc: Otavio Salvador <otavio@ossystems.com.br>

git-proxy cleanup

Signed-off-by: Darren Hart <dvhart@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
oe-git-proxy: Use socat instead of BSD nc

BSD nc was commonly available on the current distros until Fedora 18
appears to have dropped it. socat appears to be a reasonable replacement
with availability on Fedora and Ubuntu and going back some time as well.

Update the script to use the socat syntax.
Simplify the logic a bit by using exec for the no-proxy-needed cases.

Signed-off-by: Darren Hart <dvhart@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
oe-git-proxy*: Remove previous git proxy solutions

The new oe-git-proxy should address all git proxying needs, remove
the previous scripts.

V2: Separate the removal of the old scripts into their own patch

Signed-off-by: Darren Hart <dvhart@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
relocate_sdk.py: Fix corruption of sdk binaries

There are two cases of corruption that the relocate_sdk.py was not correctly
dealing with.

1) SDK Extras should be left alone
   Extra external binaries included in an SDK that were linked against the
   host's version of /usr/lib/ld-so.so should not get a relocation applied.
   In the case that was discovered these were LSB compliant binaries that
   already worked on many hosts.

2) If the interp section is too small generate an error
   In the case of the qemu user code, it was using its own .ld file
   to link the executables which overrides the default in the nativesdk
   binutils.  This generated host executables which had a interp section
   that was too small to relocate.

   Now the relocate_sdk.py will print an error and continue on such that
   the error can be fixed by a developer without having to do the
   difficult task of debugging why it is crashing or not loading correctly.

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
populate_sdk_base.bbclass: Improve debugging capabilities for SDK installer

After having to debug the SDK installer a few times in
addition to the relocation code the following patch was created
to improve the capabilities around debugging the SDK installer.

1) Add a verbose mode -D which set a set -x to see what
   the SDK installer is doing.

2) Add a mode -S to save the relocation scripts for the purpose
   of debugging them in conjunction with -D

3) Add a mode -R to not execute the relocation scripts for the
   purpose of debugging the relocations.

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
relocate_sdk.py: allow relocate_sdk.py to work with python 2.4.x

Avoid the chicken / egg problem of an SDK that provides a working
python but requires that version of python to extract itself.  The
RHEL 5.x systems and some other enterprise Linux systems ship with
python 2.4.x as the default python.  We need to at least be able to
extract work executables even if we never use the the host provided
python again.

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>