From: Angelo Compagnucci <angelo@amarulasolutions.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH v3 6/7] package/docker-engine: converting to golang infrastructure
Date: Wed, 7 Mar 2018 23:19:38 +0100 [thread overview]
Message-ID: <1520461179-31679-7-git-send-email-angelo@amarulasolutions.com> (raw)
In-Reply-To: <1520461179-31679-1-git-send-email-angelo@amarulasolutions.com>
This patch converts the docker-engine package to the new golang
infrastructure.
Signed-off-by: Angelo Compagnucci <angelo@amarulasolutions.com>
---
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))
--
2.7.4
next prev parent reply other threads:[~2018-03-07 22:19 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-07 22:19 [Buildroot] [PATCH v3 0/7] New infrastructure for golang packages Angelo Compagnucci
2018-03-07 22:19 ` [Buildroot] [PATCH v3 1/7] package/pkg-golang: new package infrastructure Angelo Compagnucci
2018-03-07 22:19 ` [Buildroot] [PATCH v3 2/7] docs/manual: adding documentation for the golang infrastructure Angelo Compagnucci
2018-03-07 22:19 ` [Buildroot] [PATCH v3 3/7] package/flannel: converting to " Angelo Compagnucci
2018-03-07 22:19 ` [Buildroot] [PATCH v3 4/7] package/runc: " Angelo Compagnucci
2018-03-07 22:19 ` [Buildroot] [PATCH v3 5/7] package/docker-containerd: " Angelo Compagnucci
2018-03-30 21:53 ` Thomas Petazzoni
2018-03-07 22:19 ` Angelo Compagnucci [this message]
2018-03-07 22:19 ` [Buildroot] [PATCH v3 7/7] package/mender: new package Angelo Compagnucci
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1520461179-31679-7-git-send-email-angelo@amarulasolutions.com \
--to=angelo@amarulasolutions.com \
--cc=buildroot@busybox.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox