From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Matthew Jordan" Subject: [PATCH] add go@1.6 Date: Wed, 27 Jul 2016 19:54:13 -0400 Message-ID: <87d1lyzlga.fsf@guixsd-mailerver.i-did-not-set--mail-host-address--so-tickle-me> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:49372) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bSYer-0007Eq-80 for guix-devel@gnu.org; Wed, 27 Jul 2016 19:54:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bSYem-0005ZJ-El for guix-devel@gnu.org; Wed, 27 Jul 2016 19:54:36 -0400 Received: from forward8j.cmail.yandex.net ([5.255.227.109]:45035) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bSYek-0005We-Tr for guix-devel@gnu.org; Wed, 27 Jul 2016 19:54:32 -0400 Received: from smtp11.mail.yandex.net (smtp11.mail.yandex.net [IPv6:2a02:6b8:0:801:1::10]) by forward8j.cmail.yandex.net (Yandex) with ESMTP id 6914A2142D for ; Thu, 28 Jul 2016 02:54:18 +0300 (MSK) Received: from smtp11.mail.yandex.net (localhost [127.0.0.1]) by smtp11.mail.yandex.net (Yandex) with ESMTP id 67C177E04E1 for ; Thu, 28 Jul 2016 02:54:18 +0300 (MSK) 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+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: guix-devel --=-=-= Content-Type: text/plain Good Day everyone, Attached is a patch to add go@1.6. Note that I have taken the suggestion made in go@1.5 and added it to this patch. Also I have included many of the suggested changes for go@1.4 in this patch also. Take a look and let me know if I missed anything or need to make further changes. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-gnu-Add-go-1.6.patch Content-Description: Patch to add go@1.6 >From 55066e5de6e1760833a4c1ab3d7cfccaa93bad92 Mon Sep 17 00:00:00 2001 From: Matthew Jordan Date: Thu, 26 May 2016 09:16:48 -0400 Subject: [PATCH] gnu: Add go@1.6. * gnu/packages/golang.scm (go-1.6): New variable. Co-author: Efraim Flashner Co-author: Andy Wingo --- gnu/packages/golang.scm | 165 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 165 insertions(+) diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm index cc1b66f..ad46c81 100644 --- a/gnu/packages/golang.scm +++ b/gnu/packages/golang.scm @@ -183,3 +183,168 @@ compiled, statically typed language in the tradition of C and C++, with garbage collection, various safety features and in the style of communicating sequential processes (CSP) concurrent programming features added.") (license license:bsd-3))) + +(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 + `(#:modules ((ice-9 match) + (guix build gnu-build-system) + (guix build utils)) + #:tests? #f ; Tests are run by all.bash script + #:phases + (modify-phases %standard-phases + (delete 'configure) + (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.+"))) + (net-base (assoc-ref inputs "net-base")) + (tzdata-path + (string-append (assoc-ref inputs "tzdata") "/share/zoneinfo")) + (output (assoc-ref outputs "out"))) + + ;; Removing net/ tests, which fail when attempting to access + ;; network resources not present in the build container. + (for-each + (lambda (srcfile) + (let ((srcfile (string-append "net/" srcfile))) + (delete-file srcfile))) + '("listen_test.go" "parse_test.go")) + + (substitute* "os/os_test.go" + (("/usr/bin") (getcwd)) + (("/bin/pwd") (which "pwd"))) + + ;; Add libgcc to runpath + (substitute* "cmd/link/internal/ld/lib.go" + (("!rpath.set") "true")) + (substitute* "cmd/go/build.go" + (("cgoldflags := \\[\\]string\\{\\}") + (string-append "cgoldflags := []string{" + "\"-rpath=" gcclib "\"" + "}")) + (("ldflags = setextld\\(ldflags, compiler\\)") + (string-append + "ldflags = setextld(ldflags, compiler)\n" + "ldflags = append(ldflags, \"-r\")\n" + "ldflags = append(ldflags, \"" gcclib "\")\n")) + (("\"-lgcc_s\", ") + (string-append + "\"-Wl,-rpath=" gcclib "\", \"-lgcc_s\", "))) + + ;; Disable failing tests: these tests attempt to access + ;; commands or network resources which are neither available or + ;; necessary for the build to succeed. + (map + (match-lambda + ((file regex) + (substitute* file + ((regex all before test_name) + (string-append before "Disabled" test_name))))) + '(("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 + ;; note the target script is generated at build time. + (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" (which "gcc")) + (setenv "GOOS" "linux") + (setenv "GOROOT" (dirname (getcwd))) + (setenv "GOROOT_BOOTSTRAP" go) + (setenv "GOROOT_FINAL" output) + (setenv "GOGC" "400") + (setenv "GO_TEST_TIMEOUT_SCALE" "9999") + (setenv "PATH" + (string-append + (getenv "GOROOT_FINAL") "/bin:" + (getenv "GOROOT") "/bin:" (getenv "PATH"))) + (setenv "CGO_ENABLED" "1") + (zero? (system* "sh" "all.bash"))))) + (replace 'install + (lambda* (#:key outputs #:allow-other-keys) + (let* ((output (assoc-ref outputs "out")) + (doc_out (assoc-ref outputs "doc")) + (docs (string-append doc_out "/share/doc/" ,name "-" ,version)) + (src (string-append + (assoc-ref outputs "tests") "/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")) + + (copy-recursively "../" output))))))) + (inputs + `(,@(package-inputs go-1.4))) + (native-inputs + `(("go" ,go-1.4) + ("glibc" ,glibc) + ,@(package-native-inputs go-1.4))) + (propagated-inputs + `(,@(package-propagated-inputs go-1.4))))) + +(define-public go go-1.6) -- 2.9.0 --=-=-= Content-Type: text/plain Sincerely, Matthew Jordan --=-=-=--