mirror of
https://git.yoctoproject.org/poky
synced 2026-05-05 20:27:58 +02:00
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>
This commit is contained in:
committed by
Richard Purdie
parent
464a2fed0b
commit
fe44532408
@@ -90,6 +90,16 @@ do_configure_class-native() {
|
||||
-Ui_xlocale
|
||||
}
|
||||
|
||||
do_configure_append() {
|
||||
if [ -n "$SOURCE_DATE_EPOCH" ]; then
|
||||
PERL_BUILD_DATE="$(${PYTHON} -c "\
|
||||
from datetime import datetime, timezone; \
|
||||
print(datetime.fromtimestamp($SOURCE_DATE_EPOCH, timezone.utc).strftime('%a %b %d %H:%M:%S %Y')) \
|
||||
")"
|
||||
echo "#define PERL_BUILD_DATE \"$PERL_BUILD_DATE\"" >> config.h
|
||||
fi
|
||||
}
|
||||
|
||||
do_compile() {
|
||||
oe_runmake
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user