mirror of
https://github.com/jaspervdj/patat.git
synced 2024-11-23 00:09:05 +03:00
Read SOURCE_DATE_EPOCH if it exists
This commit is contained in:
parent
a8e507f944
commit
2accea2c81
5
Makefile
5
Makefile
@ -1,8 +1,9 @@
|
||||
PANDOC_MINOR_VERSION=$(shell ghc-pkg latest pandoc | sed 's/.*-//' | cut -d. -f2)
|
||||
PATAT_BUILD_DATE=$(shell date '+%B %d, %Y' -d "$(shell git log -1 --format=%cd --date=short)")
|
||||
SOURCE_DATE_EPOCH?=$(shell git log -1 --format=%cd --date=unix)
|
||||
SOURCE_DATE=$(shell date '+%B %d, %Y' -d "@${SOURCE_DATE_EPOCH}")
|
||||
|
||||
extra/patat.1: README.md extra/make-man
|
||||
PATAT_BUILD_DATE="$(PATAT_BUILD_DATE)" ./extra/make-man >$@
|
||||
SOURCE_DATE="$(SOURCE_DATE)" ./extra/make-man >$@
|
||||
|
||||
extra/make-man: extra/make-man.hs
|
||||
ghc -DPANDOC_MINOR_VERSION=${PANDOC_MINOR_VERSION} -Wall -o $@ $<
|
||||
|
@ -83,9 +83,8 @@ main = do
|
||||
Right pandoc0 <- Pandoc.readMarkdown Pandoc.def <$> readFile "README.md"
|
||||
Right template <- Pandoc.getDefaultTemplate Nothing "man"
|
||||
|
||||
-- It's important for reproducible builds that we get the date from git.
|
||||
version <- getVersion
|
||||
date <- getEnv "PATAT_BUILD_DATE"
|
||||
date <- getEnv "SOURCE_DATE"
|
||||
|
||||
let writerOptions = Pandoc.def {
|
||||
#if PANDOC_MINOR_VERSION >= 19
|
||||
|
Loading…
Reference in New Issue
Block a user