在 pkg-config 搜索路径中找不到软件包 xkbcommon。构建 Yocto 图像时

Package xkbcommon was not found in the pkg-config search path. when building Yocto image

在 Ubuntu 14.04

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 14.04.3 LTS
Release:    14.04
Codename:   trusty

使用 fido 分支构建 Yocto Poky 图像

inherit core-image
IMAGE_FEATURES += "x11-base x11-sato package-management ssh-server-dropbear"
IMAGE_INSTALL += "chromium \
                  lsb \
                  kernel-modules \
                  alsa-utils \

...我收到了这样的消息

我看起来像它与 Chromium 配方有关 /meta-browser/recipes-browser/chromium/chromium_45.0.2454.85.bb,它是这样开始的

include chromium.inc

DESCRIPTION = "Chromium browser"
DEPENDS += "libgnome-keyring"

我收到这条消息

ERROR: Logfile of failure stored in: /home/joel/yocto/build-fido/tmp/work/cortexa7hf-vfp-vfpv4-neon-poky-linux-gnueabi/chromium/45.0.2454.85-r0/temp/log.do_configure.28622
Log data follows:
| DEBUG: Executing python function sysroot_cleansstate
| DEBUG: Python function sysroot_cleansstate finished
| DEBUG: Executing shell function do_configure
| Updating projects from gyp files...
| Package xkbcommon was not found in the pkg-config search path.
| Perhaps you should add the directory containing `xkbcommon.pc'
| to the PKG_CONFIG_PATH environment variable
| No package 'xkbcommon' found
| gyp: Call to 'pkg-config --cflags xkbcommon' returned exit status 1.
| WARNING: exit code 1 from a shell command.

我试过的

安装了库

$ sudo apt-get install libxkbcommon-x11-dev

搜索 xkbcommon.pc

$ apt-file search xkbcommon.pc
libxkbcommon-dev: /usr/lib/x86_64-linux-gnu/pkgconfig/xkbcommon.pc

pkg-config

joel@linux-Lenovo-G50-70:~/yocto/build-fido$ pkg-config --cflags xkbcommon
               <=== Return is EMPTY (?)
joel@linux-Lenovo-G50-70:~/yocto/build-fido$ pkg-config --libs xkbcommon
-lxkbcommon    <=== Looks correct

已添加PKG_CONFIG_PATH

 $ PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/lib/x86_64-linux-gnu/pkgconfig/
 $ export PKG_CONFIG_PATH


 $ env | grep PKG
 PKG_CONFIG_PATH=:/usr/lib/x86_64-linux-gnu/pkgconfig/

但是当 运行 bitbake

时我仍然收到相同的消息

有什么建议吗?

查找xkbcommon

$ find /usr/lib/ -name *xkbcommon*
/usr/lib/x86_64-linux-gnu/libxkbcommon.so
/usr/lib/x86_64-linux-gnu/libxkbcommon.so.0.0.0
/usr/lib/x86_64-linux-gnu/libxkbcommon-x11.so.0.0.0
/usr/lib/x86_64-linux-gnu/libxkbcommon-x11.a
/usr/lib/x86_64-linux-gnu/libxkbcommon.a
/usr/lib/x86_64-linux-gnu/libxkbcommon-x11.so.0
/usr/lib/x86_64-linux-gnu/libxkbcommon-x11.so
/usr/lib/x86_64-linux-gnu/pkgconfig/xkbcommon.pc
/usr/lib/x86_64-linux-gnu/pkgconfig/xkbcommon-x11.pc
/usr/lib/x86_64-linux-gnu/libxkbcommon.so.0

在这种情况下,未能找到 libxkbcommon 的铬配方。由于在为目标系统构建配方时发生错误,我们需要告诉构建系统铬配方依赖于 libxkbcommmon.

这可以通过添加

来完成
 DEPENDS += "libxkbcommon"

铬配方。

值得注意的是,libxkbcommon 很可能是一个可选的依赖项,在这种情况下,它应该由合适的 PACKAGECONFIG 处理。 (参见 PACKAGECONFIG in ref.manual)。

Note: I've never built chromium myself, thus I'd prefer to not suggest any suitable PACKAGECONFIG.

我认为 Chromium_45 食谱自从我上次看到它后就被删除了(再也看不到了)。

无论如何,这就是我对 Chromium_40 所做的。 我禁用了 Wayland(Chromium 中的 ozone-wayland),因此它只会使用 x11。

在local.conf中,我添加了 CHROMIUM_ENABLE_WAYLAND = "0"

通过这样做,我将绕过CHROMIUM_WAYLAND_DEPENDS = "wayland libxkbcommon"

CHROMIUM_X11_DEPENDS = "xextproto gtk+ libxi libxss"
CHROMIUM_X11_GYP_DEFINES = ""
CHROMIUM_WAYLAND_DEPENDS = "wayland libxkbcommon"
CHROMIUM_WAYLAND_GYP_DEFINES = "use_ash=1 use_aura=1 chromeos=0 use_ozone=1"

python() {
    if d.getVar('CHROMIUM_ENABLE_WAYLAND', True) == '1':
        d.appendVar('DEPENDS', ' %s ' % d.getVar('CHROMIUM_WAYLAND_DEPENDS', True))
        d.appendVar('GYP_DEFINES', ' %s ' % d.getVar('CHROMIUM_WAYLAND_GYP_DEFINES', True))
    else:
        d.appendVar('DEPENDS', ' %s ' % d.getVar('CHROMIUM_X11_DEPENDS', True))
        d.appendVar('GYP_DEFINES', ' %s ' % d.getVar('CHROMIUM_X11_GYP_DEFINES', True))
}

P.S.: 我发现的另一件事是 use-egl.
PACKAGECONFIG[use-egl] = ",,virtual/egl virtual/libgles2"PACKAGECONFIG[use-egl] = "" 覆盖,所以我从 chromium.inc

中删除了 PACKAGECONFIG[use-egl] = ""
PACKAGECONFIG ??= "use-egl"

# this makes sure the dependencies for the EGL mode are present; otherwise, the configure scripts
# automatically and silently fall back to GLX
PACKAGECONFIG[use-egl] = ",,virtual/egl virtual/libgles2"

# Additional PACKAGECONFIG options - listed here to avoid warnings
PACKAGECONFIG[component-build] = ""
PACKAGECONFIG[disable-api-keys-info-bar] = ""
PACKAGECONFIG[ignore-lost-context] = ""
PACKAGECONFIG[impl-side-painting] = ""
PACKAGECONFIG[use-egl] = ""
PACKAGECONFIG[kiosk-mode] = ""