buildhistory.bbclass: Improve robustness in image file listing

The filenames sometimes may have strange names. With the 'awk' script
it handled a limited number of spaces in the filename and a package
installing a file named "test file with spaces" would have its name
truncated.

This patch uses the find's printf formating to simplify the code and
properly handle this case. From a testing image, the only diff produced
is:

,----[ files-in-image.txt diff ]
| --rwxr-xr-x root       root                0 ./usr/bin/test\ file\ with\
| +-rwxr-xr-x root       root                0 ./usr/bin/test file with spaces
`----

The options used are available since findutils 4.2.5, released in 19
Nov 2004, making it available in all supported host distributions.

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
multilib.bbclass: fix Multilib QA Issue

Multilib QA warning was observed, as follows:
------
WARNING: Multilib QA Issue: lib32-oprofile package lib32-oprofile -
suspicious values 'kernel-vmlinux' in RRECOMMENDS
------

The package starting with 'kernel-vmlinux' should be ok with multilib QA
checking.

Signed-off-by: Ming Liu <ming.liu@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
wpa-supplicant: Add dependency on openssl

Building of wpa-supplicant failed due to missing dependency on openssl:
crypto_openssl.c:10:30: fatal error: openssl/opensslv.h: No such file or directory

Signed-off-by: Mikhail Durnev <Mikhail_Durnev@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
cml1.bbclass: Fix return code handling in do_menuconfig()

On my system, doing "bitbake -c menuconfig busybox" pops up
a gnome-terminal, I can see that the compilation starts but then the
terminal automatically exits.

It turns out I don't have ncurses development package installed on my host,
and OE's host sysroot isn't being passed to gcc, so compilation fails.
The window automatically closes before I can read the error message
since the '$' in the return code check needs to be escaped.

Make sure the user can read the error message by properly checking the
return code.

Signed-off-by: Jacob Kroon <jacob.kroon@mikrodidakt.se>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
packagegroup-core-standalone-sdk-target: Add qemuwrapper-cross to target sysroot

Some postinstall scripts use the qemuwrapper script, so to be able to
offline install these packages outside of the bitbake environment, this script
needs to be exposed also in the SDK.

This to enable rootfs generation from a package repository using only a
package repository and the toolchain tarball.

See https://github.com/nysan/rootfs-sandbox for examples.

Signed-off-by: David Nyström <david.nystrom@enea.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
udev: fix typo

Fix the typo in the RDEPENDS statement to make it have real effect.

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
oeqa/runtime: rpm: fix finding the test rpm file

Translate TUNE_PKGARCH to find the right file (this
used to work because tune for qemux86-64 used to be
x86_64 now it's core2-64)
Also, while using packagedata was nice, it's harder to make
the test exportable and runnable outside of the
build system. (where oe.packagedata isn't available)

Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
scripts/runqemu-internal: use -cpu core2duo for qemux86-64

Now that the tune for qemux86-64 changed to core2-64 we need to
tell the emulator to use a proper CPU model. With the default setting
of qemu64 we'll get things like:

root@qemux86-64:~# smart --help
traps: python[758] trap invalid opcode ip:7f2af01f6be7 sp:7fff49466ef0 error:0 in strop.so[7f2af01f5000+6000]
Illegal instruction

If the tune for qemux86 changes, that needs to be updated too.

Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
python-numpy: don't search host directories for libraries

The build process hard-codes searches of various directories in /usr when
looking for libraries, delete this to avoid host contamination.

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
pkgconfig: remove out-dated configure options and dependencies

0.27 onwards uses a snapshot of glib 2 not glib 1, so drop the
do_configure_prepend and update the internal/installed options as appropriate.

Legacy scripts were removed in 0.26.

Use of popt was removed in 0.28.

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
package.bbclass: Don't search for providers of PRIVATE_LIBS

* split PRIVATE_LIBS and don't use find(), so that libfoo cannot be
  found in PRIVATE_LIBS = "libfoobar"

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
package.bbclass: Show which files require given dependency in debug output

* when log.do_package shows some unexpected dependency, people usually
  need to grep package directory to find which binary was creating that
  dependency, show it directly in the debug output

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
package.bbclass: add SHLIBSSEARCHDIRS to define where to search for shlib providers

* 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

[YOCTO #4628]

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
qemux86: Add identical qemux86copy variant for tests

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
WIP: Add KERNEL_EXTRA_ARGS?
gtk+: Add PACKAGECONFIG for directfb

* building without x11 doesn't work, because it sets default
  gdkbackend to x11 and then requires cairo-xlib to be available
* checking for CAIRO_BACKEND... no
  configure: error: Package requirements (cairo-xlib >= 1.6) were not met:

  No package 'cairo-xlib' found

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
archiver: Use subdirectory in WORKDIR when creating archives

* RFC: because I haven't tested all possible archiver configurations
       please check added note about diffgz archives and .org -
       was it ever working correctly? It was like this since initial
       commit.

* archiver can sometimes overwrite or remove some files which are
  needed by other tasks.

  This happens in cases where file referenced in SRC_URI aren't
  unpacked and are used by other tasks directly from WORKDIR

  def archive_sources(d, stage_name): downloads sources from
  SRC_URI again to WORKDIR in order to create source tarball from them
  (normally it's ok, because source tarball is directly unpacked from
  DL_DIR so never stays in WORKDIR).

  def archive_sources_patches(d, stage_name): then creates the tarball
  itself and moves source and patch tarballs to deploy with:
  move_tarball_deploy(d, [source_tar_name, patch_tar_name])

  But in cases where source_tar_name == "required" file we're using:
    1) do_unpack downloads "required" from DL_DIR to WORKDIR,
    2) archive_sources overwrites it with another copy,
    3) archive_sources_patches removes it,
    4) do_deploy fails because it wants to install now non-existent
       ${WORKDIR}/required

* move duplicated ARCHIVE_SSTATE_* assignments from archive-*.bbclass
  to common archiver.bbclass
* introduce separate workdir for archiver ARCHIVE_SSTATE_WORKDIR and
  move ARCHIVE_SSTATE_SCRIPTS_LOGS_INDIR,
  ARCHIVE_SSTATE_DIFFGZ_ENVDATA_INDIR into it
* change archiver.bbclass to dump scripts-logs and diffgs-envdata into
  right directory (respect variables defined above instead of hardcoding
  the paths in code).
* use d.getVar* API
* unify workdir/work_dir usage for ${WORKDIR} and use separate variable
  archiver_workdir when it means ARCHIVE_SSTATE_WORKDIR

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
libsdl: Add support for libsdl-native

Change-Id: I4fb1e623c7bbb1f35ae3001c839cd7e16ce1bd65
Signed-off-by: Alexandru Niculita <alexnick87@gmail.com>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
dbus, systemd, apmd, rpcbind, nfs-utils, alsa-state, openssh, ppp, cronie, irda-utils: Drop initscripts-functions runtime dependency

* all these are working fine in my systemd images
  with initscripts blacklisted just to make sure that they don't leak to
  image

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>