guix-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug#72508] [PATCH v2 5/5] gnu: erlang: Update to 27.0.1.


From: Igor Goryachev
Subject: [bug#72508] [PATCH v2 5/5] gnu: erlang: Update to 27.0.1.
Date: Wed, 7 Aug 2024 19:32:13 +0300

* gnu/packages/erlang.scm (erlang): Update to 27.0.1.

Change-Id: Ic603c441cc304ef460e2559c57d765d7e499aad5
---
 gnu/packages/erlang.scm | 74 ++++++++++++++++++++++-------------------
 1 file 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-module (gnu packages erlang)
 (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 @@ (define-public erlang
               (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 @@ (define-public erlang
 
        ;; 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 @@ (define-public erlang
      `(#: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 @@ (define-public erlang
                     (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 @@ (define-public erlang
                         "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))))
-- 
2.45.2






reply via email to

[Prev in Thread] Current Thread [Next in Thread]