diff options
author | Alexander Kanavin <alex@linutronix.de> | 2025-09-25 12:53:39 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2025-10-01 10:52:54 +0100 |
commit | cf0cf92200be69a498a4f29e20701966f030ccce (patch) | |
tree | 183791c395a9c1fc9cbe61ff30aa891fb06372ee /meta | |
parent | 702c515a7568b10bb208635d1d747b529e810690 (diff) | |
download | poky-cf0cf92200be69a498a4f29e20701966f030ccce.tar.gz |
which: update 2.21 -> 2.23, build with meson
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.
(From OE-Core rev: 600545a0ef313e7df5a0f25eba17b73b0f410489)
Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r-- | meta/recipes-extended/which/which-2.21/automake.patch | 19 | ||||
-rw-r--r-- | 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) | 29 | ||||
-rw-r--r-- | meta/recipes-extended/which/which-2.23/meson.build | 92 | ||||
-rw-r--r-- | meta/recipes-extended/which/which_2.23.bb (renamed from meta/recipes-extended/which/which_2.21.bb) | 11 |
4 files changed, 113 insertions, 38 deletions
diff --git a/meta/recipes-extended/which/which-2.21/automake.patch b/meta/recipes-extended/which/which-2.21/automake.patch deleted file mode 100644 index 4d0f2e4d7b..0000000000 --- a/meta/recipes-extended/which/which-2.21/automake.patch +++ /dev/null | |||
@@ -1,19 +0,0 @@ | |||
1 | Update autoconf prologue to use "foreign" strictness. | ||
2 | |||
3 | Upstream-Status: Pending | ||
4 | Signed-off-by: Ross Burton <ross.burton@intel.com> | ||
5 | |||
6 | diff --git a/configure.ac b/configure.ac | ||
7 | index d974461..a20dfa8 100644 | ||
8 | --- a/configure.ac | ||
9 | +++ b/configure.ac | ||
10 | @@ -1,7 +1,7 @@ | ||
11 | dnl Process this file with autoconf to produce a configure script. | ||
12 | AC_INIT([which], [2.21]) | ||
13 | AC_CONFIG_SRCDIR(which.c) | ||
14 | -AM_INIT_AUTOMAKE | ||
15 | +AM_INIT_AUTOMAKE([foreign]) | ||
16 | AM_CONFIG_HEADER(config.h) | ||
17 | AM_MAINTAINER_MODE | ||
18 | |||
19 | |||
diff --git a/meta/recipes-extended/which/which-2.21/0001-getopt-Fix-signature-of-getenv-function.patch b/meta/recipes-extended/which/which-2.23/0001-getopt-Fix-signature-of-getenv-function.patch index e006d797d3..c54368a084 100644 --- a/meta/recipes-extended/which/which-2.21/0001-getopt-Fix-signature-of-getenv-function.patch +++ b/meta/recipes-extended/which/which-2.23/0001-getopt-Fix-signature-of-getenv-function.patch | |||
@@ -1,4 +1,4 @@ | |||
1 | From 16a1647fc26953fab659de5f55d4c0defdfb894f Mon Sep 17 00:00:00 2001 | 1 | From 83d2ed3fd203868a8f287d2ebedc7c304c74fbb4 Mon Sep 17 00:00:00 2001 |
2 | From: Khem Raj <raj.khem@gmail.com> | 2 | From: Khem Raj <raj.khem@gmail.com> |
3 | Date: Sat, 22 Mar 2025 17:56:19 -0700 | 3 | Date: Sat, 22 Mar 2025 17:56:19 -0700 |
4 | Subject: [PATCH] getopt: Fix signature of getenv function | 4 | 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 | |||
13 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | 13 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
14 | --- | 14 | --- |
15 | getopt.c | 2 +- | 15 | getopt.c | 2 +- |
16 | 1 file changed, 1 insertion(+), 1 deletion(-) | 16 | getopt.h | 2 +- |
17 | 2 files changed, 2 insertions(+), 2 deletions(-) | ||
17 | 18 | ||
19 | diff --git a/getopt.c b/getopt.c | ||
20 | index 9ac2ed6..b1aa322 100644 | ||
18 | --- a/getopt.c | 21 | --- a/getopt.c |
19 | +++ b/getopt.c | 22 | +++ b/getopt.c |
20 | @@ -209,7 +209,7 @@ static char *posixly_correct; | 23 | @@ -205,7 +205,7 @@ static char *posixly_correct; |
21 | /* Avoid depending on library functions or files | 24 | /* Avoid depending on library functions or files |
22 | whose names are inconsistent. */ | 25 | whose names are inconsistent. */ |
23 | 26 | ||
24 | -char *getenv (); | 27 | -char *getenv(); |
25 | +char *getenv (const char*); | 28 | +char *getenv (const char*); |
26 | 29 | ||
27 | static char * | 30 | static char *my_index(str, chr) const char *str; |
28 | my_index (str, chr) | 31 | int chr; |
32 | diff --git a/getopt.h b/getopt.h | ||
33 | index f080053..e04e3ca 100644 | ||
29 | --- a/getopt.h | 34 | --- a/getopt.h |
30 | +++ b/getopt.h | 35 | +++ b/getopt.h |
31 | @@ -103,7 +103,7 @@ struct option | 36 | @@ -102,7 +102,7 @@ struct option { |
32 | errors, only prototype getopt for the GNU C library. */ | 37 | errors, only prototype getopt for the GNU C library. */ |
33 | extern int getopt (int argc, char *const *argv, const char *shortopts); | 38 | extern int getopt(int argc, char *const *argv, const char *shortopts); |
34 | #else /* not __GNU_LIBRARY__ */ | 39 | #else /* not __GNU_LIBRARY__ */ |
35 | -extern int getopt (); | 40 | -extern int getopt(); |
36 | +extern int getopt (int, char * const [], const char *); | 41 | +extern int getopt (int, char * const [], const char *); |
37 | #endif /* __GNU_LIBRARY__ */ | 42 | #endif /* __GNU_LIBRARY__ */ |
38 | extern int getopt_long (int argc, char *const *argv, const char *shortopts, | 43 | extern int getopt_long(int argc, char *const *argv, const char *shortopts, const struct option *longopts, int *longind); |
39 | const struct option *longopts, int *longind); | 44 | extern int getopt_long_only(int argc, char *const *argv, const char *shortopts, const struct option *longopts, |
diff --git a/meta/recipes-extended/which/which-2.23/meson.build b/meta/recipes-extended/which/which-2.23/meson.build new file mode 100644 index 0000000000..045dfceb66 --- /dev/null +++ b/meta/recipes-extended/which/which-2.23/meson.build | |||
@@ -0,0 +1,92 @@ | |||
1 | # | ||
2 | # Copyright OpenEmbedded Contributors | ||
3 | # | ||
4 | # SPDX-License-Identifier: MIT | ||
5 | # | ||
6 | project('which', 'c', version: '2.23') | ||
7 | |||
8 | add_project_arguments('-DHAVE_CONFIG_H', language : 'c') | ||
9 | |||
10 | src = ['bash.c','getopt1.c','getopt.c','tilde.c','which.c'] | ||
11 | |||
12 | executable('which', src, install: true) | ||
13 | install_man('which.1') | ||
14 | |||
15 | conf_data = configuration_data() | ||
16 | |||
17 | conf_data.set('GETGROUPS_T', 'gid_t') | ||
18 | |||
19 | compiler = meson.get_compiler('c') | ||
20 | if compiler.has_function('strchr') | ||
21 | conf_data.set('HAVE_STRCHR', 1) | ||
22 | endif | ||
23 | if compiler.has_function('memcpy') | ||
24 | conf_data.set('HAVE_MEMCPY', 1) | ||
25 | endif | ||
26 | if compiler.has_function('getopt_long') | ||
27 | conf_data.set('HAVE_GETOPT_LONG', 1) | ||
28 | endif | ||
29 | if compiler.has_function('getcwd') | ||
30 | conf_data.set('HAVE_GETCWD', 1) | ||
31 | endif | ||
32 | if compiler.has_function('getwd') | ||
33 | conf_data.set('HAVE_GETWD', 1) | ||
34 | endif | ||
35 | if compiler.has_function('sysconf') | ||
36 | conf_data.set('HAVE_SYSCONF', 1) | ||
37 | endif | ||
38 | if compiler.has_function('getgroups') | ||
39 | conf_data.set('HAVE_GETGROUPS', 1) | ||
40 | endif | ||
41 | if compiler.has_function('eaccess') | ||
42 | conf_data.set('HAVE_EACCESS', 1) | ||
43 | endif | ||
44 | if compiler.has_function('getpwent') | ||
45 | conf_data.set('HAVE_GETPWENT', 1) | ||
46 | endif | ||
47 | if compiler.has_function('getpwnam') | ||
48 | conf_data.set('HAVE_GETPWNAM', 1) | ||
49 | endif | ||
50 | if compiler.has_function('getpwuid') | ||
51 | conf_data.set('HAVE_GETPWUID', 1) | ||
52 | conf_data.set('HAVE_GETPW_DECLS', 1) | ||
53 | endif | ||
54 | |||
55 | if compiler.has_header('unistd.h') | ||
56 | conf_data.set('HAVE_UNISTD_H', 1) | ||
57 | endif | ||
58 | if compiler.has_header('string.h') | ||
59 | conf_data.set('HAVE_STRING_H', 1) | ||
60 | endif | ||
61 | if compiler.has_header('stdlib.h') | ||
62 | conf_data.set('HAVE_STDLIB_H', 1) | ||
63 | endif | ||
64 | if compiler.has_header('memory.h') | ||
65 | conf_data.set('HAVE_MEMORY_H', 1) | ||
66 | endif | ||
67 | if compiler.has_header('pwd.h') | ||
68 | conf_data.set('HAVE_PWD_H', 1) | ||
69 | endif | ||
70 | if compiler.has_header('strings.h') | ||
71 | conf_data.set('HAVE_STRINGS_H', 1) | ||
72 | endif | ||
73 | if compiler.has_header('inttypes.h') | ||
74 | conf_data.set('HAVE_INTTYPES_H', 1) | ||
75 | endif | ||
76 | if compiler.has_header('stdio.h') | ||
77 | conf_data.set('HAVE_STDIO_H', 1) | ||
78 | endif | ||
79 | if compiler.has_header('stdint.h') | ||
80 | conf_data.set('HAVE_STDINT_H', 1) | ||
81 | endif | ||
82 | if compiler.has_header('sys/stat.h') | ||
83 | conf_data.set('HAVE_SYS_STAT_H', 1) | ||
84 | endif | ||
85 | if compiler.has_header('sys/types.h') | ||
86 | conf_data.set('HAVE_SYS_TYPES_H', 1) | ||
87 | endif | ||
88 | conf_data.set('NEED_XMALLOC', 1) | ||
89 | conf_data.set('STDC_HEADERS', 1) | ||
90 | conf_data.set('VERSION', '"' + meson.project_version() + '"') | ||
91 | |||
92 | configure_file(output: 'config.h', configuration: conf_data) | ||
diff --git a/meta/recipes-extended/which/which_2.21.bb b/meta/recipes-extended/which/which_2.23.bb index 7279a04737..0bbc3510d8 100644 --- a/meta/recipes-extended/which/which_2.21.bb +++ b/meta/recipes-extended/which/which_2.23.bb | |||
@@ -9,21 +9,18 @@ HOMEPAGE = "https://carlowood.github.io/which/" | |||
9 | LICENSE = "GPL-3.0-or-later" | 9 | LICENSE = "GPL-3.0-or-later" |
10 | LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504\ | 10 | LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504\ |
11 | file://which.c;beginline=1;endline=17;md5=a9963693af2272e7a8df6f231164e7a2" | 11 | file://which.c;beginline=1;endline=17;md5=a9963693af2272e7a8df6f231164e7a2" |
12 | DEPENDS = "cwautomacros-native" | ||
13 | 12 | ||
14 | inherit autotools texinfo update-alternatives | 13 | inherit meson update-alternatives |
15 | |||
16 | EXTRA_OECONF = "--disable-iberty" | ||
17 | 14 | ||
18 | SRC_URI = "${GNU_MIRROR}/which/which-${PV}.tar.gz \ | 15 | SRC_URI = "${GNU_MIRROR}/which/which-${PV}.tar.gz \ |
19 | file://automake.patch \ | 16 | file://meson.build \ |
20 | file://0001-getopt-Fix-signature-of-getenv-function.patch \ | 17 | file://0001-getopt-Fix-signature-of-getenv-function.patch \ |
21 | " | 18 | " |
22 | 19 | ||
23 | SRC_URI[sha256sum] = "f4a245b94124b377d8b49646bf421f9155d36aa7614b6ebf83705d3ffc76eaad" | 20 | SRC_URI[sha256sum] = "a2c558226fc4d9e4ce331bd2fd3c3f17f955115d2c00e447618a4ef9978a2a73" |
24 | 21 | ||
25 | do_configure:prepend() { | 22 | do_configure:prepend() { |
26 | sed -i -e 's%@ACLOCAL_CWFLAGS@%-I ${STAGING_DIR_NATIVE}/usr/share/cwautomacros/m4%g' ${S}/Makefile.am ${S}/tilde/Makefile.am | 23 | cp ${UNPACKDIR}/meson.build ${S} |
27 | } | 24 | } |
28 | 25 | ||
29 | ALTERNATIVE:${PN} = "which" | 26 | ALTERNATIVE:${PN} = "which" |