[meta-oe] sip3: simplify recipe

Submitted by S. Lockwood-Childs on Jan. 29, 2021, 10:03 a.m. | Patch ID: 179310

Details

Message ID 20210129100359.vwoop7ksfrvfpmlb@vctlabs.com
State Changes Requested
Headers show

Commit Message

S. Lockwood-Childs Jan. 29, 2021, 10:03 a.m.
The custom configure block can be shared between target
and native if you just configure the sysroot option accordingly
and use STAGING_INCDIR to locate the python headers to build
against.

Signed-off-by: S. Lockwood-Childs <sjl@vctlabs.com>
---
 meta-oe/recipes-devtools/sip/sip3_4.19.23.bb | 17 +++++------------
 1 file changed, 5 insertions(+), 12 deletions(-)

Patch hide | download patch | download mbox

diff --git a/meta-oe/recipes-devtools/sip/sip3_4.19.23.bb b/meta-oe/recipes-devtools/sip/sip3_4.19.23.bb
index 320755b84..ae8df5055 100644
--- a/meta-oe/recipes-devtools/sip/sip3_4.19.23.bb
+++ b/meta-oe/recipes-devtools/sip/sip3_4.19.23.bb
@@ -19,24 +19,17 @@  PACKAGES += "python3-sip3"
 
 BBCLASSEXTEND = "native"
 
-do_configure_prepend_class-target() {
-    echo "py_platform = linux" > sip.cfg
-    echo "py_inc_dir = %(sysroot)/${includedir}/python%(py_major).%(py_minor)${PYTHON_ABI}" >> sip.cfg
-    echo "sip_bin_dir = ${D}/${bindir}" >> sip.cfg
-    echo "sip_inc_dir = ${D}/${includedir}" >> sip.cfg
-    echo "sip_module_dir = ${D}/${libdir}/python%(py_major).%(py_minor)/site-packages" >> sip.cfg
-    echo "sip_sip_dir = ${D}/${datadir}/sip" >> sip.cfg
-    ${PYTHON} configure.py --configuration sip.cfg --sip-module PyQt5.sip --sysroot ${STAGING_DIR_HOST} CC="${CC}" CXX="${CXX}" LINK="${CXX}" STRIP="" LINK_SHLIB="${CXX}" CFLAGS="${CFLAGS}" CXXFLAGS="${CXXFLAGS}" LFLAGS="${LDFLAGS}"
-}
+CONFIGURE_SYSROOT = "${STAGING_DIR_HOST}"
+CONFIGURE_SYSROOT_class-native = "${STAGING_DIR_NATIVE}"
 
