diff options
author | Joshua Watt <jpewhacker@gmail.com> | 2019-05-31 08:59:53 -0500 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-05-31 22:13:31 +0100 |
commit | fe445324084c2631080afd3d28a0288f146bbdee (patch) | |
tree | aaf003013a4bb49f7ee437b1132461b9ee2f38c3 /meta/recipes-devtools | |
parent | 464a2fed0be067b0ad703b3474b9e01566bf80d3 (diff) | |
download | poky-fe445324084c2631080afd3d28a0288f146bbdee.tar.gz |
perl: Set build date to SOURCE_DATE_EPOCH
Perl uses an internal #define called PERL_BUILD_DATE as the string for
the date when perl was built. If undefined, it defaults to using
__DATE__ and __TIME__, which is not reproducible. If SOURCE_DATE_EPOCH
is set at do_configure time, use it to generate a reproducible string
for PERL_BUILD_DATE.
(From OE-Core rev: 0ab44c72d0fb9b1d110ba975273b520cea5bf29f)
Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools')
-rw-r--r-- | meta/recipes-devtools/perl-sanity/perl_5.28.2.bb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/meta/recipes-devtools/perl-sanity/perl_5.28.2.bb b/meta/recipes-devtools/perl-sanity/perl_5.28.2.bb index f175e87a12..540b9f2df3 100644 --- a/meta/recipes-devtools/perl-sanity/perl_5.28.2.bb +++ b/meta/recipes-devtools/perl-sanity/perl_5.28.2.bb | |||
@@ -90,6 +90,16 @@ do_configure_class-native() { | |||
90 | -Ui_xlocale | 90 | -Ui_xlocale |
91 | } | 91 | } |
92 | 92 | ||
93 | do_configure_append() { | ||
94 | if [ -n "$SOURCE_DATE_EPOCH" ]; then | ||
95 | PERL_BUILD_DATE="$(${PYTHON} -c "\ | ||
96 | from datetime import datetime, timezone; \ | ||
97 | print(datetime.fromtimestamp($SOURCE_DATE_EPOCH, timezone.utc).strftime('%a %b %d %H:%M:%S %Y')) \ | ||
98 | ")" | ||
99 | echo "#define PERL_BUILD_DATE \"$PERL_BUILD_DATE\"" >> config.h | ||
100 | fi | ||
101 | } | ||
102 | |||
93 | do_compile() { | 103 | do_compile() { |
94 | oe_runmake | 104 | oe_runmake |
95 | } | 105 | } |