From aca683fb18c3a62874e6687e36fb4c35a25d0615 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Sat, 3 Sep 2022 01:26:48 -0700 Subject: augeas: Check for __GLIBC__ to use gnu extention for strerror_r Merge .bb and .inc Signed-off-by: Khem Raj --- meta-oe/recipes-support/augeas/augeas.inc | 33 --------------------- ...l-Use-__GLIBC__-to-check-for-GNU-extentio.patch | 34 ++++++++++++++++++++++ meta-oe/recipes-support/augeas/augeas_1.12.0.bb | 34 +++++++++++++++++++++- 3 files changed, 67 insertions(+), 34 deletions(-) delete mode 100644 meta-oe/recipes-support/augeas/augeas.inc create mode 100644 meta-oe/recipes-support/augeas/augeas/0001-src-internal-Use-__GLIBC__-to-check-for-GNU-extentio.patch diff --git a/meta-oe/recipes-support/augeas/augeas.inc b/meta-oe/recipes-support/augeas/augeas.inc deleted file mode 100644 index d46f3888bd..0000000000 --- a/meta-oe/recipes-support/augeas/augeas.inc +++ /dev/null @@ -1,33 +0,0 @@ -SUMMARY = "Augeas configuration API" -HOMEPAGE = "http://augeas.net/" -BUGTRACKER = "https://fedorahosted.org/augeas/report/1" - -LICENSE = "LGPL-2.1-or-later" -LIC_FILES_CHKSUM = "file://COPYING;md5=bbb461211a33b134d42ed5ee802b37ff" - -SRC_URI = "http://download.augeas.net/${BP}.tar.gz \ - file://sepbuildfix.patch \ - " - -DEPENDS = "readline libxml2" - -inherit autotools pkgconfig - -PACKAGES =+ "${PN}-lenses lib${BPN}" - -FILES:${PN}-lenses = "${datadir}/augeas/lenses" -FILES:lib${BPN} = "${libdir}/lib*${SOLIBS}" - -RDEPENDS:lib${BPN} += "${PN}-lenses" -RRECOMMENDS:lib${BPN} += "${PN}" - -LEAD_SONAME = "libaugeas.so" - -do_install:append() { - rm -fr ${D}${datadir}/vim -} - -PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'selinux', d)}" -PACKAGECONFIG[selinux] = "--with-selinux,--without-selinux,libselinux" - -EXTRA_AUTORECONF += "-I ${S}/gnulib/m4" diff --git a/meta-oe/recipes-support/augeas/augeas/0001-src-internal-Use-__GLIBC__-to-check-for-GNU-extentio.patch b/meta-oe/recipes-support/augeas/augeas/0001-src-internal-Use-__GLIBC__-to-check-for-GNU-extentio.patch new file mode 100644 index 0000000000..9424be2aa6 --- /dev/null +++ b/meta-oe/recipes-support/augeas/augeas/0001-src-internal-Use-__GLIBC__-to-check-for-GNU-extentio.patch @@ -0,0 +1,34 @@ +From e5ccf769c2dc7283b56a597fffdb5dc1558e3ce8 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Sat, 3 Sep 2022 01:23:28 -0700 +Subject: [PATCH] src/internal: Use __GLIBC__ to check for GNU extention + implementation + +__USE_GNU is defined by _GNU_SOURCE and configure explicitly sets this +macro and it does have meaning on musl too, where it may have some level +of GNU compatibility but strerror_r is not one of them. Therefore we +have to check for libc implementation for this to be sure. + +Upstream-Status: Pending + +Signed-off-by: Khem Raj +--- + src/internal.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/internal.c b/src/internal.c +index ef83b71..fb326fa 100644 +--- a/src/internal.c ++++ b/src/internal.c +@@ -431,7 +431,7 @@ char *cleanpath(char *path) { + + const char *xstrerror(int errnum, char *buf, size_t len) { + #ifdef HAVE_STRERROR_R +-# ifdef __USE_GNU ++# ifdef __GLIBC__ + /* Annoying linux specific API contract */ + return strerror_r(errnum, buf, len); + # else +-- +2.37.3 + diff --git a/meta-oe/recipes-support/augeas/augeas_1.12.0.bb b/meta-oe/recipes-support/augeas/augeas_1.12.0.bb index d32c4691d2..2c6d4cdc88 100644 --- a/meta-oe/recipes-support/augeas/augeas_1.12.0.bb +++ b/meta-oe/recipes-support/augeas/augeas_1.12.0.bb @@ -1,4 +1,36 @@ -require augeas.inc +SUMMARY = "Augeas configuration API" +HOMEPAGE = "http://augeas.net/" +BUGTRACKER = "https://fedorahosted.org/augeas/report/1" +LICENSE = "LGPL-2.1-or-later" +LIC_FILES_CHKSUM = "file://COPYING;md5=bbb461211a33b134d42ed5ee802b37ff" + +SRC_URI = "http://download.augeas.net/${BP}.tar.gz \ + file://sepbuildfix.patch \ + file://0001-src-internal-Use-__GLIBC__-to-check-for-GNU-extentio.patch \ + " SRC_URI[md5sum] = "74f1c7b8550f4e728486091f6b907175" SRC_URI[sha256sum] = "321942c9cc32185e2e9cb72d0a70eea106635b50269075aca6714e3ec282cb87" + +DEPENDS = "readline libxml2" + +inherit autotools pkgconfig + +PACKAGES =+ "${PN}-lenses lib${BPN}" + +FILES:${PN}-lenses = "${datadir}/augeas/lenses" +FILES:lib${BPN} = "${libdir}/lib*${SOLIBS}" + +RDEPENDS:lib${BPN} += "${PN}-lenses" +RRECOMMENDS:lib${BPN} += "${PN}" + +LEAD_SONAME = "libaugeas.so" + +do_install:append() { + rm -fr ${D}${datadir}/vim +} + +PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'selinux', d)}" +PACKAGECONFIG[selinux] = "--with-selinux,--without-selinux,libselinux" + +EXTRA_AUTORECONF += "-I ${S}/gnulib/m4" -- cgit v1.2.3-54-g00ecf