[oe-commits] [openembedded-core] 01/06: perl: Set build date to SOURCE_DATE_EPOCH

git at git.openembedded.org git at git.openembedded.org
Fri May 31 21:24:27 UTC 2019


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master
in repository openembedded-core.

commit 0ab44c72d0fb9b1d110ba975273b520cea5bf29f
Author: Joshua Watt <jpewhacker at gmail.com>
AuthorDate: Fri May 31 08:59:53 2019 -0500

    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.
    
    Signed-off-by: Joshua Watt <JPEWhacker at gmail.com>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 meta/recipes-devtools/perl-sanity/perl_5.28.2.bb | 10 ++++++++++
 1 file changed, 10 insertions(+)

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 f175e87..540b9f2 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() {
     -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
 }

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list