gnu: Add go-github.com-howeyc-gopass.
[jackhill/guix/guix.git] / gnu / packages / golang.scm
index c38270a..f21149a 100644 (file)
@@ -1,12 +1,15 @@
 ;;; 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 Leo Famulari <leo@famulari.name>
+;;; 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)
@@ -62,7 +67,8 @@
     (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
                   ;; 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.+)")
     (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.3")
+    (version "1.9.3")
     (source
      (origin
        (method url-fetch)
@@ -208,7 +216,7 @@ sequential processes (CSP) concurrent programming features added.")
                            name version ".src.tar.gz"))
        (sha256
         (base32
-         "0i7gy5d8j6186a6x07cnj3r7mpfg3964q8byslx0p6x04w00lhvr"))))
+         "1bj73hrr7jjdg0w6snwkqb5y3yrlks5nrs2lgnkyy0hyx7b0lgaf"))))
     (arguments
      (substitute-keyword-arguments (package-arguments go-1.4)
        ((#:phases phases)
@@ -239,7 +247,7 @@ sequential processes (CSP) concurrent programming features added.")
                  ;; 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 "\""
@@ -254,8 +262,8 @@ sequential processes (CSP) concurrent programming features added.")
                      "\"-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)
@@ -266,6 +274,7 @@ sequential processes (CSP) concurrent programming features added.")
                     ("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.+)")
@@ -282,18 +291,7 @@ sequential processes (CSP) concurrent programming features added.")
                     ("os/exec/exec_test.go" "(.+)(TestExtraFilesRace.+)")
                     ("net/lookup_test.go" "(.+)(TestLookupPort.+)")
                     ("syscall/exec_linux_test.go"
-                     "(.+)(TestCloneNEWUSERAndRemapNoRootDisableSetgroups.+)")
-                    ;; This test broke when tzdata updated to 2016g:
-                    ;; https://github.com/golang/go/issues/17276
-
-                    ;; Applying the upstream patch causes the failure of another
-                    ;; test, because that test requires upstream's mtimes to be
-                    ;; preserved, but applying the patch and re-packing the
-                    ;; tarball causes mtimes to be set to Unix epoch.
-                    ;; https://github.com/golang/go/issues/17535
-
-                    ;; TODO Try re-enabling this test for Go > 1.7.3.
-                    ("time/time_test.go" "(.+)(TestLoadFixed.+)")))
+                     "(.+)(TestCloneNEWUSERAndRemapNoRootDisableSetgroups.+)")))
 
                  (substitute* "../misc/cgo/testsanitizers/test.bash"
                    (("(CC=)cc" all var) (string-append var "gcc")))
@@ -309,8 +307,8 @@ sequential processes (CSP) concurrent programming features added.")
                    (("/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)
@@ -371,6 +369,80 @@ sequential processes (CSP) concurrent programming features added.")
                  (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))))