diff mbox series

[meta-arago,scarthgap,09/10] libyang: Do the version bump in a yocto-check-layer compliant manner

Message ID 20251113225017.22994-9-reatmon@ti.com
State Accepted
Delegated to: Ryan Eatmon
Headers show
Series [meta-arago,scarthgap,01/10] offscreendemo: Add REQUIRED_DISTRO_FEATURES | expand

Commit Message

Ryan Eatmon Nov. 13, 2025, 10:50 p.m. UTC
Yocto Project Compatibility requires that including a layer in a build
not change recipes in other layers.  In this case, we were providing a
newer version of a recipe that another layer provides.

The proper way of doing this is to create a bbappend and only change the
minimal things needed to perform your changes.  Additionally, to pass
the yocto-check-layer the bbappend needs to be wrapped in a manner that
only applies your changes in the event that you are making use of your
layer.  For Arago, that means only if we are building Arago.

Signed-off-by: Ryan Eatmon <reatmon@ti.com>
---
 .../sysrepo/libyang-arago.inc                 |  9 ++++
 .../sysrepo/libyang_%.bbappend                |  5 +++
 .../recipes-extended/sysrepo/libyang_3.7.8.bb | 45 -------------------
 3 files changed, 14 insertions(+), 45 deletions(-)
 create mode 100644 meta-arago-extras/recipes-extended/sysrepo/libyang-arago.inc
 delete mode 100644 meta-arago-extras/recipes-extended/sysrepo/libyang_3.7.8.bb

Comments

Denys Dmytriyenko Nov. 13, 2025, 11:09 p.m. UTC | #1
On Thu, Nov 13, 2025 at 04:50:16PM -0600, Ryan Eatmon via lists.yoctoproject.org wrote:
> Yocto Project Compatibility requires that including a layer in a build
> not change recipes in other layers.  In this case, we were providing a
> newer version of a recipe that another layer provides.
> 
> The proper way of doing this is to create a bbappend and only change the
> minimal things needed to perform your changes.  Additionally, to pass
> the yocto-check-layer the bbappend needs to be wrapped in a manner that
> only applies your changes in the event that you are making use of your
> layer.  For Arago, that means only if we are building Arago.

Thanks for this descriptive commit message - it captures reasoning and a 
proper solution! It is a great example we can refer to in the future.


> Signed-off-by: Ryan Eatmon <reatmon@ti.com>
> ---
>  .../sysrepo/libyang-arago.inc                 |  9 ++++
>  .../sysrepo/libyang_%.bbappend                |  5 +++
>  .../recipes-extended/sysrepo/libyang_3.7.8.bb | 45 -------------------
>  3 files changed, 14 insertions(+), 45 deletions(-)
>  create mode 100644 meta-arago-extras/recipes-extended/sysrepo/libyang-arago.inc
>  delete mode 100644 meta-arago-extras/recipes-extended/sysrepo/libyang_3.7.8.bb
> 
> diff --git a/meta-arago-extras/recipes-extended/sysrepo/libyang-arago.inc b/meta-arago-extras/recipes-extended/sysrepo/libyang-arago.inc
> new file mode 100644
> index 00000000..b76701a8
> --- /dev/null
> +++ b/meta-arago-extras/recipes-extended/sysrepo/libyang-arago.inc
> @@ -0,0 +1,9 @@
> +PV = "3.7.8"
> +
> +LIC_FILES_CHKSUM = "file://LICENSE;md5=9bb3d334294e8719f41c531e28a9a697"

May want to explicitly mention why the checksum is different vs. upstream.


