From patchwork Wed Mar 7 22:19:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Angelo Compagnucci X-Patchwork-Id: 882841 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.137; helo=fraxinus.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=amarulasolutions.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=amarulasolutions.com header.i=@amarulasolutions.com header.b="i/jVWqaw"; dkim-atps=neutral Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zxSkX0rvFz9sgx for ; Thu, 8 Mar 2018 09:20:04 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 8633887A5C; Wed, 7 Mar 2018 22:20:02 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id gTsT8mH88Pck; Wed, 7 Mar 2018 22:20:00 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id B060085ED9; Wed, 7 Mar 2018 22:20:00 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 1C9D01C0547 for ; Wed, 7 Mar 2018 22:19:56 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 193F989D95 for ; Wed, 7 Mar 2018 22:19:56 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id KaX26L4G18S9 for ; Wed, 7 Mar 2018 22:19:55 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wr0-f176.google.com (mail-wr0-f176.google.com [209.85.128.176]) by hemlock.osuosl.org (Postfix) with ESMTPS id ACB6A89D85 for ; Wed, 7 Mar 2018 22:19:54 +0000 (UTC) Received: by mail-wr0-f176.google.com with SMTP id v111so3759215wrb.3 for ; Wed, 07 Mar 2018 14:19:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=JiDWU4hqgkQEdtgCcGbFGEZ1Erzwfzx1tRydv/8hMGs=; b=i/jVWqawCt3XhVst9AsJXL03h7nozzIRUSJg8UhalAOKjrzctGOXr5le9D8p2Qi41r F6q9ZhFMgXA0PZ5A860CG8cxmkQB1qYhSn49Uzg9IGbit5hvlpVsLncqyTYfqnunWgZt Y3e3FH27LBVFKM1RbPyeXnGydt6shghkWebtU= 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=LP1r3ZISkpL0TZeznQZpNIf9c6+RHOWtMKIdEivU36KRNHEwZFx2SQMG+8CsPgzXQo KfptmV/SNrWvasGyql0X0U/jbklw1pAVfFNTDN5z1/OFalNXGTR8nek4iil1CAWytLlm tUhaF/TUWANnIu001r6HMj6gcOmxcU4IkBP/dfTXMH95vNUPw8gCsJJd9Xfp1YjpcQwf 5+aN+170srIRBYM0KrFyesXCVrSlj1g00yKd79y6bu0ej663CTOnbAUoRBw9cQWnzs19 RuBWrgj045ao4mkE+9VQiSH4WQ3Oc6uzXXrmbltcf3oMLI26H0hu4BcRs3dfYzoSccCd o3hw== X-Gm-Message-State: APf1xPAr/VU6kBY5fo01BRxuRYQgfjIzqP8ayQFxzkRHaaaGwmXHorU7 C7B9j97LJykjP+nqnIgMFdrTkTnRYVo= X-Google-Smtp-Source: AG47ELvLx6d7SRoM0EnezQl8a/PyFFIoSbajN0VW4Ni7Jj44+SEXcTFLcnCDVDNuZEomFk8SZYC4Hw== X-Received: by 10.223.157.131 with SMTP id p3mr20158897wre.278.1520461192262; Wed, 07 Mar 2018 14:19:52 -0800 (PST) Received: from localhost.localdomain ([89.202.204.147]) by smtp.gmail.com with ESMTPSA id n29sm7662011wmi.32.2018.03.07.14.19.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 07 Mar 2018 14:19:51 -0800 (PST) From: Angelo Compagnucci To: buildroot@buildroot.org Date: Wed, 7 Mar 2018 23:19:38 +0100 Message-Id: <1520461179-31679-7-git-send-email-angelo@amarulasolutions.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1520461179-31679-1-git-send-email-angelo@amarulasolutions.com> References: <1520461179-31679-1-git-send-email-angelo@amarulasolutions.com> Subject: [Buildroot] [PATCH v3 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))