diff mbox series

[v4,3/7] libtoml11: cleanup package to adhere to the recipe style guide

Message ID 20251215102041.1630567-3-adam.duskett@amarulasolutions.com
State New
Headers show
Series [v4,1/7] signing-keys.bb: Fix DISTRO_CODENAME truncation | expand

Commit Message

Adam Duskett Dec. 15, 2025, 10:20 a.m. UTC
- Add a BUGTRACKER link

  - Move SRCREV to below SRC_URI

  - Use gitsm instead of multiple git entries in the SRC_URI

  - Remove SRCEV_FORMAT as it is not needed.

  - Add a tag to the SRC_URI

  - Add a UPSTREAM_CHECK_GITTAGREGEX field

  - Use `PTEST_ENABLED 1` instead of `DISTRO_FEATURES ptest`

  - Change "Submitted" in 0001-Remove-whitespace-in-operator.patch
    to "Backport" with the appropraite link to the relevant commit hash.

  - Clean up run-ptest.

  - Add libtoml11 to maintainers.inc and ptest-packagelist.inc

Signed-off-by: Adam Duskett <adam.duskett@amarulasolutions.com>
---
V1 -> V2: Add this patch to the series

 .../0001-Remove-whitespace-in-operator.patch  |  2 +-
 .../libtoml11/files/run-ptest                 | 15 +++++----
 .../libtoml11/libtoml11_4.4.0.bb              | 33 +++++++++----------
 3 files changed, 25 insertions(+), 25 deletions(-)

Comments

Quentin Schulz Dec. 15, 2025, 10:39 a.m. UTC | #1
Hi Adam,

On 12/15/25 11:20 AM, Adam Duskett via lists.openembedded.org wrote:
>    - Add a BUGTRACKER link
> 
>    - Move SRCREV to below SRC_URI
> 
>    - Use gitsm instead of multiple git entries in the SRC_URI
> 
>    - Remove SRCEV_FORMAT as it is not needed.
> 
>    - Add a tag to the SRC_URI
> 
>    - Add a UPSTREAM_CHECK_GITTAGREGEX field
> 
>    - Use `PTEST_ENABLED 1` instead of `DISTRO_FEATURES ptest`
> 
>    - Change "Submitted" in 0001-Remove-whitespace-in-operator.patch
>      to "Backport" with the appropraite link to the relevant commit hash.
> 
>    - Clean up run-ptest.
> 
>    - Add libtoml11 to maintainers.inc and ptest-packagelist.inc
> 

Usually when you need to have a list of things you have done in a 
commit, it means each item should be its own commit. 
OE-Core/BitBake/Yocto is a bit more relaxed than other projects on that 
rule but I find it a good thing to do in general.

Looks good to me, so:

Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>

Small note on UPSTREAM_CHECK_GITTAGREGEX, isn't the default ( 
"(?P<pver>([0-9][\.|_]?)+)" ) sufficient? Regex101 seems to be matching 
4.4.0 out of v4.4.0.

Also if you're changing it from the default, maybe add the v as first 
char since this seems to be the naming scheme for the tags in that repo?

UPSTREAM_CHECK_GITTAGREGEX = "v(?P<pver>\d+(\.\d+)+)"

[...]

> diff --git a/meta/recipes-devtools/libtoml11/files/run-ptest b/meta/recipes-devtools/libtoml11/files/run-ptest
> index 9bc480aa7f..22d6f7e0e1 100755
> --- a/meta/recipes-devtools/libtoml11/files/run-ptest
> +++ b/meta/recipes-devtools/libtoml11/files/run-ptest
> @@ -1,12 +1,13 @@
> -#!/bin/sh
> +#!/usr/bin/env sh
>   
>   cd tests
> -for atest in test_* ; do
> -    rm -rf tests.log
> -    ./${atest} > tests.log 2>&1
> -    if [ $? = 0 ] ; then
> -        echo "PASS: ${atest}"
> +
> +rm -rf tests.log
> +
> +for i in test_* ; do
> +    if ./"${i}" >> tests.log 2>&1; then
> +        echo "PASS: ${i}"
>       else
> -        echo "FAIL: ${atest}"
> +        echo "FAIL: ${i}"

Renaming atest to i incurs unnecessary noise in the diff.

>       fi
>   done
> diff --git a/meta/recipes-devtools/libtoml11/libtoml11_4.4.0.bb b/meta/recipes-devtools/libtoml11/libtoml11_4.4.0.bb
> index 38786b79ed..c3b00511ae 100644
> --- a/meta/recipes-devtools/libtoml11/libtoml11_4.4.0.bb
> +++ b/meta/recipes-devtools/libtoml11/libtoml11_4.4.0.bb
> @@ -1,9 +1,10 @@
>   SUMMARY = "TOML for Modern C++"
> -DESCRIPTION = "toml11 is a feature-rich TOML language library for \
> -               C++11/14/17/20."
> -
> +DESCRIPTION = "\
> +    toml11 is a feature-rich TOML language library for \
> +    C++11/14/17/20. \
> +"

I believe this change means we have even more useless whitespaces in the 
description.

Cheers,
Quentin
diff mbox series

Patch

