Package: zim / 0.65-4

reproducible-build.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
Author: Reiner Herrmann <reiner@reiner-h.de>
Description: Enable reproducible building
 - Honour SOURCE_DATE_EPOCH for manpage timestamp, if it is defined
 - Use C locale for embedded time
 - Sort list of plugins
Bug: https://bugs.launchpad.net/zim/+bug/1604833

--- a/makeman.py
+++ b/makeman.py
@@ -6,7 +6,8 @@
 
 import os
 
-from time import strftime
+from time import strftime, gmtime, time
+from locale import setlocale, LC_TIME
 
 from zim import __version__, __url__, \
 	__author__, __copyright__, __license__
@@ -42,8 +43,9 @@
 		os.mkdir('man')
 	except OSError:
 		pass # dir already exists
+	setlocale(LC_TIME, "C")
 	manpage = open('man/zim.1', 'w')
-	manpage.write('.TH ZIM "1" "%s" "zim %s" "User Commands"\n' % (strftime('%B %Y'), __version__))
+	manpage.write('.TH ZIM "1" "%s" "zim %s" "User Commands"\n' % (strftime('%B %Y', gmtime(int(os.environ.get('SOURCE_DATE_EPOCH', time())))), __version__))
 	manpage.write('.SH NAME\nzim \\- %s\n\n' % tagline)
 	manpage.write('.SH SYNOPSIS\n%s\n' % HelpCommand.usagehelp.replace('-', r'\-'))
 	manpage.write('.SH DESCRIPTION\n%s\n' % about)
--- a/setup.py
+++ b/setup.py
@@ -290,7 +290,7 @@
 
 		for i, line in enumerate(lines):
 			if line.startswith('\t\tplugins = set('):
-				lines[i] = '\t\tplugins = set(%r) # DEFAULT PLUGINS COMPILED IN BY SETUP.PY\n' % plugins
+				lines[i] = '\t\tplugins = set(%r) # DEFAULT PLUGINS COMPILED IN BY SETUP.PY\n' % sorted(plugins)
 				break
 		else:
 			assert False, 'Missed line for plugin list'