Source: lua-ldoc
Version: 1.4.3-5
Severity: wishlist
Tags: patch upstream
User: reproducible-builds@lists.alioth.debian.org
Usertags: toolchain
X-Debbugs-Cc: reproducible-builds@lists.alioth.debian.org

Control: forwarded -1 https://github.com/stevedonovan/LDoc/pull/233

Dear Maintainer,

While working on the “reproducible builds” effort [1], we have noticed
that some packages (like lua-posix) use LDoc in their building process,
resulting in timestamps in documentation files that break reproducibility.

To solve this kind of issues, it would be nice to have LDoc support
the SOURCE_DATE_EPOCH environment variable [2].

See the attached patch for a solution to this issue.

Regards,
Alexis Bienvenüe.

[1] https://wiki.debian.org/ReproducibleBuilds
[2] https://reproducible-builds.org/specs/source-date-epoch/

diff -Nru lua-ldoc-1.4.3/debian/changelog lua-ldoc-1.4.3/debian/changelog
--- lua-ldoc-1.4.3/debian/changelog	2015-11-01 10:17:35.000000000 +0100
+++ lua-ldoc-1.4.3/debian/changelog	2016-04-06 08:57:58.000000000 +0200
@@ -1,3 +1,9 @@
+lua-ldoc (1.4.3-5.0~reproducible1) unstable; urgency=medium
+
+  * Honour the SOURCE_DATE_EPOCH environment variable
+
+ -- Alexis Bienvenüe <p...@passoire.fr>  Wed, 06 Apr 2016 08:57:58 +0200
+
 lua-ldoc (1.4.3-5) unstable; urgency=medium
 
   * Fix header used by lua-any adding 5.1 (Closes: #802248) 
diff -Nru lua-ldoc-1.4.3/debian/patches/0005-honour-SOURCE_DATE_EPOCH.patch lua-ldoc-1.4.3/debian/patches/0005-honour-SOURCE_DATE_EPOCH.patch
--- lua-ldoc-1.4.3/debian/patches/0005-honour-SOURCE_DATE_EPOCH.patch	1970-01-01 01:00:00.000000000 +0100
+++ lua-ldoc-1.4.3/debian/patches/0005-honour-SOURCE_DATE_EPOCH.patch	2016-04-06 08:57:21.000000000 +0200
@@ -0,0 +1,26 @@
+Description: Honour the SOURCE_DATE_EPOCH environment variable
+ Honour the SOURCE_DATE_EPOCH environment variable for even simpler
+ reproducible builds.
+ See https://reproducible-builds.org/specs/source-date-epoch/
+Author: Alexis Bienvenüe <p...@passoire.fr>
+
+--- lua-ldoc-1.4.3.orig/ldoc.lua
++++ lua-ldoc-1.4.3/ldoc.lua
+@@ -783,10 +783,14 @@ ldoc.modules = module_list
+ ldoc.title = ldoc.title or args.title
+ ldoc.project = ldoc.project or args.project
+ ldoc.package = args.package:match '%a+' and args.package or nil
+-if args.date == 'system' then
+-ldoc.updatetime = os.date("%Y-%m-%d %H:%M:%S")
++if os.getenv("SOURCE_DATE_EPOCH") == nil then
++   if args.date == 'system' then
++      ldoc.updatetime = os.date("%Y-%m-%d %H:%M:%S")
++   else
++      ldoc.updatetime = args.date
++   end
+ else
+-ldoc.updatetime = args.date
++   ldoc.updatetime = os.date("!%Y-%m-%d %H:%M:%S",os.getenv("SOURCE_DATE_EPOCH"))
+ end
+ 
+ local html = require 'ldoc.html'
diff -Nru lua-ldoc-1.4.3/debian/patches/series lua-ldoc-1.4.3/debian/patches/series
--- lua-ldoc-1.4.3/debian/patches/series	2015-11-01 10:17:35.000000000 +0100
+++ lua-ldoc-1.4.3/debian/patches/series	2016-04-06 08:55:47.000000000 +0200
@@ -2,3 +2,4 @@
 0002-Remove-non-existing-one-1.md-from-tests-config.ld.patch
 0003-Fix-broken-template-missing-closing-bracket.patch
 0004-make-system-date-override-able-via-date.patch
+0005-honour-SOURCE_DATE_EPOCH.patch
_______________________________________________
Reproducible-builds mailing list
Reproducible-builds@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/reproducible-builds

Reply via email to