diff mbox series

[bug#70206,1/2] gnu: Add go-1.22.

Message ID 12d6f19bd1c2ba3ed121bfb2b8e60c374759903b.1712278941.git.imran@imraniqbal.org
State New
Headers show
Series gnu: Add go-1.22. | expand

Commit Message

Imran Iqbal April 5, 2024, 1:23 a.m. UTC
* gnu/packages/golang.scm (go-1.22): New variable.

Change-Id: I4e82a06592eb9148c357e6a5b5d56c1a9460e555
---
 gnu/packages/golang.scm | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)
diff mbox series

Patch

diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index 0f36c6b696..cb6c712a4d 100644
--- a/gnu/packages/golang.scm
+++ b/gnu/packages/golang.scm
@@ -45,6 +45,7 @@ 
 ;;; Copyright © 2023 Clément Lassieur <clement@lassieur.org>
 ;;; Copyright © 2024 Troy Figiel <troy@troyfigiel.com>
 ;;; Copyright © 2024 Greg Hogan <code@greghogan.com>
+;;; Copyright © 2024 Imran Iqbal <imran@imraniqbal.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -1114,6 +1115,36 @@  (define-public go-1.21
                      ("api"          "share/go/api"        ,tests)
                      ("test"         "share/go/test"       ,tests))))))))))))
 
+(define-public go-1.22
+  (package
+    (inherit go-1.21)
+    (name "go")
+    (version "1.22.2")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/golang/go")
+             (commit (string-append "go" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "0p6v5dl4mzlrma6v1a26d8zr4csq5mm10d9sdhl3kn9d22vphql1"))))
+    (native-inputs
+     ;; Go 1.22 and 1.23 requires Go 1.20 as the bootstrap toolchain.
+     ;; See 'src/cmd/dist/notgo120.go' in the source code distribution,
+     ;; Also see: https://go.dev/doc/install/source
+     ;; "Going forward, Go version 1.N will require a Go 1.M compiler, where M is N-2
+     ;; rounded down to an even number. Example: Go 1.24 and 1.25 require Go 1.22."
+     (alist-replace "go"
+                    (list go-1.20)
+                    (package-native-inputs go-1.20)))
+    (arguments
+     (substitute-keyword-arguments (package-arguments go-1.21)
+       ((#:phases phases)
+        #~(modify-phases #$phases
+            ;; Perl test script removed. See: https://github.com/golang/go/commit/ff19f8e7636f0b5797f3b65cee69f41fb650b965
+            (delete 'unpatch-perl-shebangs)))))))
+
 (define-public go go-1.17)
 
 (define make-go-std