bitbake:向php配方添加php-intl支持 [英] bitbake: adding php-intl support to php recipe

查看:167
本文介绍了bitbake:向php配方添加php-intl支持的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要构建一个支持带bitbake的intl扩展的php软件包( http://php.net/manual/en/intl.installation.php ).

I need to build a php package supporting the intl extension with bitbake (http://php.net/manual/en/intl.installation.php).

所以我创建了一个bbappend:

So I created a bbappend:

bernardo@bernardo-UX51VZA:~/dev/yocto/meta-steempi$ cat recipes-devtools/php/php_7.%.bbappend 

DEPENDS += " icu apache2"
RDEPENDS_${PN} += " icu apache2"

PACKAGECONFIG_append_pn-php = " apache2 icu icu-dev"
EXTRA_OECONF += " --with-openssl=${STAGING_DIR_TARGET}${exec_prefix} \
                  --with-config-file-path=${sysconfdir}/php/apache2-php${PHP_MAJOR_VERSION} \
                  --with-icu-dir=${BASE_WORKDIR}/${MULTIMACH_TARGET_SYS}/icu/60.2-r0/image/usr \
                  --enable-intl \
"

要启用intl编译,我在 EXTRA_OECONF 中添加了-enable-intl -with-icu-dir . 但是,即使 icu-config 的路径已添加到-with-icu-dir 中,配置任务也会出现以下错误.

To enable the intl compilation, I added the --enable-intl and --with-icu-dir to EXTRA_OECONF. However, the configure task presents the following error, even though the path to icu-config was added to --with-icu-dir.

...
| checking whether to enable internationalization support... yes
| checking for location of ICU headers and libraries... not found 
| configure: error: Unable to detect ICU prefix or /home/bernardo/dev/yocto/poky/build-qemux86-64/tmp/work/core2-64-poky-linux/icu/60.2-r0/image/usr/bin/icu-config failed. Please verify ICU install prefix and make sure icu-config works.
| NOTE: The following config.log files may provide further information.
| NOTE: /home/bernardo/dev/yocto/poky/build-qemux86-64/tmp/work/core2-64-poky-linux/php/7.2.4-r0/build/config.log
| ERROR: configure failed
| WARNING: exit code 1 from a shell command.
| ERROR: Function failed: do_configure (log file is located at /home/bernardo/dev/yocto/poky/build-qemux86-64/tmp/work/core2-64-poky-linux/php/7.2.4-r0/temp/log.do_configure.19483)
ERROR: Task (/home/bernardo/dev/yocto/meta-openembedded/meta-oe/recipes-devtools/php/php_7.2.4.bb:do_configure) failed with exit code '1'
NOTE: Tasks Summary: Attempted 1802 tasks of which 1801 didn't need to be rerun and 1 failed.
Summary: 1 task failed:
  /home/bernardo/dev/yocto/meta-openembedded/meta-oe/recipes-devtools/php/php_7.2.4.bb:do_configure
Summary: There were 2 WARNING messages shown.
Summary: There were 2 ERROR messages shown, returning a non-zero exit code.

我怀疑配置文件正在尝试查找icu的标头,因为 icu-config 脚本(由icu配方生成)设置了正确的路径.

I suspect the configure is trying to find icu's headers, because the icu-config script (generated by icu recipe) is set with the right path.

当我尝试在bbappend的DEPENDS变量中添加icu-dev时,我得到

When I try to add icu-dev to the DEPENDS variable in my bbappend, I get

ERROR: Nothing PROVIDES 'icu-dev' (but /home/leprechaun/dev/yocto/meta-openembedded/meta-oe/recipes-devtools/php/php_7.2.4.bb DEPENDS on or otherwise requires it). Close matches:
  udev
  icu RPROVIDES icu-dev
ERROR: Required build target 'php' has no buildable providers.
Missing or unbuildable dependency chain was: ['php', 'icu-dev']

当我尝试向bbappend中的RDEPENDS变量添加icu-dev时,出现以下错误:

When I try to add icu-dev to the RDEPENDS variable in the bbappend, I get the following error:

ERROR: Nothing RPROVIDES 'icu-dev-native' (but virtual:native:/home/leprechaun/dev/yocto/meta-openembedded/meta-oe/recipes-devtools/php/php_7.2.4.bb RDEPENDS on or otherwise requires it)
NOTE: Runtime target 'icu-dev-native' is unbuildable, removing...
Missing or unbuildable dependency chain was: ['icu-dev-native']
ERROR: Required build target 'php' has no buildable providers.
Missing or unbuildable dependency chain was: ['php', 'php-native', 'icu-dev-native']

关于如何摆脱困境的任何想法?

Any ideas on how to get out of this hole?

谢谢!

推荐答案

我遇到了同样的问题,花了我一段时间,但我的php版本可以正常工作.这是我的.bbappend文件:

I had the same issue and took me a while but I got the php build working. This is my .bbappend file:

EXTRA_OECONF_append_class-target = " --with-curl=${STAGING_LIBDIR}/.."
DEPENDS_append_class-target = " icu curl"

EXTRA_OECONF =+ " --enable-mbstring --with-openssl --enable-bcmath --enable-sockets --enable-intl \
                                          --with-icu-dir=${BASE_WORKDIR}/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/icu/62.1-r0/recipe-sysroot-native/usr \
                      , \
                      , icu-native icu"
PACKAGECONFIG ??= "sqlite3"
PACKAGECONFIG[sqlite3] = "--with-sqlite3=${STAGING_LIBDIR}/.. \
                          --with-pdo-sqlite=${STAGING_LIBDIR}/.. \
                          , \
                          ,sqlite3"

LIBS_pn-php =" -lpthread "
export LIBS
THREADS_pn-php = "pthread"
export THREADS

更新-2020年1月1日

PHP 7.2.1配方有问题.如果您在图层的"thud"分支上,则可能要切换到"warrior"分支并重新运行bitbake php -v命令,或将php 7.3.x +文件的配方从以下位置复制到您的php配方目录中此处 https://github.com/openembedded/meta-openembedded/tree/master/meta-oe/recipes-devtools/php .

Update - 01-01-2020

Something is wrong with the PHP 7.2.1 recipe. If you you are on "thud" branch for your layers then you might want to either switch to "warrior" branch and re-run the bitbake php -v command or copy the recipe for php 7.3.x + files to your php recipe directory from here https://github.com/openembedded/meta-openembedded/tree/master/meta-oe/recipes-devtools/php.

此外,您可以只使用PACKAGECONFIG选项.您的里程会因您要构建PHP的第三方库而异.我使用针对PHP 7.3.4的以下更新配方在thud和warrior分支上都使用了php intl:

Also, you could just use the PACKAGECONFIG option. Your mileage will vary to the third party libs you want for your php build. I got php intl working on both thud and warrior branches using the following updated recipe for PHP 7.3.4:

EXTRA_OECONF_append_class-target = " --with-curl=${STAGING_LIBDIR}/.."
DEPENDS_append_class-target = " icu curl openssl"

EXTRA_OECONF =+ " --enable-mbstring --with-openssl=${STAGING_DIR_TARGET}${exec_prefix} --enable-bcmath --enable-sockets --enable-intl \
                      , \
                      , icu-native icu"
PACKAGECONFIG ??= "intl sqlite3"
PACKAGECONFIG[sqlite3] = "--with-openssl=${STAGING_DIR_TARGET}${exec_prefix} \
              --with-sqlite3=${STAGING_LIBDIR}/.. \
                          --with-pdo-sqlite=${STAGING_LIBDIR}/.. \
                          , \
                          ,sqlite3"

LIBS_pn-php =" -lpthread "
export LIBS
THREADS_pn-php = "pthread"
export THREADS

这篇关于bitbake:向php配方添加php-intl支持的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