From patchwork Sun Dec 30 12:17:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Danny Milosavljevic X-Patchwork-Id: 600 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 52A81169D8; Sun, 30 Dec 2018 12:20:17 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mira.cbaines.net (Postfix) with ESMTP id CB425169BA for ; Sun, 30 Dec 2018 12:20:16 +0000 (GMT) Received: from localhost ([127.0.0.1]:44078 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gda4m-0006sv-DD for patchwork@mira.cbaines.net; Sun, 30 Dec 2018 07:20:16 -0500 Received: from eggs.gnu.org ([208.118.235.92]:56226) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gda4b-0006se-3d for guix-patches@gnu.org; Sun, 30 Dec 2018 07:20:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gda4X-0001wG-Vo for guix-patches@gnu.org; Sun, 30 Dec 2018 07:20:05 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:34777) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gda4X-0001w3-Sj for guix-patches@gnu.org; Sun, 30 Dec 2018 07:20:01 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gda4X-00070e-NK for guix-patches@gnu.org; Sun, 30 Dec 2018 07:20:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#33893] [PATCH v4 4/4] gnu: Add docker-cli. Resent-From: Danny Milosavljevic Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 30 Dec 2018 12:20:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33893 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 33893@debbugs.gnu.org Received: via spool by 33893-submit@debbugs.gnu.org id=B33893.154617234526857 (code B ref 33893); Sun, 30 Dec 2018 12:20:01 +0000 Received: (at 33893) by debbugs.gnu.org; 30 Dec 2018 12:19:05 +0000 Received: from localhost ([127.0.0.1]:41892 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gda3c-0006z7-N4 for submit@debbugs.gnu.org; Sun, 30 Dec 2018 07:19:04 -0500 Received: from dd26836.kasserver.com ([85.13.145.193]:58830) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gda3a-0006yU-HX for 33893@debbugs.gnu.org; Sun, 30 Dec 2018 07:19:03 -0500 Received: from dayas.3.home (77.116.200.150.wireless.dyn.drei.com [77.116.200.150]) by dd26836.kasserver.com (Postfix) with ESMTPSA id 9153833603D6; Sun, 30 Dec 2018 13:18:58 +0100 (CET) From: Danny Milosavljevic Date: Sun, 30 Dec 2018 13:17:54 +0100 Message-Id: <20181230121754.775-5-dannym@scratchpost.org> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20181230121754.775-1-dannym@scratchpost.org> References: <20181229013906.17705-1-dannym@scratchpost.org> <20181230121754.775-1-dannym@scratchpost.org> MIME-Version: 1.0 Tags: patch X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * gnu/packages/docker.scm (docker-cli): New variable. --- gnu/packages/docker.scm | 63 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) diff --git a/gnu/packages/docker.scm b/gnu/packages/docker.scm index 3b6f00834..81e79c42d 100644 --- a/gnu/packages/docker.scm +++ b/gnu/packages/docker.scm @@ -27,6 +27,7 @@ #:use-module (guix build-system go) #:use-module (guix build-system python) #:use-module (guix utils) + #:use-module (gnu packages autotools) #:use-module (gnu packages check) #:use-module (gnu packages compression) #:use-module (gnu packages golang) @@ -338,3 +339,65 @@ management, secret management, configuration management, networking, provisioning etc.") (home-page "https://mobyproject.org/") (license license:asl2.0))) + +(define-public docker-cli + (package + (name "docker-cli") + (version %docker-version) + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/docker/cli.git") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "1ivisys20kphvbqlazc3bsg7pk0ykj9gjx5d4yg439x4n13jxwvb")))) + (build-system go-build-system) + (arguments + `(#:import-path "github.com/docker/cli" + ;; TODO: Tests require a running Docker daemon. + #:tests? #f + #:phases + (modify-phases %standard-phases + (add-before 'build 'setup-environment-2 + (lambda _ + ;; Respectively, strip the symbol table and debug + ;; information, and the DWARF symbol table. + (setenv "LDFLAGS" "-s -w") + + ;; Make build reproducible. + (setenv "BUILDTIME" "1970-01-01 00:00:01.000000000+00:00") + (symlink "src/github.com/docker/cli/scripts" "./scripts") + (symlink "src/github.com/docker/cli/docker.Makefile" "./docker.Makefile") + #t)) + (replace 'build + (lambda _ + (invoke "./scripts/build/dynbinary"))) + (replace 'check + (lambda* (#:key make-flags tests? #:allow-other-keys) + (setenv "PATH" (string-append (getcwd) "/build:" (getenv "PATH"))) + (if tests? + ;; Use the newly-built docker client for the tests. + (with-directory-excursion "src/github.com/docker/cli" + ;; TODO: Run test-e2e as well? + (apply invoke "make" "-f" "docker.Makefile" "test-unit" + (or make-flags '()))) + #t))) + (replace 'install + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (out-bin (string-append out "/bin"))) + (chdir "build") + (install-file (readlink "docker") out-bin) + (install-file "docker" out-bin) + #t)))))) + (native-inputs + `(("go" ,go) + ("libltdl" ,libltdl) + ("pkg-config" ,pkg-config))) + (synopsis "Command line interface to Docker") + (description "This package provides a command line interface to Docker.") + (home-page "http://www.docker.com/") + (license license:asl2.0)))