Skip to content

Commit

Permalink
feat(build): Accommodate SOURCE_DATE_EPOCH for reproducible builds
Browse files Browse the repository at this point in the history
  • Loading branch information
alerque committed Dec 30, 2021
1 parent c389355 commit 16c81a8
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,23 @@ AC_PROG_SED
AX_PROGVAR([cmp])
AX_PROGVAR([git])

DATEFMT='%d %B %Y'
AM_COND_IF([IS_SDIST],
[
AX_PROGVAR([date])
MAN_DATE=$($DATE "+%d %B %Y")
if test -n "$SOURCE_DATE_EPOCH"; then
AX_PROG_DATE([date])
AS_VAR_IF([ax_cv_prog_date_gnu], [yes], [
MAN_DATE=$(LC_ALL=C $DATE --utc --date=@$SOURCE_DATE_EPOCH +"$DATEFMT")
])
AS_VAR_IF([ax_cv_prog_date_bsd], [yes], [
MAN_DATE=$(LC_ALL=C TZ=UTC $DATE -r $SOURCE_DATE_EPOCH +"$DATEFMT")
])
else
MAN_DATE=$($DATE +"$DATEFMT")
fi
], [
MAN_DATE=$($GIT log -1 --format="%cd" --date=format:"%d %B %Y" -- sile.1.in)
MAN_DATE=$($GIT log -1 --format="%cd" --date=format:"$DATEFMT" -- sile.1.in)
])
AC_SUBST([MAN_DATE])

Expand Down

0 comments on commit 16c81a8

Please sign in to comment.