yocto do_patch不适用于原生

时间:2016-12-29 10:45:02

标签: linux cross-compiling yocto bitbake

我正在尝试编写一个配方,它确实适用于我的补丁,但当我添加我的食谱“inherit native”时,它只是简单地通过我的补丁而不应用它。

首先,我想升级一个基础recipe,将其文件名更改为2.8.33(此方法通常适用于其他配方)。我在编译时遇到错误,在发现错误后,我做了一个补丁并将其添加到配方中。当我从配方中删除原生相关的行时,它已成功编译。我检查了工作目录中的代码我看到我的补丁已应用。但对于本机编译,我看不到我的补丁应用于提取的代码。

gsoap_2.8.33.inc:

DESCRIPTION = "The gSOAP toolkit provides a unique SOAP-to-C/C++ language binding \
for the development of SOAP Web Services and clients."
SECTION = "devel"
LICENSE = "GPLv2"
LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=f195e609151c013dcfce95528e2d4c63"

SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}2/${BPN}_${PV}.zip"
SRC_URI[md5sum] = "43dade7839252500f7671f8fe6a3739c"
SRC_URI[sha256sum] = "8534a8bb82ce97544bbb60bf4410ef66f9c328abf62879e499272894019199a4"

inherit autotools


PR = "r1"

S = "${WORKDIR}/gsoap-2.8"


FILES_${PN}-dev = "${includedir}"
RRECOMMENDS_${PN}-dev = "${PN}-staticdev"

FILES_${PN}-staticdev = "${libdir}"


EXTRA_OECONF_append =" --enable-ipv6 "


EXTRA_OEMAKE = "SOAP=${STAGING_BINDIR_NATIVE}/soapcpp2"


PARALLEL_MAKE = ""

gsoap-native_2.8.33.bb(无效,无法修补):

inherit native
require gsoap_${PV}.inc

FILESEXTRAPATHS_append := "${THISDIR}/:"  


SRC_URI += "file://conf.patch"

PARALLEL_MAKE = ""

DEPENDS = ""
EXTRA_OEMAKE = ""

do_patch_append() {
d.setVar("TEXT", "Hello World")
print d.getVar("TEXT", True)
}

do_install() {
    oe_runmake DESTDIR=${D} BINDIR=${D}${bindir} install
}

gsoap_2.8.33.bb(在删除gsoap-native依赖时工作并进行修补):

require gsoap_${PV}.inc
DEPENDS = "gsoap-native openssl zlib flex bison"

FILESEXTRAPATHS_append := "${THISDIR}/:"  
SRC_URI += "file://conf.patch" 

do_install_append() {
    install -d ${D}${libdir}
    for lib in libgsoapssl libgsoapssl++ libgsoap libgsoapck++ libgsoap++ libgsoapck
    do
        oe_libinstall -C gsoap $lib ${D}${libdir}
    done
}

FILES_${PN} = "${bindir}/wsdl2h ${bindir}/soapcpp2"
FILES_${PN} += "${datadir}"

我的补丁:

diff --git a/configure b/configure
index a3fade3..8708cad 100755
--- a/configure
+++ b/configure
@@ -6196,7 +6196,7 @@ $as_echo "no" >&6; }
     WSDL2H_EXTRA_FLAGS="-DWITH_OPENSSL -DWITH_GZIP"
     # an ugly hack to get httpda and smdevp plugins to conditionally
     # compile with wsdl2h when OPENSSL is available
-    WSDL2H_EXTRA_LIBS="${WSDL2H_EXTRA_LIBS} ../plugin/httpda.c ../plugin/smdevp.c ../plugin/threads.c -lssl -lcrypto -lz"
+    #WSDL2H_EXTRA_LIBS="${WSDL2H_EXTRA_LIBS} ../plugin/httpda.c ../plugin/smdevp.c ../plugin/threads.c -lssl -lcrypto -lz"
     SAMPLE_INCLUDES=
     SAMPLE_SSL_LIBS="-lssl -lcrypto -lz"
     WSDL2H_SOAP_CPP_LIB="libgsoapssl++.a"

如何使用我的补丁对我的配方进行交叉编译进行bitbake?

1 个答案:

答案 0 :(得分:1)

你仍然没有解释究竟是什么失败以及你是如何检查的......我测试了你的gsoap-native配方,在删除了破坏的do_patch_append()函数之后,它补丁很好:bitbake -c patch gsoap-native之后我可以请参阅gsoap-native工作目录中的修补源代码。

一些注意事项:

  • 你正在修补一个将在do_configure期间重新生成的文件(autotools类将运行autoreconf) - 也许这就是你认为修补没有发生的原因。改为修改configure.ac。
  • 不需要分离原始配方和目标配方:meta-openembedded中的原始配方已经支持构建gsoap和gsoap-native。如果您需要添加补丁以使新版本工作,那么请不要开始编写新的配方。