aboutsummaryrefslogtreecommitdiff
path: root/gnu
diff options
context:
space:
mode:
authorIgor Goryachev via Guix-patches via <guix-patches@gnu.org>2024-08-07 19:32:13 +0300
committerAndrew Tropin <andrew@trop.in>2024-08-09 04:54:22 +0400
commit20dbf225f332ccc707578263ed710dcf2a8fb78e (patch)
treed0e67792911bcb275592e48cb6d782498b1a6c2a /gnu
parent535dadf89dc0d5f0f5f00019f6744912ecae2a8d (diff)
downloadguix-20dbf225f332ccc707578263ed710dcf2a8fb78e.tar.gz
guix-20dbf225f332ccc707578263ed710dcf2a8fb78e.zip
gnu: erlang: Update to 27.0.1.
* gnu/packages/erlang.scm (erlang): Update to 27.0.1. Change-Id: Ic603c441cc304ef460e2559c57d765d7e499aad5 Signed-off-by: Andrew Tropin <andrew@trop.in>
Diffstat (limited to 'gnu')
-rw-r--r--gnu/packages/erlang.scm74
1 files changed, 39 insertions, 35 deletions
diff --git a/gnu/packages/erlang.scm b/gnu/packages/erlang.scm
index 80ec673a56..175bbdf8a5 100644
--- a/gnu/packages/erlang.scm
+++ b/gnu/packages/erlang.scm
@@ -49,7 +49,7 @@
(define-public erlang
(package
(name "erlang")
- (version "26.2.5")
+ (version "27.0.1")
(source (origin
(method git-fetch)
;; The tarball from http://erlang.org/download contains many
@@ -61,7 +61,7 @@
(file-name (git-file-name name version))
(sha256
(base32
- "0hd4flm9x8254rcv8hj0hra5lh5n51vcpharxy2d1ph8059vfsmx"))
+ "1gzlvbbc1zm87910pnhi94mcpag1zxylhy7m2g4vhlmclyir7gd1"))
(patches (search-patches "erlang-man-path.patch"))))
(build-system gnu-build-system)
(native-inputs
@@ -69,13 +69,17 @@
;; Erlang's documentation is distributed in a separate tarball.
("erlang-manpages"
- ,(origin
- (method url-fetch)
- (uri (string-append "https://github.com/erlang/otp/releases/download"
- "/OTP-" version "/otp_doc_man_" version ".tar.gz"))
- (sha256
- (base32
- "08ngil8578asjzmqa657l4zdy0cr0h9spkg88wp9kxl95bfyli8p"))))))
+ ;; Manpages tarball is not released for 27.0.1, so we take it from the
+ ;; previous version. Details:
+ ;; https://erlangforums.com/t/patch-package-otp-27-0-1-released/3824/4
+ ,(let ((version "27.0"))
+ (origin
+ (method url-fetch)
+ (uri (string-append "https://github.com/erlang/otp/releases/download"
+ "/OTP-" version "/otp_doc_man_" version ".tar.gz"))
+ (sha256
+ (base32
+ "0f3w2152090860aci4a38d1bd19c5sslbwadwxc7sjza487fm8lm")))))))
(inputs
(list ncurses openssl wxwidgets))
(propagated-inputs
@@ -84,6 +88,7 @@
`(#:test-target "release_tests"
#:configure-flags
(list "--disable-saved-compile-time"
+ "--enable-deterministic-build"
"--enable-dynamic-ssl-lib"
"--enable-native-libs"
"--enable-shared-zlib"
@@ -106,34 +111,22 @@
(time-utc->date
(make-time time-utc 0 (string->number
(getenv "SOURCE_DATE_EPOCH"))))))
- (substitute* "lib/reltool/src/reltool_target.erl"
- (("Date = date\\(\\),")
- (string-append "Date = "
- (date->string source-date-epoch
- "'{~Y,~m,~d}',"))))
- (substitute* "lib/reltool/src/reltool_target.erl"
- (("Time = time\\(\\),")
- (string-append "Time = "
- (date->string source-date-epoch
- "'{~H,~M,~S}',"))))
- (substitute* '("lib/reltool/src/reltool_target.erl"
- "lib/sasl/src/systools_make.erl")
- (("date\\(\\), time\\(\\),")
- (date->string source-date-epoch
- "{~Y,~m,~d}, {~H,~M,~S},")))
(substitute* "lib/dialyzer/test/small_SUITE_data/src/gs_make.erl"
(("tuple_to_list\\(date\\(\\)\\),tuple_to_list\\(time\\(\\)\\)")
(date->string
source-date-epoch
- "tuple_to_list({~Y,~m,~d}), tuple_to_list({~H,~M,~S})")))
- (substitute* "lib/snmp/src/compile/snmpc_mib_to_hrl.erl"
- (("\\{Y,Mo,D\\} = date\\(\\),")
- (date->string source-date-epoch
- "{Y,Mo,D} = {~Y,~m,~d},")))
- (substitute* "lib/snmp/src/compile/snmpc_mib_to_hrl.erl"
- (("\\{H,Mi,S\\} = time\\(\\),")
- (date->string source-date-epoch
- "{H,Mi,S} = {~H,~M,~S},"))))))
+ "tuple_to_list({~Y,~m,~d}), tuple_to_list({~H,~M,~S})"))))))
+ ;; When compiling with 'deterministic' option the important meta
+ ;; information is still needed for some Erlang's dependants, such as
+ ;; Elixir. We make compiler to preserve it.
+ ;; For more info see: https://github.com/erlang/otp/issues/8602
+ (add-after 'unpack 'preserve-source-meta
+ (lambda _
+ (substitute* "lib/compiler/src/compile.erl"
+ (("\\[\\{source,Source\\} \\| Info0\\];")
+ "[{source,Source} | Info0];
+ [_|_] = Source when IsDeterministic ->
+ [{source,Source} | Info0];"))))
(add-after 'unpack 'patch-/bin/sh
(lambda* (#:key inputs #:allow-other-keys)
(let ((sh (search-input-file inputs "/bin/sh")))
@@ -160,10 +153,21 @@
"lib/reltool/examples/display_args"
"lib/reltool/examples/mnesia_core_dump_viewer"
"lib/snmp/src/compile/snmpc.src"
- "make/verify_runtime_dependencies"
- "make/emd2exml.in"))))
+ "make/verify_runtime_dependencies"))))
(substitute* escripts
(("/usr/bin/env") (which "env"))))))
+ ;; Copy modified compiler to bootstrap. It is deterministic, but
+ ;; preserves 'source' meta information to be used by dependants
+ ;; of Erlang.
+ (add-after 'build 'copy-modified-compiler
+ (lambda _
+ (copy-recursively "lib/compiler/ebin/compile.beam"
+ "bootstrap/lib/compiler/ebin/compile.beam")))
+ ;; ... clean everything and rebuild with modified bootstrap.
+ (add-after 'copy-modified-compiler 'clean-and-make-again
+ (lambda _
+ (invoke "make" "clean")
+ (invoke "make")))
(add-before 'configure 'set-erl-top
(lambda _
(setenv "ERL_TOP" (getcwd))))