unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
blob 7e874a57e0d2ef31ec296e180ef528bccaa26c3d 1204 bytes (raw)
name: gnu/packages/patches/erlang-reproducible-build.patch 	 # note: path name is non-authoritative(*)

 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
 
Copied from Debian [0].

[0]
https://sources.debian.net/src/erlang/1:18.3-dfsg-1/debian/patches/reproducible-build.patch/

---

Author: Chris Lamb <lamby@debian.org>
Description: Patch makes erlang compiler honor the SOURCE_DATE_EPOCH
 environment variable and use its value in build results instead of the
 current timestamp. The goal is to maintain reproducible builds. More info:
 https://wiki.debian.org/ReproducibleBuilds
Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=795834
Last-modified: Mon, 17 Aug 2015 14:32:15 +0300

--- a/lib/compiler/src/beam_asm.erl
+++ b/lib/compiler/src/beam_asm.erl
@@ -226,7 +226,11 @@
 build_attributes(Opts, SourceFile, Attr, MD5) ->
     Misc = case member(slim, Opts) of
 	       false ->
-		   {{Y,Mo,D},{H,Mi,S}} = erlang:universaltime(),
+                  {{Y,Mo,D},{H,Mi,S}} = case string:to_integer(os:getenv("SOURCE_DATE_EPOCH")) of
+                       {N,[]} ->calendar:gregorian_seconds_to_datetime(N +
+			    calendar:datetime_to_gregorian_seconds({{1970,1,1},{0,0,0}}));
+                       {_,_} -> erlang:universaltime()
+                  end,
 		   [{time,{Y,Mo,D,H,Mi,S}},{source,SourceFile}];
 	       true -> []
 	   end,

debug log:

solving 7e874a5 ...
found 7e874a5 in https://yhetil.org/guix-devel/20160404033924.GA28101@jasmine/

applying [1/1] https://yhetil.org/guix-devel/20160404033924.GA28101@jasmine/
diff --git a/gnu/packages/patches/erlang-reproducible-build.patch b/gnu/packages/patches/erlang-reproducible-build.patch
new file mode 100644
index 0000000..7e874a5

1:27: space before tab in indent.
 	       false ->
1:34: space before tab in indent.
 		   [{time,{Y,Mo,D,H,Mi,S}},{source,SourceFile}];
1:35: space before tab in indent.
 	       true -> []
1:36: space before tab in indent.
 	   end,
Checking patch gnu/packages/patches/erlang-reproducible-build.patch...
Applied patch gnu/packages/patches/erlang-reproducible-build.patch cleanly.
warning: 4 lines add whitespace errors.

index at:
100644 7e874a57e0d2ef31ec296e180ef528bccaa26c3d	gnu/packages/patches/erlang-reproducible-build.patch

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).