gnu: rebar3: Update to 3.24.0, make reproducible.

* gnu/packages/erlang.scm (rebar3): Update to 3.24.0.
[arguments]<#:phases>: Modify 'make-escriptize-reproducible phase.

Change-Id: I264515753f1ed0bdabdc4042a1c850d738c27738
Signed-off-by: Andrew Tropin <andrew@trop.in>
This commit is contained in:
Igor Goryachev via Guix-patches via 2024-09-19 19:39:12 +03:00 committed by Andrew Tropin
parent d6211bd0c1
commit 5fa4b5cb99
No known key found for this signature in database
GPG key ID: 2208D20958C1DEB0

View file

@ -637,7 +637,7 @@ (define-public erlang-ssl-verify-fun
(define-public rebar3 (define-public rebar3
(package (package
(name "rebar3") (name "rebar3")
(version "3.23.0") (version "3.24.0")
(source (source
(origin (origin
(method git-fetch) (method git-fetch)
@ -646,7 +646,7 @@ (define-public rebar3
(commit version))) (commit version)))
(file-name (git-file-name name version)) (file-name (git-file-name name version))
(sha256 (sha256
(base32 "0jinjx3mk5j1kczxmblixbvhf24q0yfwih2ggs11x5ykmrqpbckl")))) (base32 "1l73csyzxwinhrcsyb8hg2003v35yz6pv98inl3wg1j5587f071s"))))
(build-system gnu-build-system) (build-system gnu-build-system)
;; TODO: remove vendored modules, install man-page, install lib(?) ;; TODO: remove vendored modules, install man-page, install lib(?)
(arguments (arguments
@ -672,29 +672,14 @@ (define-public rebar3
"eunit_formatters" "getopt" "hex_core" "erlware_commons" "eunit_formatters" "getopt" "hex_core" "erlware_commons"
"parse_trans" "relx" "ssl_verify_fun" "providers")))) "parse_trans" "relx" "ssl_verify_fun" "providers"))))
(delete 'configure) (delete 'configure)
;; By default rebar3 produces escripts with embedded ZIP archives ;; Due to changes in Erlang 27.1 related to handling ZIP-archives
;; with files with current timestamps which is not suitable for ;; we still need to patch rebar to make it generate reproducible
;; reproducible builds. We fix it by setting predefined timestamps. ;; escripts.
(add-before 'build 'make-escriptize-reproducible (add-before 'build 'make-escriptize-reproducible
(lambda _ (lambda _
(let ((escriptize "apps/rebar/src/rebar_prv_escriptize.erl")) (substitute* "apps/rebar/src/rebar_prv_escriptize.erl"
(substitute* escriptize (("mtime = DateTime")
(("\\[dir_entries\\(filename:dirname\\(Filename1\\)\\),") "atime = DateTime,ctime = DateTime,mtime = DateTime"))))
(string-append "FilePath = filename:join(Dir, Filename),"
"{ok, FileInfo0} = file:read_file_info(FilePath),"
"DateTime = {{1970, 1, 1}, {0, 0, 1}},"
"FileInfo = FileInfo0#file_info{mtime = DateTime},"
"[dir_entries(filename:dirname(Filename1)),")))
(substitute* escriptize
(((string-append
"\\{Filename1, file_contents\\(filename:join\\(Dir, "
"Filename\\)\\)\\}\\]."))
"{Filename1, file_contents(FilePath), FileInfo}]."))
(substitute* escriptize
(((string-append "\\[\\{FName,FBin\\} \\|\\| \\{FName,FBin\\} <- "
"Files, FBin =/= <<>>\\]\\."))
(string-append "[{FName,FBin,FInfo} || {FName,FBin,FInfo} <- "
"Files, FBin =/= <<>>]."))))))
(replace 'build (replace 'build
(lambda _ (lambda _
(setenv "HOME" (getcwd)) (setenv "HOME" (getcwd))