> +SRCREV = "03e294d83b610f89e8ba7b2156a80dc0ad534443"
> +
> +do_install:append () {
> +    oe_multilib_header  libyang/ly_config.h
> +}
> diff --git a/meta-arago-extras/recipes-extended/sysrepo/libyang_%.bbappend b/meta-arago-extras/recipes-extended/sysrepo/libyang_%.bbappend
> index 608377e3..60d1258e 100644
> --- a/meta-arago-extras/recipes-extended/sysrepo/libyang_%.bbappend
> +++ b/meta-arago-extras/recipes-extended/sysrepo/libyang_%.bbappend
> @@ -1 +1,6 @@
> +LIBYANG_ARAGO = ""
> +LIBYANG_ARAGO:arago = "libyang-arago.inc"
> +
> +require ${LIBYANG_ARAGO}
> +
>  BBCLASSEXTEND = "native nativesdk"
> diff --git a/meta-arago-extras/recipes-extended/sysrepo/libyang_3.7.8.bb b/meta-arago-extras/recipes-extended/sysrepo/libyang_3.7.8.bb
> deleted file mode 100644
> index 3bea9bc2..00000000
> --- a/meta-arago-extras/recipes-extended/sysrepo/libyang_3.7.8.bb
> +++ /dev/null
> @@ -1,45 +0,0 @@
> -SUMMARY = "YANG data modeling language library"
> -DESCRIPTION = "libyang is a YANG data modelling language parser and toolkit written (and providing API) in C."
> -HOMEPAGE = "https://github.com/CESNET/libyang"
> -SECTION = "libs"
> -LICENSE = "BSD-3-Clause"
> -
> -LIC_FILES_CHKSUM = "file://LICENSE;md5=9bb3d334294e8719f41c531e28a9a697"
> -
> -SRCREV = "03e294d83b610f89e8ba7b2156a80dc0ad534443"
> -
> -SRC_URI = "git://github.com/CESNET/libyang.git;branch=master;protocol=https \
> -           file://0001-test_context-skip-test-case-test_searchdirs.patch \
> -           file://run-ptest \
> -           "
> -
> -S = "${WORKDIR}/git"
> -
> -# Main dependencies
> -inherit cmake pkgconfig lib_package ptest multilib_header
> -DEPENDS = "libpcre2"
> -DEPENDS += "${@bb.utils.contains('PTEST_ENABLED', '1', 'cmocka', '', d)}"
> -
> -EXTRA_OECMAKE = "-DCMAKE_BUILD_TYPE=Release"
> -EXTRA_OECMAKE += " ${@bb.utils.contains('PTEST_ENABLED', '1', '-DENABLE_TESTS=ON -DENABLE_VALGRIND_TESTS=OFF', '', d)}"
> -
> -do_compile:prepend () {
> -    if [ ${PTEST_ENABLED} = "1" ]; then
> -        sed -i -e 's|${S}|${PTEST_PATH}|g' ${B}/tests/tests_config.h
> -        sed -i -e 's|${B}|${PTEST_PATH}|g' ${B}/tests/tests_config.h
> -    fi
> -}
> -
> -do_install:append () {
> -        oe_multilib_header  libyang/ly_config.h
> -}
> -
> -do_install_ptest () {
> -    install -d ${D}${PTEST_PATH}/tests
> -    cp -f ${B}/tests/utest_* ${D}${PTEST_PATH}/tests/
> -    cp -fR ${S}/tests/modules ${D}${PTEST_PATH}/tests/
> -    install -d ${D}${PTEST_PATH}/tests/plugins
> -    cp -f ${B}/tests/plugins/plugin_*.so ${D}${PTEST_PATH}/tests/plugins/
> -}
> -
> -FILES:${PN} += "${datadir}/yang/*"
> -- 
> 2.17.1
Ryan Eatmon Nov. 14, 2025, 12:53 a.m. UTC | #2
On 11/13/2025 5:09 PM, Denys Dmytriyenko wrote:
> On Thu, Nov 13, 2025 at 04:50:16PM -0600, Ryan Eatmon via lists.yoctoproject.org wrote:
>> Yocto Project Compatibility requires that including a layer in a build
>> not change recipes in other layers.  In this case, we were providing a
>> newer version of a recipe that another layer provides.
>>
>> The proper way of doing this is to create a bbappend and only change the
>> minimal things needed to perform your changes.  Additionally, to pass
>> the yocto-check-layer the bbappend needs to be wrapped in a manner that
>> only applies your changes in the event that you are making use of your
>> layer.  For Arago, that means only if we are building Arago.
> 
> Thanks for this descriptive commit message - it captures reasoning and a
> proper solution! It is a great example we can refer to in the future.
> 
> 
>> Signed-off-by: Ryan Eatmon <reatmon@ti.com>
>> ---
>>   .../sysrepo/libyang-arago.inc                 |  9 ++++
>>   .../sysrepo/libyang_%.bbappend                |  5 +++
>>   .../recipes-extended/sysrepo/libyang_3.7.8.bb | 45 -------------------
>>   3 files changed, 14 insertions(+), 45 deletions(-)
>>   create mode 100644 meta-arago-extras/recipes-extended/sysrepo/libyang-arago.inc
>>   delete mode 100644 meta-arago-extras/recipes-extended/sysrepo/libyang_3.7.8.bb
>>
>> diff --git a/meta-arago-extras/recipes-extended/sysrepo/libyang-arago.inc b/meta-arago-extras/recipes-extended/sysrepo/libyang-arago.inc
>> new file mode 100644
>> index 00000000..b76701a8
>> --- /dev/null
>> +++ b/meta-arago-extras/recipes-extended/sysrepo/libyang-arago.inc
>> @@ -0,0 +1,9 @@
>> +PV = "3.7.8"
>> +
>> +LIC_FILES_CHKSUM = "file://LICENSE;md5=9bb3d334294e8719f41c531e28a9a697"
> 
> May want to explicitly mention why the checksum is different vs. upstream.