-do_configure_prepend_class-native() {
+do_configure_prepend() {
     echo "py_platform = linux" > sip.cfg
-    echo "py_inc_dir = ${includedir}/python%(py_major).%(py_minor)${PYTHON_ABI}" >> sip.cfg
+    echo "py_inc_dir = ${STAGING_INCDIR}/python%(py_major).%(py_minor)${PYTHON_ABI}" >> sip.cfg
     echo "sip_bin_dir = ${D}/${bindir}" >> sip.cfg
     echo "sip_inc_dir = ${D}/${includedir}" >> sip.cfg
     echo "sip_module_dir = ${D}/${libdir}/python%(py_major).%(py_minor)/site-packages" >> sip.cfg
     echo "sip_sip_dir = ${D}/${datadir}/sip" >> sip.cfg
-    ${PYTHON} configure.py --configuration sip.cfg --sip-module PyQt5.sip --sysroot=${STAGING_DIR_NATIVE}
+    ${PYTHON} configure.py --configuration sip.cfg --sip-module PyQt5.sip --sysroot ${CONFIGURE_SYSROOT} CC="${CC}" CXX="${CXX}" LINK="${CXX}" STRIP="" LINK_SHLIB="${CXX}" CFLAGS="${CFLAGS}" CXXFLAGS="${CXXFLAGS}" LFLAGS="${LDFLAGS}"
 }
 
 do_install() {

Comments

Khem Raj Jan. 29, 2021, 5:55 p.m.
Can you rebase it on top of master-next

On Fri, Jan 29, 2021 at 2:00 AM S. Lockwood-Childs <sjl@vctlabs.com> wrote:
>
> The custom configure block can be shared between target
> and native if you just configure the sysroot option accordingly
> and use STAGING_INCDIR to locate the python headers to build
> against.
>
> Signed-off-by: S. Lockwood-Childs <sjl@vctlabs.com>
> ---
>  meta-oe/recipes-devtools/sip/sip3_4.19.23.bb | 17 +++++------------
>  1 file changed, 5 insertions(+), 12 deletions(-)
>
> diff --git a/meta-oe/recipes-devtools/sip/sip3_4.19.23.bb b/meta-oe/recipes-devtools/sip/sip3_4.19.23.bb
> index 320755b84..ae8df5055 100644
> --- a/meta-oe/recipes-devtools/sip/sip3_4.19.23.bb
> +++ b/meta-oe/recipes-devtools/sip/sip3_4.19.23.bb
> @@ -19,24 +19,17 @@ PACKAGES += "python3-sip3"
>
>  BBCLASSEXTEND = "native"
>
> -do_configure_prepend_class-target() {
> -    echo "py_platform = linux" > sip.cfg
> -    echo "py_inc_dir = %(sysroot)/${includedir}/python%(py_major).%(py_minor)${PYTHON_ABI}" >> sip.cfg
> -    echo "sip_bin_dir = ${D}/${bindir}" >> sip.cfg
> -    echo "sip_inc_dir = ${D}/${includedir}" >> sip.cfg
> -    echo "sip_module_dir = ${D}/${libdir}/python%(py_major).%(py_minor)/site-packages" >> sip.cfg
> -    echo "sip_sip_dir = ${D}/${datadir}/sip" >> sip.cfg
> -    ${PYTHON} configure.py --configuration sip.cfg --sip-module PyQt5.sip --sysroot ${STAGING_DIR_HOST} CC="${CC}" CXX="${CXX}" LINK="${CXX}" STRIP="" LINK_SHLIB="${CXX}" CFLAGS="${CFLAGS}" CXXFLAGS="${CXXFLAGS}" LFLAGS="${LDFLAGS}"
> -}
> +CONFIGURE_SYSROOT = "${STAGING_DIR_HOST}"
> +CONFIGURE_SYSROOT_class-native = "${STAGING_DIR_NATIVE}"
>
> -do_configure_prepend_class-native() {
> +do_configure_prepend() {
>      echo "py_platform = linux" > sip.cfg
> -    echo "py_inc_dir = ${includedir}/python%(py_major).%(py_minor)${PYTHON_ABI}" >> sip.cfg
> +    echo "py_inc_dir = ${STAGING_INCDIR}/python%(py_major).%(py_minor)${PYTHON_ABI}" >> sip.cfg
>      echo "sip_bin_dir = ${D}/${bindir}" >> sip.cfg
>      echo "sip_inc_dir = ${D}/${includedir}" >> sip.cfg
>      echo "sip_module_dir = ${D}/${libdir}/python%(py_major).%(py_minor)/site-packages" >> sip.cfg
>      echo "sip_sip_dir = ${D}/${datadir}/sip" >> sip.cfg
> -    ${PYTHON} configure.py --configuration sip.cfg --sip-module PyQt5.sip --sysroot=${STAGING_DIR_NATIVE}
> +    ${PYTHON} configure.py --configuration sip.cfg --sip-module PyQt5.sip --sysroot ${CONFIGURE_SYSROOT} CC="${CC}" CXX="${CXX}" LINK="${CXX}" STRIP="" LINK_SHLIB="${CXX}" CFLAGS="${CFLAGS}" CXXFLAGS="${CXXFLAGS}" LFLAGS="${LDFLAGS}"
>  }
>
>  do_install() {
> --
> 2.20.1
>
> 
>
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#89179): https://lists.openembedded.org/g/openembedded-devel/message/89179
Mute This Topic: https://lists.openembedded.org/mt/80206314/3617530
Group Owner: openembedded-devel+owner@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [oe-patchwork@oe-patch.openembedded.org]
-=-=-=-=-=-=-=-=-=-=-=-