From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: [Patch] go@1.4 Updated patch Date: Sun, 12 Jun 2016 21:22:22 +0200 Message-ID: <877fdukya9.fsf@gnu.org> References: <87fusuh52h.fsf@mailerver.i-did-not-set--mail-host-address--so-tickle-me> <1464968435.2613720.627094929.3FEBB927@webmail.messagingengine.com> <87d1nygoiq.fsf@mailerver.i-did-not-set--mail-host-address--so-tickle-me> <871t4a7mkr.fsf@igalia.com> <8737omgukj.fsf@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]:56108) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bCAxr-0006nj-Tf for guix-devel@gnu.org; Sun, 12 Jun 2016 15:22:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bCAxn-0004LA-Ls for guix-devel@gnu.org; Sun, 12 Jun 2016 15:22:30 -0400 In-Reply-To: <8737omgukj.fsf@mailerver.i-did-not-set--mail-host-address--so-tickle-me> (Matthew Jordan's message of "Thu, 09 Jun 2016 13:07:08 -0400") 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: Matthew Jordan Cc: guix-devel@gnu.org --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi! It seems we=E2=80=99re almost done! I was about to commit it with the chan= ges below on top of the patch you posted (they are mostly cosmetic.) Since there are parts I don=E2=80=99t fully understand, I thought I=E2=80= =99d leave it up to you. In particular, could you could at least replace the =E2=80=9Cwh= y=E2=80=9D in the comments below with explanations of why this is done? Also, why do we need this =E2=80=9Csrc=E2=80=9D output? IIUC, it contains = the source of some of the unit tests, right? Thank you for persevering in spite of all the nitpicks! :-) Ludo=E2=80=99. --=-=-= Content-Type: text/x-patch; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm index 5652bbd..dbb8283 100644 --- a/gnu/packages/golang.scm +++ b/gnu/packages/golang.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright =C2=A9 2015, 2016 Efraim Flashner +;;; Copyright =C2=A9 2016 Efraim Flashner ;;; Copyright =C2=A9 2016 Matthew Jordan ;;; Copyright =C2=A9 2016 Andy Wingo ;;; @@ -23,11 +23,10 @@ #:use-module (guix utils) #:use-module (guix download) #:use-module (guix packages) - #:use-module (guix build utils) #:use-module (guix build-system gnu) #:use-module (gnu packages admin) #:use-module (gnu packages gcc) - #:use-module ((gnu packages base) #:prefix system:) + #:use-module (gnu packages base) #:use-module (gnu packages perl) #:use-module (gnu packages pkg-config) #:use-module (gnu packages pcre) @@ -46,18 +45,17 @@ (package (name "go") (version "1.4.3") - (source - (origin - (method url-fetch) - (uri (string-append "https://storage.googleapis.com/golang/" - name version ".src.tar.gz")) - (sha256 - (base32 - "0na9yqilzpvq0bjndbibfp07wr796gf252y471cip10bbdqgqiwr")))) + (source (origin + (method url-fetch) + (uri (string-append "https://storage.googleapis.com/golang/" + name version ".src.tar.gz")) + (sha256 + (base32 + "0na9yqilzpvq0bjndbibfp07wr796gf252y471cip10bbdqgqiwr")))) (build-system gnu-build-system) (outputs '("out" "doc" - "src")) + "src")) ;What's this? (arguments `(#:modules ((ice-9 match) (guix build gnu-build-system) @@ -68,30 +66,27 @@ (delete 'configure) (add-after 'patch-generated-file-shebangs 'chdir (lambda _ (chdir "src"))) - (add-before 'build 'prebuild + (add-before 'build 'pre-build (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")) + (let* ((gcclib (string-append (assoc-ref inputs "gcc:lib") + "/lib")) + (ld (string-append (assoc-ref inputs "libc") "/lib")) (loader (car (find-files ld "^ld-linux.+"))) (net-base (assoc-ref inputs "net-base")) (tzdata-path (string-append (assoc-ref inputs "tzdata") "/share/zo= neinfo")) (output (assoc-ref outputs "out"))) =20 - ;; Removing net/ tests - (for-each - (lambda (srcfile) - (let ((srcfile (string-append "net/" srcfile))) - (delete-file srcfile))) - '("multicast_test.go" "parse_test.go" "port_test.go")) + ;; Remove net/ tests. Why? + (for-each delete-file + '("net/multicast_test.go" "net/parse_test.go" + "net/port_test.go")) =20 - ;; Add libgcc to runpath + ;; Add libgcc to the RUNPATH. (substitute* "cmd/go/build.go" (("cgoldflags :=3D \\[\\]string\\{\\}") (string-append "cgoldflags :=3D []string{" - "\"-rpath=3D" gcclib "\"" - "}")) + "\"-rpath=3D" gcclib "\"" "}")) (("ldflags :=3D buildLdflags") (string-append "ldflags :=3D buildLdflags\n" @@ -102,8 +97,8 @@ (("/usr/bin") (getcwd)) (("/bin/pwd") (which "pwd"))) =20 - ;; Disable failing tests - (map + ;; Disable failing tests. (XXX: Why?) + (for-each (match-lambda ((file regex) (substitute* file @@ -127,9 +122,9 @@ (("/etc/protocols") (string-append net-base "/etc/protoco= ls"))) (substitute* "time/zoneinfo_unix.go" (("/usr/share/zoneinfo/") tzdata-path)) - (substitute* - (find-files "cmd" "asm.c") - (("/lib/ld-linux.*\\.so\\.[0-9]") loader))))) + (substitute* (find-files "cmd" "asm.c") + (("/lib/ld-linux.*\\.so\\.[0-9]") loader)) + #t))) =20 (replace 'build (lambda* (#:key inputs outputs #:allow-other-keys) @@ -144,11 +139,12 @@ (replace 'install (lambda* (#:key outputs inputs #:allow-other-keys) (let* ((output (assoc-ref outputs "out")) - (doc_out (assoc-ref outputs "doc")) + (doc-out (assoc-ref outputs "doc")) (bash (string-append (assoc-ref inputs "bash") "bin/ba= sh")) - (docs (string-append doc_out "/share/doc/" ,name "-" ,= version)) + (docs (string-append doc-out "/share/doc/" ,name "-" ,= version)) (src (string-append - (assoc-ref outputs "src") "/share/" ,name "-" = ,version))) + (assoc-ref outputs "src") "/share/" + ,name "-" ,version))) (mkdir-p src) (copy-recursively "../test" (string-append src "/test")) (delete-file-recursively "../test") @@ -158,27 +154,24 @@ (copy-recursively "../doc" (string-append docs "/doc")) (delete-file-recursively "../doc") =20 - (for-each - (lambda (file) - (let* ((filein (string-append "../" file)) - (fileout (string-append docs "/" file))) - (copy-file filein fileout) - (delete-file filein))) - '("README" "CONTRIBUTORS" "AUTHORS" "PATENTS" - "LICENSE" "VERSION" "robots.txt")) - (copy-recursively "../" output))))))) + (for-each (lambda (file) + (let ((file (string-append "../" file))) + (install-file file docs) + (delete-file file))) + '("README" "CONTRIBUTORS" "AUTHORS" "PATENTS" + "LICENSE" "VERSION" "robots.txt")) + (copy-recursively "../" output) + #t)))))) (inputs - `(("tzdata" ,system:tzdata) - ("pcre" ,pcre))) + `(("tzdata" ,tzdata) + ("pcre" ,pcre) + ("gcc:lib" ,gcc "lib"))) (native-inputs `(("pkg-config" ,%pkg-config) - ("which" ,system:which) - ("gcc:out" ,gcc-4.9 "out") + ("which" ,which) ("net-base" ,net-base) ("perl" ,perl))) - (propagated-inputs - `(("gcc:lib" ,gcc-4.9 "lib") - ("glibc" ,system:glibc))) + (home-page "https://golang.org/") (synopsis "Compiled, statically typed language developed by Google") (description "Go, also commonly referred to as golang, is a programming --=-=-=--