Since this was just a repackaging of the existing recipe, I didn't think 
it was needed to list all that out.

> 
>> +SRCREV = "03e294d83b610f89e8ba7b2156a80dc0ad534443"
>> +
>> +do_install:append () {
>> +    oe_multilib_header  libyang/ly_config.h
>> +}
>> diff --git a/meta-arago-extras/recipes-extended/sysrepo/libyang_%.bbappend b/meta-arago-extras/recipes-extended/sysrepo/libyang_%.bbappend
>> index 608377e3..60d1258e 100644
>> --- a/meta-arago-extras/recipes-extended/sysrepo/libyang_%.bbappend
>> +++ b/meta-arago-extras/recipes-extended/sysrepo/libyang_%.bbappend
>> @@ -1 +1,6 @@
>> +LIBYANG_ARAGO = ""
>> +LIBYANG_ARAGO:arago = "libyang-arago.inc"
>> +
>> +require ${LIBYANG_ARAGO}
>> +
>>   BBCLASSEXTEND = "native nativesdk"
>> diff --git a/meta-arago-extras/recipes-extended/sysrepo/libyang_3.7.8.bb b/meta-arago-extras/recipes-extended/sysrepo/libyang_3.7.8.bb
>> deleted file mode 100644
>> index 3bea9bc2..00000000
>> --- a/meta-arago-extras/recipes-extended/sysrepo/libyang_3.7.8.bb
>> +++ /dev/null
>> @@ -1,45 +0,0 @@
>> -SUMMARY = "YANG data modeling language library"
>> -DESCRIPTION = "libyang is a YANG data modelling language parser and toolkit written (and providing API) in C."
>> -HOMEPAGE = "https://github.com/CESNET/libyang"
>> -SECTION = "libs"
>> -LICENSE = "BSD-3-Clause"
>> -
>> -LIC_FILES_CHKSUM = "file://LICENSE;md5=9bb3d334294e8719f41c531e28a9a697"
>> -
>> -SRCREV = "03e294d83b610f89e8ba7b2156a80dc0ad534443"
>> -
>> -SRC_URI = "git://github.com/CESNET/libyang.git;branch=master;protocol=https \
>> -           file://0001-test_context-skip-test-case-test_searchdirs.patch \
>> -           file://run-ptest \
>> -           "
>> -
>> -S = "${WORKDIR}/git"
>> -
>> -# Main dependencies
>> -inherit cmake pkgconfig lib_package ptest multilib_header
>> -DEPENDS = "libpcre2"
>> -DEPENDS += "${@bb.utils.contains('PTEST_ENABLED', '1', 'cmocka', '', d)}"
>> -
>> -EXTRA_OECMAKE = "-DCMAKE_BUILD_TYPE=Release"
>> -EXTRA_OECMAKE += " ${@bb.utils.contains('PTEST_ENABLED', '1', '-DENABLE_TESTS=ON -DENABLE_VALGRIND_TESTS=OFF', '', d)}"
>> -
>> -do_compile:prepend () {
>> -    if [ ${PTEST_ENABLED} = "1" ]; then
>> -        sed -i -e 's|${S}|${PTEST_PATH}|g' ${B}/tests/tests_config.h
>> -        sed -i -e 's|${B}|${PTEST_PATH}|g' ${B}/tests/tests_config.h
>> -    fi
>> -}
>> -
>> -do_install:append () {
>> -        oe_multilib_header  libyang/ly_config.h
>> -}
>> -
>> -do_install_ptest () {
>> -    install -d ${D}${PTEST_PATH}/tests
>> -    cp -f ${B}/tests/utest_* ${D}${PTEST_PATH}/tests/
>> -    cp -fR ${S}/tests/modules ${D}${PTEST_PATH}/tests/
>> -    install -d ${D}${PTEST_PATH}/tests/plugins
>> -    cp -f ${B}/tests/plugins/plugin_*.so ${D}${PTEST_PATH}/tests/plugins/
>> -}
>> -
>> -FILES:${PN} += "${datadir}/yang/*"
>> -- 
>> 2.17.1
Denys Dmytriyenko Nov. 25, 2025, 11:24 p.m. UTC | #3
On Thu, Nov 13, 2025 at 04:50:16PM -0600, Ryan Eatmon via lists.yoctoproject.org wrote:
> Yocto Project Compatibility requires that including a layer in a build
> not change recipes in other layers.  In this case, we were providing a
> newer version of a recipe that another layer provides.
> 
> The proper way of doing this is to create a bbappend and only change the
> minimal things needed to perform your changes.  Additionally, to pass
> the yocto-check-layer the bbappend needs to be wrapped in a manner that
> only applies your changes in the event that you are making use of your
> layer.  For Arago, that means only if we are building Arago.
> 
> Signed-off-by: Ryan Eatmon <reatmon@ti.com>
> ---
>  .../sysrepo/libyang-arago.inc                 |  9 ++++
>  .../sysrepo/libyang_%.bbappend                |  5 +++
>  .../recipes-extended/sysrepo/libyang_3.7.8.bb | 45 -------------------
>  3 files changed, 14 insertions(+), 45 deletions(-)
>  create mode 100644 meta-arago-extras/recipes-extended/sysrepo/libyang-arago.inc
>  delete mode 100644 meta-arago-extras/recipes-extended/sysrepo/libyang_3.7.8.bb
> 
> diff --git a/meta-arago-extras/recipes-extended/sysrepo/libyang-arago.inc b/meta-arago-extras/recipes-extended/sysrepo/libyang-arago.inc
> new file mode 100644
> index 00000000..b76701a8
> --- /dev/null
> +++ b/meta-arago-extras/recipes-extended/sysrepo/libyang-arago.inc
> @@ -0,0 +1,9 @@
> +PV = "3.7.8"
> +
> +LIC_FILES_CHKSUM = "file://LICENSE;md5=9bb3d334294e8719f41c531e28a9a697"
> +
> +SRCREV = "03e294d83b610f89e8ba7b2156a80dc0ad534443"
> +
> +do_install:append () {
> +    oe_multilib_header  libyang/ly_config.h
> +}

