1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-06-20 00:15:31 +00:00

[configure.ac] Added --enable-reproducible and --with-source-date-epoch=TIME

Example of usage:
./autogen.sh
./configure ... \
--enable-reproducible \
--with-source-date-epoch=$(git log -1 --pretty=%ct)

make
make -C doc html
This commit is contained in:
Witold Filipczyk 2022-03-28 20:46:07 +02:00
parent 3d58236d15
commit e3992118c8
3 changed files with 13 additions and 2 deletions

View File

@ -50,7 +50,7 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@
host = @host@
ASCIIDOC = @PYTHON3@ $(top_srcdir)/doc/tools/asciidoc/asciidoc.py
ASCIIDOC = LANG=C LANGUAGE=en CONFIG_REPRODUCIBLE=@CONFIG_REPRODUCIBLE@ SOURCE_DATE_EPOCH=@SOURCE_DATE_EPOCH@ @PYTHON3@ $(top_srcdir)/doc/tools/asciidoc/asciidoc.py
ASCIIDOC_FLAGS = --unsafe
AWK = @AWK@
CATALOGS = @CATALOGS@

View File

@ -1600,12 +1600,22 @@ EL_ARG_ENABLE(CONFIG_UTF8, utf-8, [UTF-8],
EL_ARG_DEPEND(CONFIG_COMBINE, combining, [CONFIG_UTF8:yes HAVE_WCWIDTH:yes], [Combining characters],
[ --enable-combining support Unicode combining characters (experimental)])
EL_ARG_ENABLE(CONFIG_REPRODUCIBLE, reproducible, [Reproducible builds],
[ --enable-reproducible enable reproducible build])
AC_ARG_ENABLE(weehoofooboomookerchoo,
[
Also check out the features.conf file for more information about features!
],
[AC_MSG_ERROR(Are you strange, or what?)])
SOURCE_DATE_EPOCH=
AC_ARG_WITH(source-date-epoch, [ --with-source-date-epoch=[TIME]
set source date epoch for reproducible builds],
[SOURCE_DATE_EPOCH="$withval"])
AC_SUBST(SOURCE_DATE_EPOCH)
# ===================================================================
# Decide whether to use TRE

View File

@ -1061,7 +1061,8 @@ class Document:
self.safe = True # Default safe mode.
def init_attrs(self):
# Set implicit attributes.
if os.environ.get('CONFIG_REPRODUCIBLE', ''):
repro = os.environ.get('CONFIG_REPRODUCIBLE', '')
if repro and repro != 'no':
d = time.gmtime(int(os.environ.get('SOURCE_DATE_EPOCH', time.time())))
self.attributes['localdate'] = time.strftime('%d-%b-%Y',d)
s = time.strftime('%H:%M:%S %z',d)