unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
blob 6f281cfc3bd444533a157fcd5491e9fdcc29dd23 5098 bytes (raw)
name: gnu/packages/golang.scm 	 # note: path name is non-authoritative(*)

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
 
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2015 Efraim Flashner <efraim@flashner.co.il>
;;;
;;; This file is part of GNU Guix.
;;;
;;; GNU Guix is free software; you can redistribute it and/or modify it
;;; under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 3 of the License, or (at
;;; your option) any later version.
;;;
;;; GNU Guix is distributed in the hope that it will be useful, but
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.

(define-module (gnu packages golang)
  #:use-module ((guix licenses) #:prefix license:)
  #:use-module (guix utils)
  #:use-module (guix download)
  #:use-module (guix packages)
  #:use-module (guix build-system gnu)
  #:use-module (gnu packages gcc)
  #:use-module (gnu packages perl))

;; According to https://golang.org/doc/install/gccgo, gccgo-4.8.2 includes a
;; complete go-1.1.2 implementation, gccgo-4.9 includes a complete go-1.2
;; implementation, and gccgo-5 a complete implementation of go-1.4.  Ultimately
;; we hope to build go-1.5 with a bootstrap process using gccgo-5.  As of
;; go-1.5, go cannot be bootstrapped without go-1.4, so we need to use go-1.4 or
;; gccgo-5.  Mips is not officially supported, but it should work if it is
;; bootstrapped.

(define-public go-1.4
  (package
    (name "go")
    (version "1.4.3")
    (source
      (origin
        (method url-fetch)
        (uri (string-append "https://storage.googleapis.com/golang/go"
                            version ".src.tar.gz"))
        (sha256
         (base32
          "0na9yqilzpvq0bjndbibfp07wr796gf252y471cip10bbdqgqiwr"))))
    (build-system gnu-build-system)
    (outputs '("out" "doc" "tests"))
    (arguments
     `(#:phases
       (modify-phases %standard-phases
        (delete 'configure)
        (add-after 'patch-generated-file-shebangs 'chdir
          (lambda _ (chdir "src")))
        (replace 'build
          (let* ((bash   (assoc-ref %build-inputs "bash"))
                 (gccgo  (assoc-ref %build-inputs "gccgo"))
                 (output (assoc-ref %outputs "out")))
            (setenv "CC" "gcc")
            (setenv "GOROOT" (getcwd))
            (setenv "GOROOT_BOOTSTRAP" gccgo)
            (setenv "GOROOT_FINAL" output)
            (setenv "CGO_ENABLED" "0")
            (lambda _
              ;; all.bash includes the tests, which fail because they require
              ;; network access, and access to /bin
              (zero? (system* (string-append bash "/bin/bash") "make.bash")))))
        (replace 'install
          (lambda* (#:key outputs #:allow-other-keys)
            (let* ((output (assoc-ref outputs "out"))
                   (docs   (assoc-ref outputs "doc"))
                   (tests  (assoc-ref outputs "tests")))
              (copy-recursively "../test" tests)
              (delete-file-recursively "../test")
              (copy-recursively "../api" (string-append docs "/api"))
              (delete-file-recursively "../api")
              (copy-recursively "../doc" (string-append docs "/doc"))
              (delete-file-recursively "../doc")
              (copy-recursively "../" output)))))
       #:tests? #f))
    (native-inputs
     `(("gccgo" ,gccgo-4.9)
       ("perl" ,perl)))
    (home-page "https://golang.org/")
    (synopsis "Compiled, statically typed language developed by Google")
    (description "Go, also commonly referred to as golang, is a programming
 language developed at Google.  Designed primarily for systems programming, it
 is a compiled, statically typed language in the tradition of C and C++, with
garbage collection, various safety features and CSP-style concurrent programming
features added.")
    (license license:bsd-3)))

(define-public go-1.5
  (package (inherit go-1.4)
    (version "1.5.2")
    (source
      (origin
        (method url-fetch)
        (uri (string-append "https://storage.googleapis.com/golang/go"
                            version ".src.tar.gz"))
        (sha256
         (base32
          "0x3sk32ym93hnc0yk6bnra226f92qvixia6kwcf68q84q0jddpgk"))))
    (arguments
     (substitute-keyword-arguments (package-arguments go-1.4)
       ((#:phases phases)
        `(modify-phases ,phases
         (replace 'build
          (let* ((bash   (assoc-ref %build-inputs "bash"))
                 (go14   (assoc-ref %build-inputs "go-1.4"))
                 (output (assoc-ref %outputs "out")))
            (setenv "CC" "gcc")
            (setenv "GOPATH" (string-append (getcwd) "/go"))
            (setenv "GOROOT_BOOTSTRAP" go14)
            (setenv "GOROOT_FINAL" output)
            (lambda _
              (zero?
                (system* (string-append bash "/bin/bash") "make.bash")))))))))
    (native-inputs
     `(("go-1.4" ,go-1.4)
       ("perl" ,perl)))))

(define-public go go-1.5)

debug log:

solving 6f281cf ...
found 6f281cf in https://yhetil.org/guix-devel/1452616298-6255-4-git-send-email-efraim@flashner.co.il/
found cb1cbc1 in https://yhetil.org/guix-devel/1452616298-6255-3-git-send-email-efraim@flashner.co.il/

applying [1/2] https://yhetil.org/guix-devel/1452616298-6255-3-git-send-email-efraim@flashner.co.il/
diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
new file mode 100644
index 0000000..cb1cbc1


applying [2/2] https://yhetil.org/guix-devel/1452616298-6255-4-git-send-email-efraim@flashner.co.il/
diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index cb1cbc1..6f281cf 100644

Checking patch gnu/packages/golang.scm...
Applied patch gnu/packages/golang.scm cleanly.
Checking patch gnu/packages/golang.scm...
Applied patch gnu/packages/golang.scm cleanly.

index at:
100644 6f281cfc3bd444533a157fcd5491e9fdcc29dd23	gnu/packages/golang.scm

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).