So, there's a weird problem with this change on scarthgap.

Since meta-oe/scarthgap provides an older 2.1.148 version of libyang, the 
original approach for meta-arago was to completely override the entire recipe 
with newer 3.7.8 version.

Now, for YP Compat compliance, it was converted into a .bbappend that adjusts 
the older version from meta-oe.

That older recipe in meta-oe has a multilib fix on top of standard CMake 
do_install() in the form of an :append

do_install:append () {
    oe_multilib_header  libyang/config.h
}

But the newer libyang renamed that config.h file into ly_config.h and now you 
have this code in our .bbappend

do_install:append () {
    oe_multilib_header  libyang/ly_config.h
}

But both :appends get applied and this results in the following error message:

| ERROR: libyang-3.7.8-r0 do_install: oe_multilib_header: Unable to find header libyang/config.h.

There's no easy way to disable or overwrite an existing :append, besides 
completely overriding the entire do_install() or the recipe itself...

But it appears this error is not fatal and does not seem to fail the build.


> diff --git a/meta-arago-extras/recipes-extended/sysrepo/libyang_%.bbappend b/meta-arago-extras/recipes-extended/sysrepo/libyang_%.bbappend
> index 608377e3..60d1258e 100644
> --- a/meta-arago-extras/recipes-extended/sysrepo/libyang_%.bbappend
> +++ b/meta-arago-extras/recipes-extended/sysrepo/libyang_%.bbappend
> @@ -1 +1,6 @@
> +LIBYANG_ARAGO = ""
> +LIBYANG_ARAGO:arago = "libyang-arago.inc"
> +
> +require ${LIBYANG_ARAGO}
> +
>  BBCLASSEXTEND = "native nativesdk"
> diff --git a/meta-arago-extras/recipes-extended/sysrepo/libyang_3.7.8.bb b/meta-arago-extras/recipes-extended/sysrepo/libyang_3.7.8.bb
> deleted file mode 100644
> index 3bea9bc2..00000000
> --- a/meta-arago-extras/recipes-extended/sysrepo/libyang_3.7.8.bb
> +++ /dev/null
> @@ -1,45 +0,0 @@
> -SUMMARY = "YANG data modeling language library"
> -DESCRIPTION = "libyang is a YANG data modelling language parser and toolkit written (and providing API) in C."
> -HOMEPAGE = "https://github.com/CESNET/libyang"
> -SECTION = "libs"
> -LICENSE = "BSD-3-Clause"
> -
> -LIC_FILES_CHKSUM = "file://LICENSE;md5=9bb3d334294e8719f41c531e28a9a697"
> -
> -SRCREV = "03e294d83b610f89e8ba7b2156a80dc0ad534443"
> -
> -SRC_URI = "git://github.com/CESNET/libyang.git;branch=master;protocol=https \
> -           file://0001-test_context-skip-test-case-test_searchdirs.patch \
> -           file://run-ptest \
> -           "
> -
> -S = "${WORKDIR}/git"
> -
> -# Main dependencies
> -inherit cmake pkgconfig lib_package ptest multilib_header
> -DEPENDS = "libpcre2"
> -DEPENDS += "${@bb.utils.contains('PTEST_ENABLED', '1', 'cmocka', '', d)}"
> -
> -EXTRA_OECMAKE = "-DCMAKE_BUILD_TYPE=Release"
> -EXTRA_OECMAKE += " ${@bb.utils.contains('PTEST_ENABLED', '1', '-DENABLE_TESTS=ON -DENABLE_VALGRIND_TESTS=OFF', '', d)}"
> -
> -do_compile:prepend () {
> -    if [ ${PTEST_ENABLED} = "1" ]; then
> -        sed -i -e 's|${S}|${PTEST_PATH}|g' ${B}/tests/tests_config.h
> -        sed -i -e 's|${B}|${PTEST_PATH}|g' ${B}/tests/tests_config.h
> -    fi
> -}
> -
> -do_install:append () {
> -        oe_multilib_header  libyang/ly_config.h
> -}
> -
> -do_install_ptest () {
> -    install -d ${D}${PTEST_PATH}/tests
> -    cp -f ${B}/tests/utest_* ${D}${PTEST_PATH}/tests/
> -    cp -fR ${S}/tests/modules ${D}${PTEST_PATH}/tests/
> -    install -d ${D}${PTEST_PATH}/tests/plugins
> -    cp -f ${B}/tests/plugins/plugin_*.so ${D}${PTEST_PATH}/tests/plugins/
> -}
> -
> -FILES:${PN} += "${datadir}/yang/*"
> -- 
> 2.17.1
Denys Dmytriyenko Nov. 26, 2025, 1:07 a.m. UTC | #4
On Tue, Nov 25, 2025 at 06:24:19PM -0500, Denys Dmytriyenko wrote:
> On Thu, Nov 13, 2025 at 04:50:16PM -0600, Ryan Eatmon via lists.yoctoproject.org wrote:
> > Yocto Project Compatibility requires that including a layer in a build
> > not change recipes in other layers.  In this case, we were providing a
> > newer version of a recipe that another layer provides.
> > 
> > The proper way of doing this is to create a bbappend and only change the
> > minimal things needed to perform your changes.  Additionally, to pass
> > the yocto-check-layer the bbappend needs to be wrapped in a manner that
> > only applies your changes in the event that you are making use of your
> > layer.  For Arago, that means only if we are building Arago.
> > 
> > Signed-off-by: Ryan Eatmon <reatmon@ti.com>
> > ---
> >  .../sysrepo/libyang-arago.inc                 |  9 ++++
> >  .../sysrepo/libyang_%.bbappend                |  5 +++
> >  .../recipes-extended/sysrepo/libyang_3.7.8.bb | 45 -------------------
> >  3 files changed, 14 insertions(+), 45 deletions(-)
> >  create mode 100644 meta-arago-extras/recipes-extended/sysrepo/libyang-arago.inc
> >  delete mode 100644 meta-arago-extras/recipes-extended/sysrepo/libyang_3.7.8.bb
> > 
> > diff --git a/meta-arago-extras/recipes-extended/sysrepo/libyang-arago.inc b/meta-arago-extras/recipes-extended/sysrepo/libyang-arago.inc
> > new file mode 100644
> > index 00000000..b76701a8
> > --- /dev/null
> > +++ b/meta-arago-extras/recipes-extended/sysrepo/libyang-arago.inc
> > @@ -0,0 +1,9 @@
> > +PV = "3.7.8"
> > +
> > +LIC_FILES_CHKSUM = "file://LICENSE;md5=9bb3d334294e8719f41c531e28a9a697"
> > +
> > +SRCREV = "03e294d83b610f89e8ba7b2156a80dc0ad534443"
> > +
> > +do_install:append () {
> > +    oe_multilib_header  libyang/ly_config.h
> > +}
> 
> So, there's a weird problem with this change on scarthgap.
> 
> Since meta-oe/scarthgap provides an older 2.1.148 version of libyang, the 
> original approach for meta-arago was to completely override the entire recipe 
> with newer 3.7.8 version.
> 
> Now, for YP Compat compliance, it was converted into a .bbappend that adjusts 
> the older version from meta-oe.
> 
> That older recipe in meta-oe has a multilib fix on top of standard CMake 
> do_install() in the form of an :append
> 
> do_install:append () {
>     oe_multilib_header  libyang/config.h
> }
> 
> But the newer libyang renamed that config.h file into ly_config.h and now you 
> have this code in our .bbappend
> 
> do_install:append () {
>     oe_multilib_header  libyang/ly_config.h
> }
> 
> But both :appends get applied and this results in the following error message:
> 
> | ERROR: libyang-3.7.8-r0 do_install: oe_multilib_header: Unable to find header libyang/config.h.
> 
> There's no easy way to disable or overwrite an existing :append, besides 
> completely overriding the entire do_install() or the recipe itself...
> 
> But it appears this error is not fatal and does not seem to fail the build.