diff --git a/meta/recipes-devtools/libtoml11/files/0001-Remove-whitespace-in-operator.patch b/meta/recipes-devtools/libtoml11/files/0001-Remove-whitespace-in-operator.patch
index c8c9922d55..9516ee5cb1 100644
--- a/meta/recipes-devtools/libtoml11/files/0001-Remove-whitespace-in-operator.patch
+++ b/meta/recipes-devtools/libtoml11/files/0001-Remove-whitespace-in-operator.patch
@@ -11,7 +11,7 @@  include/toml11/impl/../fwd/literal_fwd.hpp:22:26: error: identifier '_toml' prec
 |       |               ~~~~~~~~~~~^~~~~
 |       |               operator""_toml
 
-Upstream-Status: Submitted [https://github.com/ToruNiina/toml11/pull/285]
+Upstream-Status: Backport [https://github.com/ToruNiina/toml11/commit/dee78f822d8a5b985e565e5c1ef42a59557aa8fc]
 Signed-off-by: Khem Raj <raj.khem@gmail.com>
 ---
  include/toml11/fwd/literal_fwd.hpp   | 2 +-
diff --git a/meta/recipes-devtools/libtoml11/files/run-ptest b/meta/recipes-devtools/libtoml11/files/run-ptest
index 9bc480aa7f..22d6f7e0e1 100755
--- a/meta/recipes-devtools/libtoml11/files/run-ptest
+++ b/meta/recipes-devtools/libtoml11/files/run-ptest
@@ -1,12 +1,13 @@ 
-#!/bin/sh
+#!/usr/bin/env sh
 
 cd tests
-for atest in test_* ; do
-    rm -rf tests.log
-    ./${atest} > tests.log 2>&1
-    if [ $? = 0 ] ; then
-        echo "PASS: ${atest}"
+
+rm -rf tests.log
+
+for i in test_* ; do
+    if ./"${i}" >> tests.log 2>&1; then
+        echo "PASS: ${i}"
     else
-        echo "FAIL: ${atest}"
+        echo "FAIL: ${i}"
     fi
 done
diff --git a/meta/recipes-devtools/libtoml11/libtoml11_4.4.0.bb b/meta/recipes-devtools/libtoml11/libtoml11_4.4.0.bb
index 38786b79ed..c3b00511ae 100644
--- a/meta/recipes-devtools/libtoml11/libtoml11_4.4.0.bb
+++ b/meta/recipes-devtools/libtoml11/libtoml11_4.4.0.bb
@@ -1,9 +1,10 @@ 
 SUMMARY = "TOML for Modern C++"
-DESCRIPTION = "toml11 is a feature-rich TOML language library for \
-               C++11/14/17/20."
-
+DESCRIPTION = "\
+    toml11 is a feature-rich TOML language library for \
+    C++11/14/17/20. \
+"
 HOMEPAGE = "https://github.com/ToruNiina/toml11"
-
+BUGTRACKER = "https://github.com/ToruNiina/toml11/issues"
 SECTION = "libs"
 
 LICENSE = "MIT"
@@ -11,23 +12,19 @@  LIC_FILES_CHKSUM = "file://LICENSE;md5=44d1fcf70c7aa6991533c38daf7befa3"
 
 PE = "1"
 
-SRCREV = "be08ba2be2a964edcdb3d3e3ea8d100abc26f286"
-SRCREV_json = "8c391e04fe4195d8be862c97f38cfe10e2a3472e"
-SRCREV_doctest = "ae7a13539fb71f270b87eb2e874fbac80bc8dda2"
-
-SRC_URI = "git://github.com/ToruNiina/toml11;branch=main;protocol=https \
-           git://github.com/nlohmann/json;destsuffix=${BB_GIT_DEFAULT_DESTSUFFIX}/tests/extlib/json;name=json;branch=develop;protocol=https \
-           git://github.com/doctest/doctest;destsuffix=${BB_GIT_DEFAULT_DESTSUFFIX}/tests/extlib/doctest;name=doctest;branch=master;protocol=https \
-           file://0001-Remove-whitespace-in-operator.patch \
-           file://run-ptest \
+SRC_URI = "\
+    gitsm://github.com/ToruNiina/toml11.git;protocol=https;branch=main;tag=v${PV} \
+    file://0001-Remove-whitespace-in-operator.patch \
+    file://run-ptest \
 "
-SRCREV_FORMAT = "json_doctest"
-
+SRCREV = "be08ba2be2a964edcdb3d3e3ea8d100abc26f286"
+UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>\d+(\.\d+)+)"
 
 inherit cmake ptest
 
-EXTRA_OECMAKE += "-DTOML11_PRECOMPILE=ON \
-                  -DTOML11_BUILD_TESTS=${@bb.utils.contains("DISTRO_FEATURES", "ptest", "ON", "OFF", d)} \
+EXTRA_OECMAKE += "\
+    -DTOML11_PRECOMPILE=ON \
+    -DTOML11_BUILD_TESTS=${@bb.utils.contains("PTEST_ENABLED", "1", "ON", "OFF", d)} \
 "
 
 ALLOW_EMPTY:${PN} = "1"
@@ -36,3 +33,5 @@  do_install_ptest () {
     install -d ${D}${PTEST_PATH}/tests
     cp -r ${B}/tests/test_* ${D}${PTEST_PATH}/tests
 }
+
+BBCLASSEXTEND = "native nativesdk"