From patchwork Sat Dec 30 10:02:06 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Angelo Compagnucci X-Patchwork-Id: 854082 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.136; helo=silver.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=amarulasolutions-com.20150623.gappssmtp.com header.i=@amarulasolutions-com.20150623.gappssmtp.com header.b="ExOalFNy"; dkim-atps=neutral Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3z7zXR2zKkz9s7g for ; Sat, 30 Dec 2017 21:02:31 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id CBE9522FEE; Sat, 30 Dec 2017 10:02:28 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id hZbbJMrrlVgT; Sat, 30 Dec 2017 10:02:27 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id A22C426DCB; Sat, 30 Dec 2017 10:02:27 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id A43661C0B30 for ; Sat, 30 Dec 2017 10:02:23 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 9FEF42ED7A for ; Sat, 30 Dec 2017 10:02:23 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id aXQT7NXN+yJl for ; Sat, 30 Dec 2017 10:02:22 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wr0-f175.google.com (mail-wr0-f175.google.com [209.85.128.175]) by silver.osuosl.org (Postfix) with ESMTPS id E743B22FEE for ; Sat, 30 Dec 2017 10:02:21 +0000 (UTC) Received: by mail-wr0-f175.google.com with SMTP id w107so17492507wrb.9 for ; Sat, 30 Dec 2017 02:02:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=JiDWU4hqgkQEdtgCcGbFGEZ1Erzwfzx1tRydv/8hMGs=; b=ExOalFNy7UT66O3fSEU0+zN2RVg45z2NzFjAkN2thttSXhq9zOrnCUan2MWFr8Fd7Q i14FhhcqFpe7XQUMu7zQdHZ2a3WJ2s5OeloqsjdSgBw0Y5Y1Bq+qAsdQrjf/STMljgum 7/v+n2hrzxKCDdqibgaFo+w4rTDeAdgMO0DtOiU6yDIMQVZQ46ORTfuumqzNuCsaic2O RAfvxNZ2LuQRYjkFYRkt2axRxMV915GuLZdopznUA1pp2wkWaayJgni/mY2aoARUNrfq q8JEGGHFqbxErmpoOOVuYc1QJYjb1vd+AQKFooYu46CI4AiZrBCoJFBRnLXt6hkT2RYm IbnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=JiDWU4hqgkQEdtgCcGbFGEZ1Erzwfzx1tRydv/8hMGs=; b=MWhy99TPrATamocAmy0rkfjmobpHQbiJjNCEzGGfXhwiRegY21CIh/5cjLWtKlazZ9 z0oRVsRh3xJpORXqCBEVRYKtl5x05pKgSv4UYYhuV4EJNcrUdy3C0gtzqdqamHY82yMV 5JpLiYgdU9gEod1tq+MS/0+V+Pi1cfb9iBan1iE0217/FtGAT3zsczWT3WBWnAEneJlW b9hrnm8GxIQYMZ6SWzXiYqQh40W6ewl8PZ14PTzzAhya5Iy/WK2kgNPggG+/qI/LlpMg baZi1Qg1G+gqfzkUhDeho1DG2v4/2KWWSi3wrqthmpZbLHko6KN585Pkl0i6I3GAyHLh 0FGg== X-Gm-Message-State: AKGB3mI2Tt+S/IWVykL+7SfAx98NyVp7JIgWZuclLNXdlKtaJR0ifuIw sKga+YyRpyzg9QTxDJ0yfPZwnXURL58= X-Google-Smtp-Source: ACJfBovT7Dpv+jhvE4cWAEEBzSeQPor6NWFgPgVo4aqD43IBRA/jSJe8y4Fs9XLU411xGusyqWjC0g== X-Received: by 10.223.200.145 with SMTP id k17mr26992851wrh.96.1514628140229; Sat, 30 Dec 2017 02:02:20 -0800 (PST) Received: from localhost.localdomain ([89.202.204.147]) by smtp.gmail.com with ESMTPSA id n65sm66180723wrb.17.2017.12.30.02.02.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 30 Dec 2017 02:02:19 -0800 (PST) From: Angelo Compagnucci To: buildroot@buildroot.org Date: Sat, 30 Dec 2017 11:02:06 +0100 Message-Id: <1514628127-15938-7-git-send-email-angelo@amarulasolutions.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1514628127-15938-1-git-send-email-angelo@amarulasolutions.com> References: <1514628127-15938-1-git-send-email-angelo@amarulasolutions.com> Subject: [Buildroot] [PATCH v2 6/7] package/docker-engine: converting to golang infrastructure X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.24 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Angelo Compagnucci MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" This patch converts the docker-engine package to the new golang infrastructure. Signed-off-by: Angelo Compagnucci --- package/docker-engine/docker-engine.mk | 53 +++++++++++----------------------- 1 file changed, 17 insertions(+), 36 deletions(-) diff --git a/package/docker-engine/docker-engine.mk b/package/docker-engine/docker-engine.mk index 8928f07..33b825e 100644 --- a/package/docker-engine/docker-engine.mk +++ b/package/docker-engine/docker-engine.mk @@ -13,70 +13,53 @@ DOCKER_ENGINE_LICENSE_FILES = LICENSE DOCKER_ENGINE_DEPENDENCIES = host-go host-pkgconf -DOCKER_ENGINE_GOPATH = "$(@D)/gopath" -DOCKER_ENGINE_MAKE_ENV = $(HOST_GO_TARGET_ENV) \ - CGO_ENABLED=1 \ - CGO_NO_EMULATION=1 \ - GOBIN="$(@D)/bin" \ - GOPATH="$(DOCKER_ENGINE_GOPATH)" \ - PKG_CONFIG="$(PKG_CONFIG_HOST_BINARY)" \ - $(TARGET_MAKE_ENV) - -DOCKER_ENGINE_GLDFLAGS = \ +DOCKER_ENGINE_GO_LDFLAGS = \ -X main.GitCommit=$(DOCKER_ENGINE_VERSION) \ -X main.Version=$(DOCKER_ENGINE_VERSION) -ifeq ($(BR2_STATIC_LIBS),y) -DOCKER_ENGINE_GLDFLAGS += -extldflags '-static' -else -ifeq ($(BR2_PACKAGE_DOCKER_ENGINE_STATIC_CLIENT),y) -DOCKER_ENGINE_GLDFLAGS_DOCKER += -extldflags '-static' -endif -endif - -DOCKER_ENGINE_BUILD_TAGS = cgo exclude_graphdriver_zfs autogen +DOCKER_ENGINE_GO_TAGS = cgo exclude_graphdriver_zfs autogen DOCKER_ENGINE_BUILD_TARGETS = docker ifeq ($(BR2_PACKAGE_LIBSECCOMP),y) -DOCKER_ENGINE_BUILD_TAGS += seccomp +DOCKER_ENGINE_GO_TAGS += seccomp DOCKER_ENGINE_DEPENDENCIES += libseccomp endif ifeq ($(BR2_INIT_SYSTEMD),y) -DOCKER_ENGINE_BUILD_TAGS += journald +DOCKER_ENGINE_GO_TAGS += journald DOCKER_ENGINE_DEPENDENCIES += systemd endif ifeq ($(BR2_PACKAGE_DOCKER_ENGINE_DAEMON),y) -DOCKER_ENGINE_BUILD_TAGS += daemon +DOCKER_ENGINE_GO_TAGS += daemon DOCKER_ENGINE_BUILD_TARGETS += dockerd endif ifeq ($(BR2_PACKAGE_DOCKER_ENGINE_EXPERIMENTAL),y) -DOCKER_ENGINE_BUILD_TAGS += experimental +DOCKER_ENGINE_GO_TAGS += experimental endif ifeq ($(BR2_PACKAGE_DOCKER_ENGINE_DRIVER_BTRFS),y) DOCKER_ENGINE_DEPENDENCIES += btrfs-progs else -DOCKER_ENGINE_BUILD_TAGS += exclude_graphdriver_btrfs +DOCKER_ENGINE_GO_TAGS += exclude_graphdriver_btrfs endif ifeq ($(BR2_PACKAGE_DOCKER_ENGINE_DRIVER_DEVICEMAPPER),y) DOCKER_ENGINE_DEPENDENCIES += lvm2 else -DOCKER_ENGINE_BUILD_TAGS += exclude_graphdriver_devicemapper +DOCKER_ENGINE_GO_TAGS += exclude_graphdriver_devicemapper endif ifeq ($(BR2_PACKAGE_DOCKER_ENGINE_DRIVER_VFS),y) DOCKER_ENGINE_DEPENDENCIES += gvfs else -DOCKER_ENGINE_BUILD_TAGS += exclude_graphdriver_vfs +DOCKER_ENGINE_GO_TAGS += exclude_graphdriver_vfs endif define DOCKER_ENGINE_CONFIGURE_CMDS - mkdir -p $(DOCKER_ENGINE_GOPATH)/src/github.com/docker - ln -fs $(@D) $(DOCKER_ENGINE_GOPATH)/src/github.com/docker/docker + mkdir -p $(@D)/$(DOCKER_ENGINE_GOPATH)/src/github.com/docker + ln -s $(@D) $(@D)/$(DOCKER_ENGINE_GOPATH)/src/github.com/docker/docker cd $(@D) && \ GITCOMMIT="$$(echo $(DOCKER_ENGINE_COMMIT) | head -c7)" \ BUILDTIME="$$(date)" \ @@ -105,20 +88,18 @@ endif define DOCKER_ENGINE_BUILD_CMDS $(foreach target,$(DOCKER_ENGINE_BUILD_TARGETS), \ - cd $(@D)/gopath/src/github.com/docker/docker; \ - $(DOCKER_ENGINE_MAKE_ENV) \ - $(HOST_DIR)/bin/go build -v \ - -o $(@D)/bin/$(target) \ - -tags "$(DOCKER_ENGINE_BUILD_TAGS)" \ - -ldflags "$(DOCKER_ENGINE_GLDFLAGS) $(DOCKER_ENGINE_GLDFLAGS_$(call UPPERCASE,$(target)))" \ + cd $(DOCKER_ENGINE_SRC_PATH); \ + $(DOCKER_ENGINE_GO_ENV) \ + $(GO_BIN) install -v \ + $(DOCKER_ENGINE_BUILD_OPTS) \ github.com/docker/docker/cmd/$(target) ) endef define DOCKER_ENGINE_INSTALL_TARGET_CMDS $(foreach target,$(DOCKER_ENGINE_BUILD_TARGETS), \ - $(INSTALL) -D -m 0755 $(@D)/bin/$(target) $(TARGET_DIR)/usr/bin/$(target) + $(INSTALL) -D -m 0755 $(@D)/$(DOCKER_ENGINE_BINDIR)/$(target) $(TARGET_DIR)/usr/bin/$(target) ) endef -$(eval $(generic-package)) +$(eval $(golang-package))