gnu: mono: Make build reproducible.

* gnu/packages/patches/mono-mdoc-timestamping.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.
* gnu/packages/mono.scm (mono)[source]: Use patch.
[arguments]<#:phases>[make-reproducible]: New phase.
<#:phases>[set-env]: Set SOURCE_DATE_EPOCH.
This commit is contained in:
Danny Milosavljevic 2018-11-27 00:23:03 +01:00
parent 8160baf8b7
commit bc0d24292d
No known key found for this signature in database
GPG Key ID: E71A35542C30BAA5
3 changed files with 26 additions and 1 deletions

View File

@ -972,6 +972,7 @@ dist_patch_DATA = \
%D%/packages/patches/module-init-tools-moduledir.patch \ %D%/packages/patches/module-init-tools-moduledir.patch \
%D%/packages/patches/monero-use-system-miniupnpc.patch \ %D%/packages/patches/monero-use-system-miniupnpc.patch \
%D%/packages/patches/mongodb-support-unknown-linux-distributions.patch \ %D%/packages/patches/mongodb-support-unknown-linux-distributions.patch \
%D%/packages/patches/mono-mdoc-timestamping.patch \
%D%/packages/patches/mozjs17-aarch64-support.patch \ %D%/packages/patches/mozjs17-aarch64-support.patch \
%D%/packages/patches/mozjs24-aarch64-support.patch \ %D%/packages/patches/mozjs24-aarch64-support.patch \
%D%/packages/patches/mozjs38-pkg-config-version.patch \ %D%/packages/patches/mozjs38-pkg-config-version.patch \

View File

@ -41,7 +41,8 @@
".tar.bz2")) ".tar.bz2"))
(sha256 (sha256
(base32 (base32
"0jibyvyv2jy8dq5ij0j00iq3v74r0y90dcjc3dkspcfbnn37cphn")))) "0jibyvyv2jy8dq5ij0j00iq3v74r0y90dcjc3dkspcfbnn37cphn"))
(patches (search-patches "mono-mdoc-timestamping.patch"))))
(build-system gnu-build-system) (build-system gnu-build-system)
(native-inputs (native-inputs
`(("gettext" ,gettext-minimal) `(("gettext" ,gettext-minimal)
@ -52,10 +53,18 @@
(arguments (arguments
`(#:phases `(#:phases
(modify-phases %standard-phases (modify-phases %standard-phases
(add-after 'unpack 'make-reproducible
(lambda _
(substitute* "mono/mini/Makefile.in"
(("build_date = [^;]*;")
"build_date = (void*) 0;"))
#t))
(add-after 'unpack 'set-env (add-after 'unpack 'set-env
(lambda _ ;;* (#:key inputs #:allow-other-keys) (lambda _ ;;* (#:key inputs #:allow-other-keys)
;; all tests under mcs/class fail trying to access $HOME ;; all tests under mcs/class fail trying to access $HOME
(setenv "HOME" "/tmp") (setenv "HOME" "/tmp")
;; ZIP files have "DOS time" which starts in Jan 1980.
(setenv "SOURCE_DATE_EPOCH" "315532800")
#t)) #t))
(add-after 'unpack 'fix-includes (add-after 'unpack 'fix-includes
(lambda _ (lambda _

View File

@ -0,0 +1,15 @@
--- mono-4.4.1/mcs/class/monodoc/Monodoc/storage/ZipStorage.cs.orig 2018-11-26 22:16:25.008879747 +0100
+++ mono-4.4.1/mcs/class/monodoc/Monodoc/storage/ZipStorage.cs 2018-11-26 22:21:53.969770985 +0100
@@ -74,6 +74,12 @@
id = GetNewCode ();
ZipEntry entry = new ZipEntry (id);
+ var SOURCE_DATE_EPOCH_string = Environment.GetEnvironmentVariable("SOURCE_DATE_EPOCH");
+ if (SOURCE_DATE_EPOCH_string != null)
+ {
+ var SOURCE_DATE_EPOCH = Convert.ToInt64(SOURCE_DATE_EPOCH_string);
+ entry.DateTime = new DateTime(SOURCE_DATE_EPOCH, DateTimeKind.Utc);
+ }
zipOutput.PutNextEntry (entry);
}