Well, it does fail the first build from scratch, but seems to work fine on 
consecutive builds from sstate...


> > diff --git a/meta-arago-extras/recipes-extended/sysrepo/libyang_%.bbappend b/meta-arago-extras/recipes-extended/sysrepo/libyang_%.bbappend
> > index 608377e3..60d1258e 100644
> > --- a/meta-arago-extras/recipes-extended/sysrepo/libyang_%.bbappend
> > +++ b/meta-arago-extras/recipes-extended/sysrepo/libyang_%.bbappend
> > @@ -1 +1,6 @@
> > +LIBYANG_ARAGO = ""
> > +LIBYANG_ARAGO:arago = "libyang-arago.inc"
> > +
> > +require ${LIBYANG_ARAGO}
> > +
> >  BBCLASSEXTEND = "native nativesdk"
> > diff --git a/meta-arago-extras/recipes-extended/sysrepo/libyang_3.7.8.bb b/meta-arago-extras/recipes-extended/sysrepo/libyang_3.7.8.bb
> > deleted file mode 100644
> > index 3bea9bc2..00000000
> > --- a/meta-arago-extras/recipes-extended/sysrepo/libyang_3.7.8.bb
> > +++ /dev/null
> > @@ -1,45 +0,0 @@
> > -SUMMARY = "YANG data modeling language library"
> > -DESCRIPTION = "libyang is a YANG data modelling language parser and toolkit written (and providing API) in C."
> > -HOMEPAGE = "https://github.com/CESNET/libyang"
> > -SECTION = "libs"
> > -LICENSE = "BSD-3-Clause"
> > -
> > -LIC_FILES_CHKSUM = "file://LICENSE;md5=9bb3d334294e8719f41c531e28a9a697"
> > -
> > -SRCREV = "03e294d83b610f89e8ba7b2156a80dc0ad534443"
> > -
> > -SRC_URI = "git://github.com/CESNET/libyang.git;branch=master;protocol=https \
> > -           file://0001-test_context-skip-test-case-test_searchdirs.patch \
> > -           file://run-ptest \
> > -           "
> > -
> > -S = "${WORKDIR}/git"
> > -
> > -# Main dependencies
> > -inherit cmake pkgconfig lib_package ptest multilib_header
> > -DEPENDS = "libpcre2"
> > -DEPENDS += "${@bb.utils.contains('PTEST_ENABLED', '1', 'cmocka', '', d)}"
> > -
> > -EXTRA_OECMAKE = "-DCMAKE_BUILD_TYPE=Release"
> > -EXTRA_OECMAKE += " ${@bb.utils.contains('PTEST_ENABLED', '1', '-DENABLE_TESTS=ON -DENABLE_VALGRIND_TESTS=OFF', '', d)}"
> > -
> > -do_compile:prepend () {
> > -    if [ ${PTEST_ENABLED} = "1" ]; then
> > -        sed -i -e 's|${S}|${PTEST_PATH}|g' ${B}/tests/tests_config.h
> > -        sed -i -e 's|${B}|${PTEST_PATH}|g' ${B}/tests/tests_config.h
> > -    fi
> > -}
> > -
> > -do_install:append () {
> > -        oe_multilib_header  libyang/ly_config.h
> > -}
> > -
> > -do_install_ptest () {
> > -    install -d ${D}${PTEST_PATH}/tests
> > -    cp -f ${B}/tests/utest_* ${D}${PTEST_PATH}/tests/
> > -    cp -fR ${S}/tests/modules ${D}${PTEST_PATH}/tests/
> > -    install -d ${D}${PTEST_PATH}/tests/plugins
> > -    cp -f ${B}/tests/plugins/plugin_*.so ${D}${PTEST_PATH}/tests/plugins/
> > -}
> > -
> > -FILES:${PN} += "${datadir}/yang/*"
> > -- 
> > 2.17.1
diff mbox series

