all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Matthew Jordan <matthewjordandevops@yandex.com>
To: guix-devel <guix-devel@gnu.org>
Subject: [Patch] go@1.6
Date: Sat, 28 May 2016 15:44:33 -0400	[thread overview]
Message-ID: <87zirax90e.fsf@mailerver.i-did-not-set--mail-host-address--so-tickle-me> (raw)

[-- Attachment #1: Type: text/plain, Size: 56 bytes --]

Go compiler version 1.6 dependant on "[Patch] go@1.4".


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Adding go@1.6 compiler. --]
[-- Type: text/x-patch, Size: 7965 bytes --]

From b2721bee32bd245510cdc54fcce724c4bed73bfb Mon Sep 17 00:00:00 2001
From: Matthew Jordan <matthewjordandevops@yandex.com>
Date: Thu, 26 May 2016 09:16:48 -0400
Subject: [PATCH 3/3] Add go@1.6.

* gnu/packages/golang.scm: Modified file.
---
 gnu/packages/golang.scm | 146 ++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 146 insertions(+)

diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index 241bfdb..a31e56f 100644
--- a/gnu/packages/golang.scm
+++ b/gnu/packages/golang.scm
@@ -312,3 +312,149 @@ sequential processes (CSP) concurrent programming features added.")
        ,@(alist-delete "gccgo" (package-native-inputs go-1.4))))
     (propagated-inputs
      `(,@(package-propagated-inputs go-1.4)))))
+
+(define-public go-1.6
+  (package
+    (inherit go-1.4)
+    (name "go")
+    (version "1.6.2")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append "https://storage.googleapis.com/golang/"
+                           name version ".src.tar.gz"))
+       (sha256
+        (base32
+         "1k5wy5ijll5aacj1m6xxnjfjw6x9f255ml3f1jiicw031mshnyvq"))))
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (delete 'configure)
+         (delete 'validate-runpath)
+         (add-after 'patch-generated-file-shebangs 'chdir
+           (lambda _ (chdir "src")))
+         (add-before 'build 'prebuild
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (let* ((gcclib (string-append (assoc-ref inputs "gcc:lib") "/lib"))
+                    (ld (string-append
+                         (assoc-ref inputs "glibc") "/lib"))
+                    (loader (car (find-files ld "^ld-linux.+")))
+                    (libgcc (string-append (assoc-ref inputs "gcc:lib") "/lib"))
+                    (net-base (assoc-ref inputs "net-base"))
+                    (tzdata-path
+                     (string-append (assoc-ref inputs "tzdata") "/share/zoneinfo"))
+                    (output (assoc-ref outputs "out")))
+               (for-each
+                (lambda (srcfile)
+                  (let ((srcfile (string-append "net/" srcfile)))
+                    (if (file-exists? srcfile)
+                        (delete-file srcfile))))
+                '("listen_test.go" "parse_test.go"))
+               (substitute* "os/os_test.go"
+                 (("/usr/bin") (getcwd))
+                 (("/bin/pwd") (which "pwd")))
+               ;; Disable failing tests
+               (for-each
+                (lambda (srcfile)
+                  (substitute* (car srcfile)
+                    (((cdr srcfile) all) (string-append all "return\n"))))
+                (list
+                 '("net/net_test.go" . ".+TestShutdownUnix.+")
+                 '("net/dial_test.go" . ".+TestDialTimeout.+")
+                 '("os/os_test.go" . ".+TestHostname.+")
+                 '("time/format_test.go" . ".+TestParseInSydney.+")
+                 '("os/exec/exec_test.go" . ".+TestEcho.+")
+                 '("os/exec/exec_test.go" . ".+TestCommandRelativeName.+")
+                 '("os/exec/exec_test.go" . ".+TestCatStdin.+")
+                 '("os/exec/exec_test.go" . ".+TestCatGoodAndBadFile.+")
+                 '("os/exec/exec_test.go" . ".+TestExitStatus.+")
+                 '("os/exec/exec_test.go" . ".+TestPipes.+")
+                 '("os/exec/exec_test.go" . ".+TestStdinClose.+")
+                 '("os/exec/exec_test.go" . ".+TestIgnorePipeErrorOnSuccess.+")
+                 '("syscall/syscall_unix_test.go" . ".+TestPassFD\\(.+")
+                 '("os/exec/exec_test.go" . ".+TestExtraFiles/areturn.+")
+                 '("cmd/go/go_test.go" . ".+TestCoverageWithCgo.+")
+                 '("os/exec/exec_test.go" . ".+TestOutputStderrCapture.+")
+                 '("os/exec/exec_test.go" . ".+TestExtraFiles.+")
+                 '("os/exec/exec_test.go" . ".+TestExtraFilesRace.+")
+                 '("net/lookup_test.go" . ".+TestLookupPort.+")
+                 '("syscall/exec_linux_test.go" .
+                   ".+TestCloneNEWUSERAndRemapNoRootDisableSetgroups.+")))
+
+               (substitute* "../misc/cgo/testsanitizers/test.bash"
+                 (("(CC=)cc" all var) (string-append var "gcc")))
+               ;; fix shebang for testar script
+               (substitute* "../misc/cgo/testcarchive/test.bash"
+                 (("#!/usr/bin/env") (string-append "#!" (which "env"))))
+               (substitute* "net/lookup_unix.go"
+                 (("/etc/protocols") (string-append net-base "/etc/protocols")))
+               (substitute* "net/port_unix.go"
+                 (("/etc/services") (string-append net-base "/etc/services")))
+               (substitute* "time/zoneinfo_unix.go"
+                 (("/usr/share/zoneinfo/") tzdata-path))
+               (substitute*
+                   (find-files "cmd" "asm.c")
+                 (("/lib/ld-linux.*\\.so\\.[0-9]") loader)))))
+         (replace 'build
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (let* ((go  (assoc-ref inputs "go"))
+                    (output (assoc-ref outputs "out")))
+               (setenv "CC" "gcc")
+               (setenv "GOOS" "linux")
+               (setenv "GOROOT" (dirname (getcwd)))
+               (setenv "GOROOT_BOOTSTRAP" go)
+               (setenv "GOROOT_FINAL" output)
+               (setenv "GOGC" "400")
+               (setenv "LD_LIBRARY_PATH" (getenv "LIBRARY_PATH"))
+               (setenv "PATH"
+                       (string-append
+                        (getenv "GOROOT_FINAL") "/bin:"
+                        (getenv "GOROOT") "/bin:" (getenv "PATH")))
+               (setenv "CGO_ENABLED" "1")
+               (zero? (system* "sh" "make.bash")))))
+         (replace 'install
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (let* ((output (assoc-ref outputs "out"))
+                    (doc_out (assoc-ref outputs "doc"))
+                    (bash (string-append (assoc-ref inputs "bash") "bin/bash"))
+                    (docs (string-append doc_out "/share/doc/" ,name "-" ,version))
+                    (src (string-append
+                          (assoc-ref outputs "src") "/share/" ,name "-" ,version)))
+               (mkdir-p src)
+               (copy-recursively "../test" (string-append src "/test"))
+               (delete-file-recursively "../test")
+               (mkdir-p docs)
+               (copy-recursively "../api" (string-append docs "/api"))
+               (delete-file-recursively "../api")
+               (copy-recursively "../doc" (string-append docs "/doc"))
+               (delete-file-recursively "../doc")
+
+               (for-each
+                (lambda (file)
+                  (let* ((filein (string-append "../" file))
+                         (fileout (string-append docs "/" file)))
+                  (copy-file filein fileout)
+                  (delete-file filein)))
+                '("README.md" "CONTRIBUTORS" "AUTHORS" "PATENTS"
+                  "LICENSE" "VERSION" "CONTRIBUTING.md" "robots.txt"))
+               (rename-file "../bin/go" (string-append "../bin/go-" ,version))
+
+               ;; Create a wrapper script for go command
+               (call-with-output-file (string-append "../bin/go")
+                 (lambda (port)
+                   (format port (string-append "#!" bash "\n"))
+                   (format port "\nexport LD_LIBRARY_PATH=$LIBRARY_PATH\n")
+                   (format port (string-append "go-" ,version " $@"))
+                   (chmod port #o555)))
+
+               (copy-recursively "../" output)))))
+       #:tests? #f))
+    (inputs
+     `(,@(package-inputs go-1.4)))
+    (native-inputs
+     `(("go" ,go-1.4)
+       ,@(alist-delete "gccgo" (package-native-inputs go-1.4))))
+    (propagated-inputs
+     `(,@(package-propagated-inputs go-1.4)))))
+
+(define-public go go-1.6)
-- 
2.8.3


[-- Attachment #3: Type: text/plain, Size: 50 bytes --]


Sincerely,

-- 
Matthew Jordan
Sent with my mu4e

                 reply	other threads:[~2016-05-28 19:45 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87zirax90e.fsf@mailerver.i-did-not-set--mail-host-address--so-tickle-me \
    --to=matthewjordandevops@yandex.com \
    --cc=guix-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.