From patchwork Sat May 28 19:44:33 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Jordan X-Patchwork-Id: 12592 Received: (qmail 74810 invoked by uid 89); 28 May 2016 19:46:02 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Checked: by ClamAV 0.99.1 on sourceware.org X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.3 required=5.0 tests=BAYES_00, FREEMAIL_FROM, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.2 spammy= X-Spam-Status: No, score=-3.3 required=5.0 tests=BAYES_00, FREEMAIL_FROM, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on sourceware.org X-Spam-Level: X-HELO: lists.gnu.org Received: from lists.gnu.org (HELO lists.gnu.org) (208.118.235.17) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Sat, 28 May 2016 19:45:51 +0000 Received: from localhost ([::1]:54073 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b6kBB-0006iM-Le for patchwork@sourceware.org; Sat, 28 May 2016 15:45:49 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35032) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b6kB6-0006hy-1u for guix-devel@gnu.org; Sat, 28 May 2016 15:45:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b6kB1-0001uv-Oi for guix-devel@gnu.org; Sat, 28 May 2016 15:45:42 -0400 Received: from forward10o.cmail.yandex.net ([37.9.109.60]:52546) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b6kB0-0001tY-44 for guix-devel@gnu.org; Sat, 28 May 2016 15:45:39 -0400 Received: from smtp3o.mail.yandex.net (smtp3o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::27]) by forward10o.cmail.yandex.net (Yandex) with ESMTP id B00892153A for ; Sat, 28 May 2016 22:45:30 +0300 (MSK) Received: from smtp3o.mail.yandex.net (localhost [127.0.0.1]) by smtp3o.mail.yandex.net (Yandex) with ESMTP id 883261E0192 for ; Sat, 28 May 2016 22:45:30 +0300 (MSK) Received: by smtp3o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id 2XI92l2QHN-jSH4Uw5k; Sat, 28 May 2016 22:45:28 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client certificate not present) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.com; s=mail; t=1464464730; bh=POFqxulpFpe+TeNW9BoAPVXiLPQN3Bfd+vPlIGO0zWM=; h=User-agent:From:To:Subject:Date:Message-ID:MIME-Version: Content-Type; b=PiiS9FF12rV40u+e2Gqd2DxXCuMWYC4HZY42Hpik+gwlPZDv57OS3rilOHl7kHG6T 7OSNo6/prJOaPKI9GzNq0PVzn+Txso8MDRzfC2j+GMarxx7l4C3hV/cjIPq1S5beTH 3B44oOttT+C8KF3ghR4eKma/arlNQh+1Rx6BFiTY= Authentication-Results: smtp3o.mail.yandex.net; dkim=pass header.i=@yandex.com X-Yandex-Suid-Status: 1 0 User-agent: mu4e 0.9.13; emacs 24.5.1 From: Matthew Jordan To: guix-devel Subject: [Patch] go@1.6 Date: Sat, 28 May 2016 15:44:33 -0400 Message-ID: <87zirax90e.fsf@mailerver.i-did-not-set--mail-host-address--so-tickle-me> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 37.9.109.60 X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+patchwork=sourceware.org@gnu.org Sender: "Guix-devel" Go compiler version 1.6 dependant on "[Patch] go@1.4". Sincerely, From b2721bee32bd245510cdc54fcce724c4bed73bfb Mon Sep 17 00:00:00 2001 From: Matthew Jordan 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