Patch

diff --git a/meta-arago-extras/recipes-extended/sysrepo/libyang-arago.inc b/meta-arago-extras/recipes-extended/sysrepo/libyang-arago.inc
new file mode 100644
index 00000000..b76701a8
--- /dev/null
+++ b/meta-arago-extras/recipes-extended/sysrepo/libyang-arago.inc
@@ -0,0 +1,9 @@ 
+PV = "3.7.8"
+
+LIC_FILES_CHKSUM = "file://LICENSE;md5=9bb3d334294e8719f41c531e28a9a697"
+
+SRCREV = "03e294d83b610f89e8ba7b2156a80dc0ad534443"
+
+do_install:append () {
+    oe_multilib_header  libyang/ly_config.h
+}
diff --git a/meta-arago-extras/recipes-extended/sysrepo/libyang_%.bbappend b/meta-arago-extras/recipes-extended/sysrepo/libyang_%.bbappend
index 608377e3..60d1258e 100644
--- a/meta-arago-extras/recipes-extended/sysrepo/libyang_%.bbappend
+++ b/meta-arago-extras/recipes-extended/sysrepo/libyang_%.bbappend
@@ -1 +1,6 @@ 
+LIBYANG_ARAGO = ""
+LIBYANG_ARAGO:arago = "libyang-arago.inc"
+
+require ${LIBYANG_ARAGO}
+
 BBCLASSEXTEND = "native nativesdk"
