From: Angelo Compagnucci Date: Sat, 31 Mar 2018 13:27:34 +0000 (+0200) Subject: package/docker-containerd: convert to golang infrastructure X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=2dccb4f2fefd8a0dbda65dd0f7537f811e920b13;p=buildroot.git package/docker-containerd: convert to golang infrastructure Signed-off-by: Angelo Compagnucci Signed-off-by: Thomas Petazzoni Reviewed-by: "Yann E. MORIN" Signed-off-by: Arnout Vandecappelle (Essensium/Mind) --- diff --git a/package/docker-containerd/docker-containerd.mk b/package/docker-containerd/docker-containerd.mk index 8f0822b77f..88e27b5ed4 100644 --- a/package/docker-containerd/docker-containerd.mk +++ b/package/docker-containerd/docker-containerd.mk @@ -9,37 +9,20 @@ DOCKER_CONTAINERD_SITE = $(call github,docker,containerd,$(DOCKER_CONTAINERD_VER DOCKER_CONTAINERD_LICENSE = Apache-2.0 DOCKER_CONTAINERD_LICENSE_FILES = LICENSE.code -DOCKER_CONTAINERD_DEPENDENCIES = host-go +DOCKER_CONTAINERD_WORKSPACE = vendor -DOCKER_CONTAINERD_GOPATH = "$(@D)/vendor" -DOCKER_CONTAINERD_MAKE_ENV = $(HOST_GO_TARGET_ENV) \ - CGO_ENABLED=1 \ - GOBIN="$(@D)/bin" \ - GOPATH="$(DOCKER_CONTAINERD_GOPATH)" - -DOCKER_CONTAINERD_GLDFLAGS = \ +DOCKER_CONTAINERD_LDFLAGS = \ -X github.com/docker/containerd.GitCommit=$(DOCKER_CONTAINERD_VERSION) -ifeq ($(BR2_STATIC_LIBS),y) -DOCKER_CONTAINERD_GLDFLAGS += -extldflags '-static' -endif +DOCKER_CONTAINERD_BUILD_TARGETS = ctr containerd containerd-shim -define DOCKER_CONTAINERD_CONFIGURE_CMDS - mkdir -p $(DOCKER_CONTAINERD_GOPATH)/src/github.com/docker - ln -s $(@D) $(DOCKER_CONTAINERD_GOPATH)/src/github.com/docker/containerd -endef +DOCKER_CONTAINERD_INSTALL_BINS = containerd containerd-shim -define DOCKER_CONTAINERD_BUILD_CMDS - $(foreach d,ctr containerd containerd-shim,\ - cd $(@D); $(DOCKER_CONTAINERD_MAKE_ENV) $(HOST_DIR)/bin/go build \ - -v -o $(@D)/bin/$(d) -ldflags "$(DOCKER_CONTAINERD_GLDFLAGS)" ./$(d)$(sep)) -endef - -define DOCKER_CONTAINERD_INSTALL_TARGET_CMDS +define DOCKER_CONTAINERD_INSTALL_SYMLINKS ln -fs runc $(TARGET_DIR)/usr/bin/docker-runc - $(INSTALL) -D -m 0755 $(@D)/bin/containerd $(TARGET_DIR)/usr/bin/docker-containerd - $(INSTALL) -D -m 0755 $(@D)/bin/containerd-shim $(TARGET_DIR)/usr/bin/containerd-shim ln -fs containerd-shim $(TARGET_DIR)/usr/bin/docker-containerd-shim endef -$(eval $(generic-package)) +DOCKER_CONTAINERD_POST_INSTALL_TARGET_HOOKS += DOCKER_CONTAINERD_INSTALL_SYMLINKS + +$(eval $(golang-package))