summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2022-07-05 15:21:18 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-07-09 20:58:35 +0100
commitdc184d6aaf282f28fe96cce2f01bf20f09821645 (patch)
treeb0cfe1612557a777723a95f9b2f574a391180f64
parent8ea0d49ee4642af80e9e36f065b40ac85ae37de0 (diff)
downloadpoky-dc184d6aaf282f28fe96cce2f01bf20f09821645.tar.gz
gperf: Switch to upstream patch
Upstream merged a patch to handle the reproducibility issue, switch to their patch which is functionally equivalent. (From OE-Core rev: db28cd0e1540e44db963108430205c8c0c817774) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-extended/gperf/gperf/1862c6e57a308a05889c80c048dbc58bdc378dcb.patch181
-rw-r--r--meta/recipes-extended/gperf/gperf/reproducibility.patch26
-rw-r--r--meta/recipes-extended/gperf/gperf_3.1.bb2
3 files changed, 182 insertions, 27 deletions
diff --git a/meta/recipes-extended/gperf/gperf/1862c6e57a308a05889c80c048dbc58bdc378dcb.patch b/meta/recipes-extended/gperf/gperf/1862c6e57a308a05889c80c048dbc58bdc378dcb.patch
new file mode 100644
index 0000000000..98959db0a8
--- /dev/null
+++ b/meta/recipes-extended/gperf/gperf/1862c6e57a308a05889c80c048dbc58bdc378dcb.patch
@@ -0,0 +1,181 @@
1From 1862c6e57a308a05889c80c048dbc58bdc378dcb Mon Sep 17 00:00:00 2001
2From: Bruno Haible <bruno@clisp.org>
3Date: Tue, 5 Jul 2022 07:51:46 +0200
4Subject: [PATCH] Add support for reproducible builds.
5
6Suggested by Richard Purdie <richard.purdie@linuxfoundation.org> in
7<https://lists.gnu.org/archive/html/bug-gperf/2022-07/msg00000.html>.
8
9* autogen.sh: Import also lib/filename.h.
10* Makefile.in (IMPORTED_FILES): Add lib/filename.h.
11* src/options.cc: Include filename.h.
12(Options::print_options): Print only the base name of the program name.
13* tests/*.exp: Update.
14
15Upstream-Status: Backport
16
17Index: gperf-3.1/ChangeLog
18===================================================================
19--- gperf-3.1.orig/ChangeLog
20+++ gperf-3.1/ChangeLog
21@@ -1,3 +1,14 @@
22+2022-07-05 Bruno Haible <bruno@clisp.org>
23+
24+ Add support for reproducible builds.
25+ Suggested by Richard Purdie <richard.purdie@linuxfoundation.org> in
26+ <https://lists.gnu.org/archive/html/bug-gperf/2022-07/msg00000.html>.
27+ * autogen.sh: Import also lib/filename.h.
28+ * Makefile.in (IMPORTED_FILES): Add lib/filename.h.
29+ * src/options.cc: Include filename.h.
30+ (Options::print_options): Print only the base name of the program name.
31+ * tests/*.exp: Update.
32+
33 2017-01-02 Marcel Schaible <marcel.schaible@studium.fernuni-hagen.de>
34
35 * gperf-3.1 released.
36Index: gperf-3.1/src/options.cc
37===================================================================
38--- gperf-3.1.orig/src/options.cc
39+++ gperf-3.1/src/options.cc
40@@ -26,6 +26,7 @@
41 #include <string.h> /* declares strcmp() */
42 #include <ctype.h> /* declares isdigit() */
43 #include <limits.h> /* defines CHAR_MAX */
44+#include "filename.h"
45 #include "getopt.h"
46 #include "version.h"
47
48@@ -280,6 +281,16 @@ Options::print_options () const
49 {
50 const char *arg = _argument_vector[i];
51
52+ if (i == 0)
53+ {
54+ /* _argument_vector[0] is the program name. Print only its base name.
55+ This is useful for reproducible builds. */
56+ const char *p = arg + strlen (arg);
57+ while (p > arg && ! ISSLASH (p[-1]))
58+ p--;
59+ arg = p;
60+ }
61+
62 /* Escape arg if it contains shell metacharacters. */
63 if (*arg == '-')
64 {
65Index: gperf-3.1/lib/filename.h
66===================================================================
67--- /dev/null
68+++ gperf-3.1/lib/filename.h
69@@ -0,0 +1,112 @@
70+/* Basic filename support macros.
71+ Copyright (C) 2001-2022 Free Software Foundation, Inc.
72+ This file is part of the GNU C Library.
73+
74+ The GNU C Library is free software; you can redistribute it and/or
75+ modify it under the terms of the GNU Lesser General Public
76+ License as published by the Free Software Foundation; either
77+ version 2.1 of the License, or (at your option) any later version.
78+
79+ The GNU C Library is distributed in the hope that it will be useful,
80+ but WITHOUT ANY WARRANTY; without even the implied warranty of
81+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
82+ Lesser General Public License for more details.
83+
84+ You should have received a copy of the GNU Lesser General Public
85+ License along with the GNU C Library; if not, see
86+ <https://www.gnu.org/licenses/>. */
87+
88+/* From Paul Eggert and Jim Meyering. */
89+
90+#ifndef _FILENAME_H
91+#define _FILENAME_H
92+
93+#include <string.h>
94+
95+#ifdef __cplusplus
96+extern "C" {
97+#endif
98+
99+
100+/* Filename support.
101+ ISSLASH(C) tests whether C is a directory separator
102+ character.
103+ HAS_DEVICE(Filename) tests whether Filename contains a device
104+ specification.
105+ FILE_SYSTEM_PREFIX_LEN(Filename) length of the device specification
106+ at the beginning of Filename,
107+ index of the part consisting of
108+ alternating components and slashes.
109+ FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE
110+ 1 when a non-empty device specification
111+ can be followed by an empty or relative
112+ part,
113+ 0 when a non-empty device specification
114+ must be followed by a slash,
115+ 0 when device specification don't exist.
116+ IS_ABSOLUTE_FILE_NAME(Filename)
117+ tests whether Filename is independent of
118+ any notion of "current directory".
119+ IS_RELATIVE_FILE_NAME(Filename)
120+ tests whether Filename may be concatenated
121+ to a directory filename.
122+ Note: On native Windows, OS/2, DOS, "c:" is neither an absolute nor a
123+ relative file name!
124+ IS_FILE_NAME_WITH_DIR(Filename) tests whether Filename contains a device
125+ or directory specification.
126+ */
127+#if defined _WIN32 || defined __CYGWIN__ \
128+ || defined __EMX__ || defined __MSDOS__ || defined __DJGPP__
129+ /* Native Windows, Cygwin, OS/2, DOS */
130+# define ISSLASH(C) ((C) == '/' || (C) == '\\')
131+ /* Internal macro: Tests whether a character is a drive letter. */
132+# define _IS_DRIVE_LETTER(C) \
133+ (((C) >= 'A' && (C) <= 'Z') || ((C) >= 'a' && (C) <= 'z'))
134+ /* Help the compiler optimizing it. This assumes ASCII. */
135+# undef _IS_DRIVE_LETTER
136+# define _IS_DRIVE_LETTER(C) \
137+ (((unsigned int) (C) | ('a' - 'A')) - 'a' <= 'z' - 'a')
138+# define HAS_DEVICE(Filename) \
139+ (_IS_DRIVE_LETTER ((Filename)[0]) && (Filename)[1] == ':')
140+# define FILE_SYSTEM_PREFIX_LEN(Filename) (HAS_DEVICE (Filename) ? 2 : 0)
141+# ifdef __CYGWIN__
142+# define FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE 0
143+# else
144+ /* On native Windows, OS/2, DOS, the system has the notion of a
145+ "current directory" on each drive. */
146+# define FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE 1
147+# endif
148+# if FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE
149+# define IS_ABSOLUTE_FILE_NAME(Filename) \
150+ ISSLASH ((Filename)[FILE_SYSTEM_PREFIX_LEN (Filename)])
151+# else
152+# define IS_ABSOLUTE_FILE_NAME(Filename) \
153+ (ISSLASH ((Filename)[0]) || HAS_DEVICE (Filename))
154+# endif
155+# define IS_RELATIVE_FILE_NAME(Filename) \
156+ (! (ISSLASH ((Filename)[0]) || HAS_DEVICE (Filename)))
157+# define IS_FILE_NAME_WITH_DIR(Filename) \
158+ (strchr ((Filename), '/') != NULL || strchr ((Filename), '\\') != NULL \
159+ || HAS_DEVICE (Filename))
160+#else
161+ /* Unix */
162+# define ISSLASH(C) ((C) == '/')
163+# define HAS_DEVICE(Filename) ((void) (Filename), 0)
164+# define FILE_SYSTEM_PREFIX_LEN(Filename) ((void) (Filename), 0)
165+# define FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE 0
166+# define IS_ABSOLUTE_FILE_NAME(Filename) ISSLASH ((Filename)[0])
167+# define IS_RELATIVE_FILE_NAME(Filename) (! ISSLASH ((Filename)[0]))
168+# define IS_FILE_NAME_WITH_DIR(Filename) (strchr ((Filename), '/') != NULL)
169+#endif
170+
171+/* Deprecated macros. For backward compatibility with old users of the
172+ 'filename' module. */
173+#define IS_ABSOLUTE_PATH IS_ABSOLUTE_FILE_NAME
174+#define IS_PATH_WITH_DIR IS_FILE_NAME_WITH_DIR
175+
176+
177+#ifdef __cplusplus
178+}
179+#endif
180+
181+#endif /* _FILENAME_H */
diff --git a/meta/recipes-extended/gperf/gperf/reproducibility.patch b/meta/recipes-extended/gperf/gperf/reproducibility.patch
deleted file mode 100644
index 9f80828dbd..0000000000
--- a/meta/recipes-extended/gperf/gperf/reproducibility.patch
+++ /dev/null
@@ -1,26 +0,0 @@
1By default gperf puts a header into generated files with the full path to
2the tool along with the commandline used. This patch removes the path to
3the binary, allowing reproducible source files (which can be included in
4debug source packages).
5
6Upstream-Status: Pending
7Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
8
9Index: gperf-3.1/src/options.cc
10===================================================================
11--- gperf-3.1.orig/src/options.cc
12+++ gperf-3.1/src/options.cc
13@@ -280,6 +280,13 @@ Options::print_options () const
14 {
15 const char *arg = _argument_vector[i];
16
17+ if (i == 0) {
18+ const char *shortarg = strrchr(arg, '/');
19+ if (shortarg) {
20+ arg = shortarg + 1;
21+ }
22+ }
23+
24 /* Escape arg if it contains shell metacharacters. */
25 if (*arg == '-')
26 {
diff --git a/meta/recipes-extended/gperf/gperf_3.1.bb b/meta/recipes-extended/gperf/gperf_3.1.bb
index 3564ac0805..c9f09c7931 100644
--- a/meta/recipes-extended/gperf/gperf_3.1.bb
+++ b/meta/recipes-extended/gperf/gperf_3.1.bb
@@ -9,7 +9,7 @@ SRC_URI = "${GNU_MIRROR}/${BPN}/${BP}.tar.gz"
9SRC_URI[md5sum] = "9e251c0a618ad0824b51117d5d9db87e" 9SRC_URI[md5sum] = "9e251c0a618ad0824b51117d5d9db87e"
10SRC_URI[sha256sum] = "588546b945bba4b70b6a3a616e80b4ab466e3f33024a352fc2198112cdbb3ae2" 10SRC_URI[sha256sum] = "588546b945bba4b70b6a3a616e80b4ab466e3f33024a352fc2198112cdbb3ae2"
11 11
12SRC_URI:append = " file://reproducibility.patch" 12SRC_URI += "file://1862c6e57a308a05889c80c048dbc58bdc378dcb.patch"
13 13
14inherit autotools 14inherit autotools
15 15