diff --git a/meta-arago-extras/recipes-extended/sysrepo/libyang_3.7.8.bb b/meta-arago-extras/recipes-extended/sysrepo/libyang_3.7.8.bb
deleted file mode 100644
index 3bea9bc2..00000000
--- a/meta-arago-extras/recipes-extended/sysrepo/libyang_3.7.8.bb
+++ /dev/null
@@ -1,45 +0,0 @@ 
-SUMMARY = "YANG data modeling language library"
-DESCRIPTION = "libyang is a YANG data modelling language parser and toolkit written (and providing API) in C."
-HOMEPAGE = "https://github.com/CESNET/libyang"
-SECTION = "libs"
-LICENSE = "BSD-3-Clause"
-
-LIC_FILES_CHKSUM = "file://LICENSE;md5=9bb3d334294e8719f41c531e28a9a697"
-
-SRCREV = "03e294d83b610f89e8ba7b2156a80dc0ad534443"
-
-SRC_URI = "git://github.com/CESNET/libyang.git;branch=master;protocol=https \
-           file://0001-test_context-skip-test-case-test_searchdirs.patch \
-           file://run-ptest \
-           "
-
-S = "${WORKDIR}/git"
-
-# Main dependencies
-inherit cmake pkgconfig lib_package ptest multilib_header
-DEPENDS = "libpcre2"
-DEPENDS += "${@bb.utils.contains('PTEST_ENABLED', '1', 'cmocka', '', d)}"
-
-EXTRA_OECMAKE = "-DCMAKE_BUILD_TYPE=Release"
-EXTRA_OECMAKE += " ${@bb.utils.contains('PTEST_ENABLED', '1', '-DENABLE_TESTS=ON -DENABLE_VALGRIND_TESTS=OFF', '', d)}"
-
-do_compile:prepend () {
-    if [ ${PTEST_ENABLED} = "1" ]; then
-        sed -i -e 's|${S}|${PTEST_PATH}|g' ${B}/tests/tests_config.h
-        sed -i -e 's|${B}|${PTEST_PATH}|g' ${B}/tests/tests_config.h
-    fi
-}
-
-do_install:append () {
-        oe_multilib_header  libyang/ly_config.h
-}
-
-do_install_ptest () {
-    install -d ${D}${PTEST_PATH}/tests
-    cp -f ${B}/tests/utest_* ${D}${PTEST_PATH}/tests/
-    cp -fR ${S}/tests/modules ${D}${PTEST_PATH}/tests/
-    install -d ${D}${PTEST_PATH}/tests/plugins
-    cp -f ${B}/tests/plugins/plugin_*.so ${D}${PTEST_PATH}/tests/plugins/
-}
-
-FILES:${PN} += "${datadir}/yang/*"