which: update 2.21 -> 2.23, build with meson
PATCH 1/2 which: update 2.21 -> 2.23, build with meson
From: Alexander Kanavin <[email protected]>
This (and 2.22) is a first release in many years. Rather than try to use upstream's absurdly overblown, incompatible build system (see below), I added a small-ish meson file. This means:
- drop tweaks and dependency on cwautomacros as that is no longer used
- drop patch as configure.ac has been rewritten, and the recipe is using meson anyway
- drop --disable-iberty for the same reason
In this realease, cwautomacros has been replaced by an equally custom, weird set of macros, written by 'which' maintainer: https://github.com/CarloWood/cwm4
- one effect of that is that autoreconf isn't happy with which's configure.ac and won't run; one is supposed to use a custom script instead: https://github.com/CarloWood/cwm4/blob/master/scripts/bootstrap.sh
- alas, that script is not shipped in tarballs; the maintainer wants everyone to trust their 200k configure script (hello xz backdoor)
- building from git (where the script exists) is not impossible, but that has no version tags
All this 'special handling' for what, exactly? Five .c files to produce one single-function executable, and one manpage. Wich should all be in coreutils to begin with. GNU's attachment to autotools defies reason.
---
.../which/which-2.21/automake.patch | 19 ----
...opt-Fix-signature-of-getenv-function.patch | 29 ++++---
.../which/which-2.23/meson.build | 87 +++++++++++++++++++
.../which/{which_2.21.bb => which_2.23.bb} | 11 +--
4 files changed, 108 insertions(+), 38 deletions(-)
delete mode 100644 meta/recipes-extended/which/which-2.21/automake.patch
rename meta/recipes-extended/which/{which-2.21 => which-2.23}/0001-getopt-Fix-signature-of-getenv-function.patch (51%)
create mode 100644 meta/recipes-extended/which/which-2.23/meson.build
rename meta/recipes-extended/which/{which_2.21.bb => which_2.23.bb} (71%)meta/recipes-extended/which/which-2.21/automake.patch deleted +0 -19
@@ -1,19 +0,0 @@ -Update autoconf prologue to use "foreign" strictness. - -Upstream-Status: Pending -Signed-off-by: Ross Burton <[email protected]> - -diff --git a/configure.ac b/configure.ac -index d974461..a20dfa8 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -1,7 +1,7 @@ - dnl Process this file with autoconf to produce a configure script. - AC_INIT([which], [2.21]) - AC_CONFIG_SRCDIR(which.c) --AM_INIT_AUTOMAKE -+AM_INIT_AUTOMAKE([foreign]) - AM_CONFIG_HEADER(config.h) - AM_MAINTAINER_MODE - -
meta/recipes-extended/which/which-2.23/0001-getopt-Fix-signature-of-getenv-function.patch renamed from meta/recipes-extended/which/which-2.21/0001-getopt-Fix-signature-of-getenv-function.patch +17 -12
@@ -1,4 +1,4 @@ -From 16a1647fc26953fab659de5f55d4c0defdfb894f Mon Sep 17 00:00:00 2001 +From 83d2ed3fd203868a8f287d2ebedc7c304c74fbb4 Mon Sep 17 00:00:00 2001 From: Khem Raj <[email protected]> Date: Sat, 22 Mar 2025 17:56:19 -0700 Subject: [PATCH] getopt: Fix signature of getenv function
@@ -13,27 +13,32 @@ Upstream-Status: Submitted [https://lists.gnu.org/archive/html/which-bugs/2025-0 Signed-off-by: Khem Raj <[email protected]> --- getopt.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) + getopt.h | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) +diff --git a/getopt.c b/getopt.c +index 9ac2ed6..b1aa322 100644 --- a/getopt.c +++ b/getopt.c -@@ -209,7 +209,7 @@ static char *posixly_correct; +@@ -205,7 +205,7 @@ static char *posixly_correct; /* Avoid depending on library functions or files whose names are inconsistent. */ --char *getenv (); +-char *getenv(); +char *getenv (const char*); - static char * - my_index (str, chr) + static char *my_index(str, chr) const char *str; + int chr; +diff --git a/getopt.h b/getopt.h +index f080053..e04e3ca 100644 --- a/getopt.h +++ b/getopt.h -@@ -103,7 +103,7 @@ struct option +@@ -102,7 +102,7 @@ struct option { errors, only prototype getopt for the GNU C library. */ - extern int getopt (int argc, char *const *argv, const char *shortopts); - #else /* not __GNU_LIBRARY__ */ --extern int getopt (); + extern int getopt(int argc, char *const *argv, const char *shortopts); + #else /* not __GNU_LIBRARY__ */ +-extern int getopt(); +extern int getopt (int, char * const [], const char *); #endif /* __GNU_LIBRARY__ */ - extern int getopt_long (int argc, char *const *argv, const char *shortopts, - const struct option *longopts, int *longind); + extern int getopt_long(int argc, char *const *argv, const char *shortopts, const struct option *longopts, int *longind); + extern int getopt_long_only(int argc, char *const *argv, const char *shortopts, const struct option *longopts,
meta/recipes-extended/which/which-2.23/meson.build new file +87 -0
87 lines not on this page · raw message
meta/recipes-extended/which/which_2.23.bb renamed from meta/recipes-extended/which/which_2.21.bb +4 -7
@@ -9,21 +9,18 @@ HOMEPAGE = "https://carlowood.github.io/which/" LICENSE = "GPL-3.0-or-later" LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504\ file://which.c;beginline=1;endline=17;md5=a9963693af2272e7a8df6f231164e7a2" -DEPENDS = "cwautomacros-native" -inherit autotools texinfo update-alternatives - -EXTRA_OECONF = "--disable-iberty" +inherit meson update-alternatives SRC_URI = "${GNU_MIRROR}/which/which-${PV}.tar.gz \ - file://automake.patch \ + file://meson.build \ file://0001-getopt-Fix-signature-of-getenv-function.patch \ " -SRC_URI[sha256sum] = "f4a245b94124b377d8b49646bf421f9155d36aa7614b6ebf83705d3ffc76eaad" +SRC_URI[sha256sum] = "a2c558226fc4d9e4ce331bd2fd3c3f17f955115d2c00e447618a4ef9978a2a73" do_configure:prepend() { - sed -i -e 's%@ACLOCAL_CWFLAGS@%-I ${STAGING_DIR_NATIVE}/usr/share/cwautomacros/m4%g' ${S}/Makefile.am ${S}/tilde/Makefile.am + cp ${UNPACKDIR}/meson.build ${S} } ALTERNATIVE:${PN} = "which"
Signature · 1 line
2.39.5
PATCH 2/2 cwautomacros: delete the recipe
From: Alexander Kanavin <[email protected]>
This is a long-obsolete set of custom autotools macros; 'which' was the last consumer in core or meta-oe.
--- meta/conf/distro/include/maintainers.inc | 1 - .../cwautomacros/cwautomacros_20110201.bb | 25 ------------------- 2 files changed, 26 deletions(-) delete mode 100644 meta/recipes-extended/cwautomacros/cwautomacros_20110201.bb
meta/conf/distro/include/maintainers.inc +0 -1
@@ -139,7 +139,6 @@ RECIPE_MAINTAINER:pn-cryptodev-tests = "Robert Yang <[email protected]>" RECIPE_MAINTAINER:pn-cups = "Chen Qi <[email protected]>" RECIPE_MAINTAINER:pn-curl = "Robert Joslyn <[email protected]>" RECIPE_MAINTAINER:pn-cve-update-nvd2-native = "Ross Burton <[email protected]>" -RECIPE_MAINTAINER:pn-cwautomacros = "Ross Burton <[email protected]>" RECIPE_MAINTAINER:pn-db = "Unassigned <[email protected]>" RECIPE_MAINTAINER:pn-dbus = "Chen Qi <[email protected]>" RECIPE_MAINTAINER:pn-dbus-glib = "Chen Qi <[email protected]>"
meta/recipes-extended/cwautomacros/cwautomacros_20110201.bb deleted +0 -25
@@ -1,25 +0,0 @@ -SUMMARY = "Collection of autoconf m4 macros" -SECTION = "base" -HOMEPAGE = "http://sourceforge.net/projects/cwautomacros.berlios/" -DESCRIPTION = "A collection of autoconf macros, plus an autogen.sh script that can be used with them." -LICENSE = "GPL-2.0-only" -LIC_FILES_CHKSUM = "file://LICENSE;md5=eb723b61539feef013de476e68b5c50a" - -SOURCEFORGE_PROJECT = "${BPN}.berlios" -SRC_URI = "${SOURCEFORGE_MIRROR}/${SOURCEFORGE_PROJECT}/${BP}.tar.bz2" -SRC_URI[sha256sum] = "3115603b891f3a163c0bbb5fea2f3742113a183fa6745ee5e89e5f6d0e9f6121" - -inherit sourceforge-releases - -do_configure() { - : -} - -do_install() { - oe_runmake LABEL=`date -d @${SOURCE_DATE_EPOCH} +%Y%m%d` CWAUTOMACROSPREFIX=${D}${prefix} install - - # cleanup buildpaths in autogen.sh - sed -i -e 's,${D},,g' ${D}${prefix}/share/cwautomacros/scripts/autogen.sh -} - -BBCLASSEXTEND = "native"
Signature · 1 line
2.39.5