;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
+;;; Copyright © 2016, 2017 Efraim Flashner <efraim@flashner.co.il>
;;; Copyright © 2016 Matthew Jordan <matthewjordandevops@yandex.com>
;;; Copyright © 2016 Andy Wingo <wingo@igalia.com>
;;; Copyright © 2016 Ludovic Courtès <ludo@gnu.org>
-;;; Copyright © 2016 Petter <petter@mykolab.ch>
+;;; Copyright © 2016, 2017 Petter <petter@mykolab.ch>
+;;; Copyright © 2016, 2017 Leo Famulari <leo@famulari.name>
+;;; Copyright © 2017 Sergei Trofimovich <slyfox@inbox.ru>
+;;; Copyright © 2017 Alex Vong <alexvong1995@gmail.com>
+;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
;;;
-;;; This file is an addendum GNU Guix.
+;;; 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
#:use-module ((guix licenses) #:prefix license:)
#:use-module (guix utils)
#:use-module (guix download)
+ #:use-module (guix git-download)
#:use-module (guix packages)
#:use-module (guix build-system gnu)
+ #:use-module (guix build-system go)
#:use-module (gnu packages admin)
#:use-module (gnu packages gcc)
#:use-module (gnu packages base)
(arguments
`(#:modules ((ice-9 match)
(guix build gnu-build-system)
- (guix build utils))
+ (guix build utils)
+ (srfi srfi-1))
#:tests? #f ; Tests are run by the all.bash script.
#:phases
(modify-phases %standard-phases
("net/dial_test.go" "(.+)(TestDialTimeout.+)")
("os/os_test.go" "(.+)(TestHostname.+)")
("time/format_test.go" "(.+)(TestParseInSydney.+)")
+
+ ;; Tzdata 2016g changed the name of the time zone used in this
+ ;; test, and the patch for Go 1.7 does not work for 1.4.3:
+ ;; https://github.com/golang/go/issues/17545
+ ;; https://github.com/golang/go/issues/17276
+ ("time/time_test.go" "(.+)(TestLoadFixed.+)")
+ ("time/format_test.go" "(.+)(TestParseInLocation.+)")
+
("os/exec/exec_test.go" "(.+)(TestEcho.+)")
("os/exec/exec_test.go" "(.+)(TestCommandRelativeName.+)")
("os/exec/exec_test.go" "(.+)(TestCatStdin.+)")
(setenv "GOOS" "linux")
(setenv "GOROOT" (dirname (getcwd)))
(setenv "GOROOT_FINAL" output)
- (setenv "CGO_ENABLED" "1")
+ ;; Go 1.4's cgo will not work with binutils >= 2.27:
+ ;; https://github.com/golang/go/issues/16906
+ (setenv "CGO_ENABLED" "0")
(zero? (system* "sh" "all.bash")))))
(replace 'install
(home-page "https://golang.org/")
(synopsis "Compiler and libraries for Go, a statically-typed language")
(description "Go, also commonly referred to as golang, is an imperative
-programming language. 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 in the style of communicating
-sequential processes (CSP) concurrent programming features added.")
+programming language designed primarily for systems programming. Go is a
+compiled, statically typed language in the tradition of C and C++, but adds
+garbage collection, various safety features, and concurrent programming features
+in the style of communicating sequential processes (@dfn{CSP}).")
+ (supported-systems '("x86_64-linux" "i686-linux" "armhf-linux"))
(license license:bsd-3)))
-(define-public go-1.7
+(define-public go-1.9
(package
(inherit go-1.4)
(name "go")
- (version "1.7")
+ (version "1.9.3")
(source
(origin
(method url-fetch)
name version ".src.tar.gz"))
(sha256
(base32
- "1h712yd5wk5mrj2dixc9z2xlgksfks00yvglrkrgr488p8b0qs3j"))))
+ "1bj73hrr7jjdg0w6snwkqb5y3yrlks5nrs2lgnkyy0hyx7b0lgaf"))))
(arguments
(substitute-keyword-arguments (package-arguments go-1.4)
((#:phases phases)
;; Add libgcc to runpath
(substitute* "cmd/link/internal/ld/lib.go"
(("!rpath.set") "true"))
- (substitute* "cmd/go/build.go"
+ (substitute* "cmd/go/internal/work/build.go"
(("cgoldflags := \\[\\]string\\{\\}")
(string-append "cgoldflags := []string{"
"\"-rpath=" gcclib "\""
"\"-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.
+ ;; commands or network resources which are neither available
+ ;; nor necessary for the build to succeed.
(for-each
(match-lambda
((file regex)
("net/dial_test.go" "(.+)(TestDialTimeout.+)")
("os/os_test.go" "(.+)(TestHostname.+)")
("time/format_test.go" "(.+)(TestParseInSydney.+)")
+ ("time/format_test.go" "(.+)(TestParseInLocation.+)")
("os/exec/exec_test.go" "(.+)(TestEcho.+)")
("os/exec/exec_test.go" "(.+)(TestCommandRelativeName.+)")
("os/exec/exec_test.go" "(.+)(TestCatStdin.+)")
(("/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))
+ (substitute* (find-files "cmd" "\\.go")
+ (("/lib(64)?/ld-linux.*\\.so\\.[0-9]") loader))
#t)))
(add-before 'build 'set-bootstrap-variables
(lambda* (#:key outputs inputs #:allow-other-keys)
(setenv "GOGC" "400")
(setenv "GO_TEST_TIMEOUT_SCALE" "9999")
#t)))
+
+ (replace 'build
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ ;; FIXME: Some of the .a files are not bit-reproducible.
+ (let* ((output (assoc-ref outputs "out")))
+ (setenv "CC" (which "gcc"))
+ (setenv "GOOS" "linux")
+ (setenv "GOROOT" (dirname (getcwd)))
+ (setenv "GOROOT_FINAL" output)
+ (setenv "CGO_ENABLED" "1")
+ (zero? (system* "sh" "all.bash")))))
+
(replace 'install
;; TODO: Most of this could be factorized with Go 1.4.
(lambda* (#:key outputs #:allow-other-keys)
(copy-recursively "../" output))))))))
(native-inputs
`(("go" ,go-1.4)
- ,@(package-native-inputs go-1.4)))))
+ ,@(package-native-inputs go-1.4)))
+ (supported-systems %supported-systems)))
+
+(define-public go go-1.9)
+
+(define-public go-github-com-alsm-ioprogress
+ (let ((commit "063c3725f436e7fba0c8f588547bee21ffec7ac5")
+ (revision "0"))
+ (package
+ (name "go-github-com-alsm-ioprogress")
+ (version (git-version "0.0.0" revision commit))
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/alsm/ioprogress.git")
+ (commit commit)))
+ (sha256
+ (base32
+ "10ym5qlq77nynmkxbk767f2hfwyxg2k7hrzph05hvgzv833dhivh"))))
+ (build-system go-build-system)
+ (arguments
+ '(#:import-path "github.com/alsm/ioprogress"))
+ (synopsis "Textual progress bars in Go")
+ (description "@code{ioprogress} is a Go library with implementations of
+@code{io.Reader} and @code{io.Writer} that draws progress bars. The primary use
+case for these are for command-line applications but alternate progress bar
+writers can be supplied for alternate environments.")
+ (home-page "https://github.com/alsm/ioprogress")
+ (license license:expat))))
+
+(define-public go-github-com-aki237-nscjar
+ (let ((commit "e2df936ddd6050d30dd90c7214c02b5019c42f06")
+ (revision "0"))
+ (package
+ (name "go-github-com-aki237-nscjar")
+ (version (git-version "0.0.0" revision commit))
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/aki237/nscjar.git")
+ (commit commit)))
+ (sha256
+ (base32
+ "03y7zzq12qvhsq86lb06sgns8xrkblbn7i7wd886wk3zr5574b96"))))
+ (build-system go-build-system)
+ (arguments
+ '(#:import-path "github.com/aki237/nscjar"))
+ (synopsis "Handle Netscape / Mozilla cookies")
+ (description "@code{nscjar} is a Go library used to parse and output
+Netscape/Mozilla's old-style cookie files. It also implements a simple cookie
+jar struct to manage the cookies added to the cookie jar.")
+ (home-page "https://github.com/aki237/nscjar")
+ (license license:expat))))
-(define-public go go-1.7)
+(define-public go-github-com-davidjpeacock-cli
+ (let ((commit "8ba6f23b6e36d03666a14bd9421f5e3efcb59aca")
+ (revision "0"))
+ (package
+ (name "go-github-com-davidjpeacock-cli")
+ (version (git-version "1.19.1" revision commit))
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/davidjpeacock/cli.git")
+ (commit commit)))
+ (sha256
+ (base32
+ "01s53ny3p0fdx64rnwcnmjj4xpc5adihnh6islsfq5z1ph2phhnj"))))
+ (build-system go-build-system)
+ (arguments
+ '(#:import-path "github.com/davidjpeacock/cli"))
+ (synopsis "Build command-line interfaces in Go")
+ (description "@code{cli} is a package for building command line
+interfaces in Go. The goal is to enable developers to write fast and
+distributable command line applications in an expressive way.")
+ (home-page "https://github.com/davidjpeacock/cli")
+ (license license:expat))))