From patchwork Wed Dec 6 10:56:53 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Angelo Compagnucci X-Patchwork-Id: 845122 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.138; helo=whitealder.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="RXAt+wO8"; dkim-atps=neutral Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3ysFtg2y0wz9s84 for ; Wed, 6 Dec 2017 21:57:15 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id B06EC88C58; Wed, 6 Dec 2017 10:57:13 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id nkdmIY5hqwHt; Wed, 6 Dec 2017 10:57:11 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 8C1BC88B97; Wed, 6 Dec 2017 10:57:11 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 13B731C041E for ; Wed, 6 Dec 2017 10:57:09 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 10ACD8806A for ; Wed, 6 Dec 2017 10:57:09 +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 aWxk1v_s2jxX for ; Wed, 6 Dec 2017 10:57:06 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wr0-f196.google.com (mail-wr0-f196.google.com [209.85.128.196]) by fraxinus.osuosl.org (Postfix) with ESMTPS id 2762F8800A for ; Wed, 6 Dec 2017 10:57:04 +0000 (UTC) Received: by mail-wr0-f196.google.com with SMTP id v22so3438927wrb.0 for ; Wed, 06 Dec 2017 02:57:04 -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=ICKYx9jSLZPqDXHrK/NGq0rbqcsqUKYDEZfb1qu6eyo=; b=RXAt+wO89TCEtsvVF3FSUPh3u9Xj4xDTQ7UtvS9HSjUSKJ6zaaUrl/0A8+y8FaBChJ kiLsM2YbAwDSiyux8ElY1sKEOXfrmuMYpXKkvi5Gms6KshzKvq0hGyz5FMmmGxVqnrbN yOyVtUQCzSqDTryxzCa4ycabszmlmzrs/qzW5WMWqWsRfd3bgGsfkZNRmvOrdEpyTxpu JA3ORrHaRXa1qsxpyZnrLK9p+AJCu8SFpx8DeL/+xi+x6CG4Dd82My79wz+8t2kaLIv+ rZ4VX3vj9y5Eibt5elsOFMK3TB3eDDkQhT+A9ERlCJNwk7l4pgQ0fiZ3vD1t5b7PV8Gh N0yA== 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=ICKYx9jSLZPqDXHrK/NGq0rbqcsqUKYDEZfb1qu6eyo=; b=UlY7C3FlBsR4mM582A1Nyxsw0h2me/BX2xHhpoGoRS/el01aKXAEfBevDaLxQf2Qbl yrQJU5Jy5bjn0hsOHgMRtait2CbjYBE8YJsAJd/6U+HM0JLZRjbzkRR2XrLEKFlMiZf8 V5zfoGcEVZ78Yl5el/F0hCgqoOxBA5b8gKaN7A8PEfEpYsZ8XKXKkdkXeX0asLG/UCnf il/wC0E+aWpcTBJ+4kMgpgzJs5Hls6nAffwu6mOrgndfUqu+Fe5TAuT48xNl299GLvRZ 24/44OEIjt51S0aoB2e4AVPITHqPFFqazbCsCLfQjC2BBhEf03Df1HcEHDVV/r3Haz7u pqOg== X-Gm-Message-State: AJaThX5aR/xZRCRvYw6SvP+SDIxg0N2nEHxTruZSi6PSFnh9k3LtWFJd /x4vsXBtv/9w9W1ZsIwlvCj7rg5P/CY= X-Google-Smtp-Source: AGs4zMYpA4VbAuhf4plZqyRYV05Fq9G0wb8ylTFZf+WQYF29UoYa86psTV40FSs74hONoQgTig0jMQ== X-Received: by 10.223.189.5 with SMTP id j5mr18301493wrh.172.1512557822961; Wed, 06 Dec 2017 02:57:02 -0800 (PST) Received: from localhost.localdomain ([89.202.204.147]) by smtp.gmail.com with ESMTPSA id 31sm2433971wrm.59.2017.12.06.02.57.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 06 Dec 2017 02:57:02 -0800 (PST) From: Angelo Compagnucci To: buildroot@buildroot.org Date: Wed, 6 Dec 2017 11:56:53 +0100 Message-Id: <1512557817-431-2-git-send-email-angelo@amarulasolutions.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1512557817-431-1-git-send-email-angelo@amarulasolutions.com> References: <1512557817-431-1-git-send-email-angelo@amarulasolutions.com> Subject: [Buildroot] [PATCH 1/5] package/pkg-golang: new package 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" From: Angelo Compagnucci This patch adds a new infrastructure for golang based packages. Signed-off-by: Angelo Compagnucci --- package/Makefile.in | 1 + package/pkg-golang.mk | 121 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 122 insertions(+) create mode 100644 package/pkg-golang.mk diff --git a/package/Makefile.in b/package/Makefile.in index a1a5316..60d98d0 100644 --- a/package/Makefile.in +++ b/package/Makefile.in @@ -429,3 +429,4 @@ include package/pkg-kconfig.mk include package/pkg-rebar.mk include package/pkg-kernel-module.mk include package/pkg-waf.mk +include package/pkg-golang.mk diff --git a/package/pkg-golang.mk b/package/pkg-golang.mk new file mode 100644 index 0000000..aaca5f4 --- /dev/null +++ b/package/pkg-golang.mk @@ -0,0 +1,121 @@ +################################################################################ +# Golang package infrastructure +# +# This file implements an infrastructure that eases development of +# package .mk files for Go packages. It should be used for all +# packages that are written in go. +# +# See the Buildroot documentation for details on the usage of this +# infrastructure +# +# +# In terms of implementation, this golang infrastructure requires +# the .mk file to only specify metadata information about the +# package: name, version, download URL, etc. +# +# We still allow the package .mk file to override what the different +# steps are doing, if needed. For example, if _BUILD_CMDS is +# already defined, it is used as the list of commands to perform to +# build the package, instead of the default golang behavior. The +# package can also define some post operation hooks. +# +################################################################################ + +GOBIN = $(HOST_DIR)/bin/go + +################################################################################ +# inner-golang-package -- defines how the configuration, compilation and +# installation of a Go package should be done, implements a few hooks to +# tune the build process for Go specificities and calls the generic package +# infrastructure to generate the necessary make targets +# +# argument 1 is the lowercase package name +# argument 2 is the uppercase package name, including a HOST_ prefix +# for host packages +# argument 3 is the uppercase package name, without the HOST_ prefix +# for host packages +# argument 4 is the type (target or host) +################################################################################ + +define inner-golang-package + +$(2)_GOPATH ?= _gopath +$(2)_GO_ENV ?= $$(HOST_GO_TARGET_ENV) \ + GOPATH="$$(@D)/$$($(2)_GOPATH)" \ + CGO_ENABLED=$$(HOST_GO_CGO_ENABLED) + +ifeq ($(BR2_STATIC_LIBS),y) + $(2)_GO_LDFLAGS += -extldflags '-static' +endif + +ifdef $(2)_GO_LDFLAGS + $(2)_BUILD_OPTS += -ldflags "$$($(2)_GO_LDFLAGS)" +endif + +ifdef $(2)_GO_TAGS + $(2)_BUILD_OPTS += -tags "$$($(2)_GO_TAGS)" +endif + +# Target packages need the Go compiler on the host. +$(2)_DEPENDENCIES += host-go + +# +# The go build/install command installs the binaries inside +# gopath/bin/linux_GOARCH/ when cross compilation is enabled. +# We set this variable here to be used by packages if needed. +# +$(2)_BINDIR = $$($(2)_GOPATH)/bin/linux_$$(GO_GOARCH) + +# +# Source files in Go should be uncompressed in a precise folder in the +# hierarchy of GOPATH. It usually resolves around domain/vendor/software. +# +$(2)_GO_SRC_PATH ?= $$(call domain,$($(2)_SITE))/$$(firstword $$(subst /, ,$$(call notdomain,$($(2)_SITE)))) +$(2)_SRC_PATH = $$(@D)/$$($(2)_GOPATH)/src/$$($(2)_GO_SRC_PATH)/$(1) + +# +# Configure step. Only define it if not already defined by the package +# .mk file. +# +ifndef $(2)_CONFIGURE_CMDS +define $(2)_CONFIGURE_CMDS + mkdir -p $$(@D)/$$($(2)_GOPATH)/bin + mkdir -p $$(@D)/$$($(2)_GOPATH)/src/$$($(2)_GO_SRC_PATH) + ln -sf $$(@D) $$($(2)_SRC_PATH) +endef +endif + +# +# Build step. Only define it if not already defined by the package .mk file. +# We use the install command instead of build command here because the +# install command also moves the package binaries in gopath/bin/linux_GOARCH/. +# Using the install command also leverages the go build infrastructure +# for building and installing multiple binaries. +# +ifndef $(2)_BUILD_CMDS +define $(2)_BUILD_CMDS + cd $$($(2)_SRC_PATH) && $$($(2)_GO_ENV) $$(GOBIN) install -v $$($(2)_BUILD_OPTS) +endef +endif + +# +# Target installation step. Only define it if not already defined by the +# package .mk file. +# +ifndef $(2)_INSTALL_TARGET_CMDS +define $(2)_INSTALL_TARGET_CMDS + $(INSTALL) -D -m 0755 $$(@D)/$$($(2)_BINDIR)/$(1) $(TARGET_DIR)/usr/bin/ +endef +endif + +# Call the generic package infrastructure to generate the necessary make +# targets +$(call inner-generic-package,$(1),$(2),$(3),$(4)) + +endef # inner-golang-package + +################################################################################ +# golang-package -- the target generator macro for Go packages +################################################################################ + +golang-package = $(call inner-golang-package,$(pkgname),$(call UPPERCASE,$(pkgname)),$(call UPPERCASE,$(pkgname)),target) From patchwork Wed Dec 6 10:56:54 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Angelo Compagnucci X-Patchwork-Id: 845120 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.137; helo=fraxinus.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="vooDip/M"; 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 3ysFtb5YHyz9sBd for ; Wed, 6 Dec 2017 21:57:11 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id BBF1A8803F; Wed, 6 Dec 2017 10:57:09 +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 dP2BJeo0dXUH; Wed, 6 Dec 2017 10:57:08 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id C9AD788055; Wed, 6 Dec 2017 10:57:08 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id CA4431C041E for ; Wed, 6 Dec 2017 10:57:07 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id C78208803F for ; Wed, 6 Dec 2017 10:57:07 +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 edg06VcYkLFO for ; Wed, 6 Dec 2017 10:57:06 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wr0-f178.google.com (mail-wr0-f178.google.com [209.85.128.178]) by fraxinus.osuosl.org (Postfix) with ESMTPS id 2761987FE8 for ; Wed, 6 Dec 2017 10:57:06 +0000 (UTC) Received: by mail-wr0-f178.google.com with SMTP id o2so3423719wro.5 for ; Wed, 06 Dec 2017 02:57:06 -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=EBgkggFgEdo2n78txgnrq//LUMibkLdb89vTvLqjKY8=; b=vooDip/MvIOkFhpY4vm/wShdN+j5k+vAbesgIsjY2xr3euNE2zhFQ8HUdjUl6r14jk zPaD96bsXkaTpQbUEirfg+6IRCN5qHNo4/SRJ2gkPXGTqkkeX88Dk8e7ixE37CWE3PRz XZfeuVbqY4zDHDmKvXPqlSaIsvpPFlvCCoLOn9JnwVBWQcHioNyhe3jrRDvLnwh4/Nh+ 0g6cLkP76iqmn2z+rpfpQmYIJfu1bOQEPuzbTiGe9U+8mDjgLuRhk5SmK7odYefy2uKk bdCsDyw3fjEqOTMIH0yZ+7iMNy1Uhw88V/n1jTVGzKCi875oMfobQvRpOEylX0S3Uy3R gkDw== 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=EBgkggFgEdo2n78txgnrq//LUMibkLdb89vTvLqjKY8=; b=KqIt1oKzt8uD4LPPtwj8LI6twxFSE5d9D4aIG9vF9FKMFpjHOlah1aA/BJac+hYLvp 0fgd8eyJyv3cUyCUqgleJzzXDCOw6W+PjUIhS5Dm7nsvJg4VBM1nUAASac85QFHPSsm9 ezzQUDM8IqZPH4cybZfm7QOZMUBNQwKzD0hwY9AIVTKajBPx6Qe/XnkB6OLNxrUxeYZV CSxT4SLeXihfqtY68fFPL1UQiOfZUpXHqyr853XgvC/w5w+2tMXAe7pN9PZre7dj/K0Y +1AJkOYbeZ5xcXTGDMQWHKJFkbT3Y7uvNRjzbl+iQ37uALHD7xwfeHOh7BMCJD/uFOt/ kmIA== X-Gm-Message-State: AJaThX5ixDQkV/o6uKTHPvRLjiWPhjFOrdDKtKVK72fN5noIzzgJFMRb MbvmhrxujVz7TjgzCRoyZ0WyeTiDvAI= X-Google-Smtp-Source: AGs4zMYMMVDAHsglRb1Zva6reYgVO46YRwK4UIRp5rNX1w3svqpo4YU/xdaRGKyuZagkqLIDcwJzWw== X-Received: by 10.223.195.113 with SMTP id e46mr18642025wrg.149.1512557824270; Wed, 06 Dec 2017 02:57:04 -0800 (PST) Received: from localhost.localdomain ([89.202.204.147]) by smtp.gmail.com with ESMTPSA id 31sm2433971wrm.59.2017.12.06.02.57.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 06 Dec 2017 02:57:03 -0800 (PST) From: Angelo Compagnucci To: buildroot@buildroot.org Date: Wed, 6 Dec 2017 11:56:54 +0100 Message-Id: <1512557817-431-3-git-send-email-angelo@amarulasolutions.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1512557817-431-1-git-send-email-angelo@amarulasolutions.com> References: <1512557817-431-1-git-send-email-angelo@amarulasolutions.com> Subject: [Buildroot] [PATCH 2/5] docs/manual: adding documentation for the 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" From: Angelo Compagnucci This patch adds the documentation for the golang infrastructure. Signed-off-by: Angelo Compagnucci --- docs/manual/adding-packages-golang.txt | 114 +++++++++++++++++++++++++++++++++ docs/manual/adding-packages.txt | 2 + 2 files changed, 116 insertions(+) create mode 100644 docs/manual/adding-packages-golang.txt diff --git a/docs/manual/adding-packages-golang.txt b/docs/manual/adding-packages-golang.txt new file mode 100644 index 0000000..3761cac --- /dev/null +++ b/docs/manual/adding-packages-golang.txt @@ -0,0 +1,114 @@ +// -*- mode:doc; -*- +// vim: set syntax=asciidoc: + +=== Infrastructure for Go packages + +This infrastructure applies to Go packages that use the standard +build system and use bundled dependencies. + +[[golang-package-tutorial]] + +==== +golang-package+ tutorial + +First, let's see how to write a +.mk+ file for a go package, +with an example : + +------------------------ +01: ################################################################################ +02: # +03: # go-foo +04: # +05: ################################################################################ +06: +07: GO_FOO_VERSION = 1.0 +08: GO_FOO_SOURCE = go-foo-$(GO_FOO_VERSION).tar.xz +09: GO_FOO_SITE = http://www.foosoftware.org/download +10: GO_FOO_LICENSE = BSD-3-Clause +11: GO_FOO_LICENSE_FILES = LICENSE +12: +13: $(eval $(golang-package)) +------------------------ + +On line 7, we declare the version of the package. + +On line 8 and 9, we declare the name of the tarball (xz-ed tarball +recommended) and the location of the tarball on the Web. Buildroot +will automatically download the tarball from this location. + +On line 10 and 11, we give licensing details about the package (its +license on line 10, and the file containing the license text on line +11). + +Finally, on line 13, we invoke the +golang-package+ macro that +generates all the Makefile rules that actually allow the package to be +built. + +[[golang-package-reference]] + +==== +golang-package+ reference + +As a policy packages can freely choose their name (existing example in +Buildroot is +flannel+). + +In their +Config.in+ file, they should depend on ++BR2_PACKAGE_HOST_GO_ARCH_SUPPORTS+ and ++BR2_PACKAGE_HOST_GO_CGO_LINKING_SUPPORTS+ cause host-go will compile when Buildroot will add the +dependency automatically. + +The main macro of the Go package infrastructure is ++golang-package+. It is similar to the +generic-package+ macro. + +Just like the generic infrastructure, the Go infrastructure works +by defining a number of variables before calling the +golang-package+. + +All the package metadata information variables that exist in the +xref:generic-package-reference[generic package infrastructure] also +exist in the Go infrastructure: +GO_FOO_VERSION+, ++GO_FOO_SOURCE+, +GO_FOO_PATCH+, +GO_FOO_SITE+, ++GO_FOO_SUBDIR+, +GO_FOO_DEPENDENCIES+, +GO_FOO_LICENSE+, ++GO_FOO_LICENSE_FILES+, +GO_FOO_INSTALL_STAGING+, etc. + +Note that: + + * It is not necessary to add +go+ or +host-go+ in the + +GO_FOO_DEPENDENCIES+ variable of a package, since these basic + dependencies are automatically added as needed by the Go + package infrastructure. + +A few additional variables, specific to the Go infrastructure, can +optionally be defined, depending on the package's needs. Many of them +are only useful in very specific cases, typical packages will +therefore only use a few of them, or none. + +* If your package need a custom GOPATH to be compiled in, you can use the + +GO_FOO_GOPATH+. + +* +GO_FOO_GO_SRC_PATH+ is the path where your source will be compiled + relatively to the GOPATH. + The golang package infrastructure tries to guess the correct + sub folder to compile in but if guessing is not correct for you or your + package behaves differently, you can use this variable to + redefine the path. + +* +GOO_FOO_GO_LDFLAGS+ and +GO_FOO_GO_TAGS+ can be used to pass + respectively the LDFLAGS or the TAGS to the build command. + +GOO_FOO_GO_LDFLAGS+ and +GO_FOO_GO_TAGS+ will be combined into + the proper command line options to be passed to the compiler. + +* If you need to customize the install location for you binaries, you + can use +GOO_FOO_BINDIR+ to know where the binaries are. + +With the Go infrastructure, all the steps required to build and +install the packages are already defined, and they generally work well +for most Go-based packages. However, when required, it is still +possible to customize what is done in any particular step: + +* By adding a post-operation hook (after extract, patch, configure, + build or install). See xref:hooks[] for details. + +* By overriding one of the steps. For example, even if the Go + infrastructure is used, if the package +.mk+ file defines its own + +GO_FOO_BUILD_CMDS+ variable, it will be used instead of the + default Go one. However, using this method should be restricted + to very specific cases. Do not use it in the general case. + diff --git a/docs/manual/adding-packages.txt b/docs/manual/adding-packages.txt index d577ff0..be7468b 100644 --- a/docs/manual/adding-packages.txt +++ b/docs/manual/adding-packages.txt @@ -34,6 +34,8 @@ include::adding-packages-rebar.txt[] include::adding-packages-waf.txt[] +include::adding-packages-golang.txt[] + include::adding-packages-kernel-module.txt[] include::adding-packages-asciidoc.txt[] From patchwork Wed Dec 6 10:56:55 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Angelo Compagnucci X-Patchwork-Id: 845123 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.137; helo=fraxinus.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="fXwDP+IK"; 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 3ysFtg3btqz9s9Y for ; Wed, 6 Dec 2017 21:57:15 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id EC5FF880AE; Wed, 6 Dec 2017 10:57:13 +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 sssHtDyxYkQS; Wed, 6 Dec 2017 10:57:13 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 468F488055; Wed, 6 Dec 2017 10:57:13 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id D6B0F1C041E for ; Wed, 6 Dec 2017 10:57:09 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id CD48388B97 for ; Wed, 6 Dec 2017 10:57:09 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 7aPsDKo7WcPG for ; Wed, 6 Dec 2017 10:57:08 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wr0-f196.google.com (mail-wr0-f196.google.com [209.85.128.196]) by whitealder.osuosl.org (Postfix) with ESMTPS id A0F3788B5D for ; Wed, 6 Dec 2017 10:57:07 +0000 (UTC) Received: by mail-wr0-f196.google.com with SMTP id a41so3424622wra.6 for ; Wed, 06 Dec 2017 02:57:07 -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=LS8jq5kFSMoK0LyqjEtTUMWCSHEtL6if4iTWTz4UDh0=; b=fXwDP+IKf7mSJvn9D/j0Ck3ILpNt0OXw1V06W2CB8/ch1+sjm/XB5mvenhQp1AQv9U YVXPRqNkqkQmSm3/75pQTCx8dCGbL1PkDfvxrmCNlC3tJY2CkXYMPJn2TRVtYukJqHhc w5nE5+IZb5tMoflXX5RieOInM62wu/Emd/VtHCY+m/hgPlANRrpA0IuWogSaHppCSO75 CRjQ1QSoL6SEjoAN3/xtmbSl0VWRFdba82+PomrQlilyG5DbFPyMGa5SwM8XtBBvpNIM LHbm9eOXDXuBIeovoHY89Zq7279dvFZreQ/kHk9rOUARGx308xw+Jn4sJVe7P9BpF400 aceQ== 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=LS8jq5kFSMoK0LyqjEtTUMWCSHEtL6if4iTWTz4UDh0=; b=ZOYd8rx9oNW/I/vA1ybsr1NjAQuWbho2IR06Dk9vIeI2xcnoz1sEEKQmAb3v+QLdvR 6IOk7Z1VtzxWX/2bLX1N6Xoc0JKFBybJwZXSbJ7ZaS4sNT2g3nobvlj5XUtcEELf3IXr qyRgG2NLVphxmwypMg4cVkvddxzU9v1/nb39q0Y407csiGvJKogGDiRLHy/1cqWWhFCy lamAq7Q2PEY9ZEgVXud/J+pBjCPpHUm6GaSMN19QFxpJ7bqPCovuSusAl2RKG9n9f4lq Yhn4ZUfoKFdtciZIXnnBBs7CLD4gLrL2KjTgLkwVGDX64svOVb79mKaTXe661fcYu7bb cSCQ== X-Gm-Message-State: AJaThX5kdP4BmZyojwCSaJQkqWj0QNbfw1e7FlisXSaxLz7pU2qKLynn OvfApaoR/otTkOL6HmuhJ+PmwtLRwZg= X-Google-Smtp-Source: AGs4zMbjJsp+iZ9nitcl9QgVnHLrgAPHV7TqKJfBCLE2aYKSieHYjYupl+gBa5yMUEct059rKlEiRw== X-Received: by 10.223.183.17 with SMTP id l17mr20455927wre.1.1512557825679; Wed, 06 Dec 2017 02:57:05 -0800 (PST) Received: from localhost.localdomain ([89.202.204.147]) by smtp.gmail.com with ESMTPSA id 31sm2433971wrm.59.2017.12.06.02.57.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 06 Dec 2017 02:57:05 -0800 (PST) From: Angelo Compagnucci To: buildroot@buildroot.org Date: Wed, 6 Dec 2017 11:56:55 +0100 Message-Id: <1512557817-431-4-git-send-email-angelo@amarulasolutions.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1512557817-431-1-git-send-email-angelo@amarulasolutions.com> References: <1512557817-431-1-git-send-email-angelo@amarulasolutions.com> Subject: [Buildroot] [PATCH 3/5] package/flannel: 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" From: Angelo Compagnucci This patch converts the flannel package to the new golang infrastructure. Signed-off-by: Angelo Compagnucci --- package/flannel/flannel.mk | 32 ++++---------------------------- 1 file changed, 4 insertions(+), 28 deletions(-) diff --git a/package/flannel/flannel.mk b/package/flannel/flannel.mk index bbb2c72..6c9d9dd 100644 --- a/package/flannel/flannel.mk +++ b/package/flannel/flannel.mk @@ -11,36 +11,12 @@ FLANNEL_SOURCE = $(FLANNEL_VERSION).tar.gz FLANNEL_LICENSE = Apache-2.0 FLANNEL_LICENSE_FILES = LICENSE -FLANNEL_DEPENDENCIES = host-go - -FLANNEL_MAKE_ENV = \ - $(HOST_GO_TARGET_ENV) \ - GOBIN="$(@D)/bin" \ - GOPATH="$(@D)/gopath" \ - CGO_ENABLED=1 - -FLANNEL_GLDFLAGS = \ - -X github.com/coreos/flannel/version.Version=$(FLANNEL_VERSION) - -ifeq ($(BR2_STATIC_LIBS),y) -FLANNEL_GLDFLAGS += -extldflags '-static' -endif - -define FLANNEL_CONFIGURE_CMDS - # Put sources at prescribed GOPATH location. - mkdir -p $(@D)/gopath/src/github.com/coreos - ln -s $(@D) $(@D)/gopath/src/github.com/coreos/flannel -endef - -define FLANNEL_BUILD_CMDS - cd $(@D) && $(FLANNEL_MAKE_ENV) $(HOST_DIR)/bin/go \ - build -v -o $(@D)/bin/flanneld -ldflags "$(FLANNEL_GLDFLAGS)" . -endef +FLANNEL_GO_LDFLAGS = -X github.com/coreos/flannel/version.Version=$(FLANNEL_VERSION) +# Install flannel to its well known location. define FLANNEL_INSTALL_TARGET_CMDS - # Install flannel to its well known location. - $(INSTALL) -D -m 0755 $(@D)/bin/flanneld $(TARGET_DIR)/opt/bin/flanneld + $(INSTALL) -D -m 0755 $(FLANNEL_BINDIR)/flannel $(TARGET_DIR)/opt/bin/flanneld $(INSTALL) -D -m 0755 $(@D)/dist/mk-docker-opts.sh $(TARGET_DIR)/opt/bin/mk-docker-opts.sh endef -$(eval $(generic-package)) +$(eval $(golang-package)) From patchwork Wed Dec 6 10:56:56 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Angelo Compagnucci X-Patchwork-Id: 845124 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.137; helo=fraxinus.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="yPVlJzgP"; 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 3ysFtl0qH3z9s84 for ; Wed, 6 Dec 2017 21:57:19 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 55086880AB; Wed, 6 Dec 2017 10:57:16 +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 Bed-EpgOlzZG; Wed, 6 Dec 2017 10:57:14 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 0A4C08800A; Wed, 6 Dec 2017 10:57:14 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id AC8D61C041E for ; Wed, 6 Dec 2017 10:57:10 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id A9ED18807E for ; Wed, 6 Dec 2017 10:57:10 +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 cEL4UAfd5VUg for ; Wed, 6 Dec 2017 10:57:09 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wr0-f195.google.com (mail-wr0-f195.google.com [209.85.128.195]) by fraxinus.osuosl.org (Postfix) with ESMTPS id BDCF987FE8 for ; Wed, 6 Dec 2017 10:57:08 +0000 (UTC) Received: by mail-wr0-f195.google.com with SMTP id h1so3391564wre.12 for ; Wed, 06 Dec 2017 02:57:08 -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=9zGdCr3YQZpuzztuyPalf8oX/ichAFXi9GZU9CpcIAY=; b=yPVlJzgPvG8QiaihwmY1lJQFuJv+CsNdf/h3vMbk846r7bkL1WRcr59oVB2EpI9NZd xxag1nQdOO4LHTcrcQll0NNTN9dFBD9MY+cDh0DEVU0oiEIp52ujYBwDQ17Ya4kl7VsL cR16dDEh2tjas4uduWNy4oFbHJOSFI65qbmzkEXIGbt96azBCgrkluEvqWJ7rEwWcnhA EYfBBhD56Qsmgc698LgsxEBPJljHrjrCzvK+TbaT/UiL2tdH0Q3hct3bx1LboelNUTwT mQyf8GphA/9jOk6xU2wa+ECxlJuHxHAbC9lcjYCaGw3fyrMCekXJdA1RTOp2NcKqsMQZ njEQ== 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=9zGdCr3YQZpuzztuyPalf8oX/ichAFXi9GZU9CpcIAY=; b=HPnNSzRSKQTuanjeHOiwzLL0OqVGR8/Kugg3YKK7WoX6hR9j5Y3W6P0D3FILmPyDef bFlK4nyGacSaXj2ZBl7JxgTJD+ho5qIiXM/YDeE/BqJJxxDj0kptgcgnAX10onc3A/yL pzayuo7y3LOUm/Sd3Ax+raVANHtv10tnWkAoHr0Aqj4sgnrU5Hscgi6JopRNbsqX6YdL F3YTolWJMU2/Z6BqCVZcbVe9TnlO9x+rkR7T6RrO32+PfrvFZ77VLsdx9d3SLOBNB21o cyIWyahuCFlYSzVMkQZ50m/ZavT48195Yp4dI1AOby9MsZWEZSfNIqavWlAA3sjnrzOE uh1A== X-Gm-Message-State: AJaThX4flh1H2Q4Qd9rP2EBVEIIk1lDv8toqlU8U/pTngrjZQwSKWKej ML4jnD4j4xYPO7Z59LK/YbOJnXKe9YM= X-Google-Smtp-Source: AGs4zMZ/EfXuKQ9GIEgrOh+XdPxlgGG82ZgpYdZxWsRMsRkiIvQ7+q8jOuHIwl2cVGUeGMCkQ3hh1A== X-Received: by 10.223.174.211 with SMTP id y77mr18777229wrc.196.1512557827050; Wed, 06 Dec 2017 02:57:07 -0800 (PST) Received: from localhost.localdomain ([89.202.204.147]) by smtp.gmail.com with ESMTPSA id 31sm2433971wrm.59.2017.12.06.02.57.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 06 Dec 2017 02:57:06 -0800 (PST) From: Angelo Compagnucci To: buildroot@buildroot.org Date: Wed, 6 Dec 2017 11:56:56 +0100 Message-Id: <1512557817-431-5-git-send-email-angelo@amarulasolutions.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1512557817-431-1-git-send-email-angelo@amarulasolutions.com> References: <1512557817-431-1-git-send-email-angelo@amarulasolutions.com> Subject: [Buildroot] [PATCH 4/5] package/runc: 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" From: Angelo Compagnucci This patch converts the runc package to the new golang infrastructure. Signed-off-by: Angelo Compagnucci --- package/runc/runc.mk | 37 +++++-------------------------------- 1 file changed, 5 insertions(+), 32 deletions(-) diff --git a/package/runc/runc.mk b/package/runc/runc.mk index fb3fec2..f497b6d 100644 --- a/package/runc/runc.mk +++ b/package/runc/runc.mk @@ -9,42 +9,15 @@ RUNC_SITE = $(call github,opencontainers,runc,$(RUNC_VERSION)) RUNC_LICENSE = Apache-2.0 RUNC_LICENSE_FILES = LICENSE -RUNC_DEPENDENCIES = host-go +RUNC_GOPATH = Godeps/_workspace -RUNC_GOPATH = "$(@D)/Godeps/_workspace" -RUNC_MAKE_ENV = $(HOST_GO_TARGET_ENV) \ - CGO_ENABLED=1 \ - GOBIN="$(@D)/bin" \ - GOPATH="$(RUNC_GOPATH)" \ - PATH=$(BR_PATH) +RUNC_GO_LDFLAGS = -X main.gitCommit=$(RUNC_VERSION) -RUNC_GLDFLAGS = \ - -X main.gitCommit=$(RUNC_VERSION) - -ifeq ($(BR2_STATIC_LIBS),y) -RUNC_GLDFLAGS += -extldflags '-static' -endif - -RUNC_GOTAGS = cgo static_build +RUNC_GO_TAGS = cgo static_build ifeq ($(BR2_PACKAGE_LIBSECCOMP),y) -RUNC_GOTAGS += seccomp +RUNC_GO_TAGS += seccomp RUNC_DEPENDENCIES += libseccomp host-pkgconf endif -define RUNC_CONFIGURE_CMDS - mkdir -p $(RUNC_GOPATH)/src/github.com/opencontainers - ln -s $(@D) $(RUNC_GOPATH)/src/github.com/opencontainers/runc -endef - -define RUNC_BUILD_CMDS - cd $(@D) && $(RUNC_MAKE_ENV) $(HOST_DIR)/bin/go \ - build -v -o $(@D)/bin/runc \ - -tags "$(RUNC_GOTAGS)" -ldflags "$(RUNC_GLDFLAGS)" . -endef - -define RUNC_INSTALL_TARGET_CMDS - $(INSTALL) -D -m 0755 $(@D)/bin/runc $(TARGET_DIR)/usr/bin/runc -endef - -$(eval $(generic-package)) +$(eval $(golang-package)) From patchwork Wed Dec 6 10:56:57 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Angelo Compagnucci X-Patchwork-Id: 845126 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.138; helo=whitealder.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="ZKCyS92B"; dkim-atps=neutral Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3ysFtn5Z6Nz9s84 for ; Wed, 6 Dec 2017 21:57:21 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 4623288BBB; Wed, 6 Dec 2017 10:57:17 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Zf8EMjjAnhEK; Wed, 6 Dec 2017 10:57:15 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 7389988B40; Wed, 6 Dec 2017 10:57:15 +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 14EBB1C041E for ; Wed, 6 Dec 2017 10:57:11 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 1182188C91 for ; Wed, 6 Dec 2017 10:57:11 +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 0bXvF2nXFAe0 for ; Wed, 6 Dec 2017 10:57:10 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wr0-f193.google.com (mail-wr0-f193.google.com [209.85.128.193]) by hemlock.osuosl.org (Postfix) with ESMTPS id 1457E88C06 for ; Wed, 6 Dec 2017 10:57:10 +0000 (UTC) Received: by mail-wr0-f193.google.com with SMTP id v22so3439226wrb.0 for ; Wed, 06 Dec 2017 02:57:09 -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=vJfnvj03nylPYYakwK59q83pYfvKZn8cYJC43ZXDU0E=; b=ZKCyS92BSVqBptAqjjZB6/uIM9VlpQzbw+aeji0HlnROWefpHGCpdyf+wawhY1uZqr H93qboM87M9Auza4hkTu9A+nyz0Z2uUJtaxCG09etWWbs6SWBY8vhTMLt2nWpvS9nTG/ diESeWaZyzvcile/+gRyxgMzAClAXz5xspEjV/MP+0p8p6rFFjYH4N0SeyGh8RJ/i8yL F7hM5HXVD4Nnw3FVkbDmaJchCSgWS2wANfZfPvM4YzyGM4qKj+2Jq1j0wl+g62BPnt4q P7RjGgfFmgI2T+tFvr8j2vC5jHYX440GnD9UJByVFGXlsQJm7hnDUtr3Bi2fDvE+hiV3 AqnA== 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=vJfnvj03nylPYYakwK59q83pYfvKZn8cYJC43ZXDU0E=; b=MEQLTaXdRyOeCweqq+UaUqQQ+YBxlwQ/KT4MbiZnOUZ9ObpoE0JCKFj307ZNsRiPDK 35AxuB8M0EeXch4sVCckEYzsJiL4NAOskAAN1t4eXtB7ZbuNrKbjJbtH/xXvi/ZTy7ww b5x09dfbKdIWJzTOREdKYVTwq7EhpDUhFPIdWOnZ9PWSkqguawRRooqP7bsKXXDTRTX9 HeQEKOUcbKYrdoi6XgGy+5zqnbu2quMcOfA4O+P2ZlIvx2107cCJENKfWJEZbhfN0ZtO 3IfKBqBcW0hIBP1UmD8cEFzzDbFIzTztTyA/+euLbKVIZ/zGlqvH6yDYNmloB5vsoOrS bStw== X-Gm-Message-State: AJaThX7hTGpGpKf1T/cBXZAIcFE56TB4YcVyYctIdb3aUTRR6wD/Va1a fHWUtUxRshgPj3OrOgDxi8solZehWr4= X-Google-Smtp-Source: AGs4zMY9dYGIeuRvnwoE/TzFbHRCxq726U9KX22ahBoDq1Ds/WjaKsgiOk/f9j5FfYbzazf0fQBDSQ== X-Received: by 10.223.139.199 with SMTP id w7mr15885145wra.282.1512557828321; Wed, 06 Dec 2017 02:57:08 -0800 (PST) Received: from localhost.localdomain ([89.202.204.147]) by smtp.gmail.com with ESMTPSA id 31sm2433971wrm.59.2017.12.06.02.57.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 06 Dec 2017 02:57:07 -0800 (PST) From: Angelo Compagnucci To: buildroot@buildroot.org Date: Wed, 6 Dec 2017 11:56:57 +0100 Message-Id: <1512557817-431-6-git-send-email-angelo@amarulasolutions.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1512557817-431-1-git-send-email-angelo@amarulasolutions.com> References: <1512557817-431-1-git-send-email-angelo@amarulasolutions.com> Subject: [Buildroot] [PATCH 5/5] package/docker-containerd: 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" From: Angelo Compagnucci This patch converts the docker-containerd package to the new golang infrastructure. Signed-off-by: Angelo Compagnucci --- package/docker-containerd/docker-containerd.mk | 37 +++++++++++--------------- 1 file changed, 15 insertions(+), 22 deletions(-) diff --git a/package/docker-containerd/docker-containerd.mk b/package/docker-containerd/docker-containerd.mk index ffbadb0..34e7674 100644 --- a/package/docker-containerd/docker-containerd.mk +++ b/package/docker-containerd/docker-containerd.mk @@ -9,39 +9,32 @@ 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_GOPATH = 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_GO_LDFLAGS = \ -X github.com/docker/containerd.GitCommit=$(DOCKER_CONTAINERD_VERSION) -ifeq ($(BR2_STATIC_LIBS),y) -DOCKER_CONTAINERD_GLDFLAGS += -extldflags '-static' -endif - -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 - mkdir -p $(DOCKER_CONTAINERD_GOPATH)/src/github.com/opencontainers - ln -s $(RUNC_SRCDIR) $(DOCKER_CONTAINERD_GOPATH)/src/github.com/opencontainers/runc +define DOCKER_CONTAINERD_LINK_DIR + ln -sf $(@D) $(@D)/$(DOCKER_CONTAINERD_GOPATH)/src/github.com/docker/containerd + mkdir -p $(@D)/$(DOCKER_CONTAINERD_GOPATH)/src/github.com/opencontainers + ln -s $(RUNC_SRCDIR) $(@D)/$(DOCKER_CONTAINERD_GOPATH)/src/github.com/opencontainers/runc endef +DOCKER_CONTAINERD_POST_CONFIGURE_HOOKS += DOCKER_CONTAINERD_LINK_DIR + 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)) + cd $(@D)/$(DOCKER_CONTAINERD_GOPATH)/src/github.com/docker/containerd; \ + $(DOCKER_CONTAINERD_GO_ENV) \ + $(DOCKER_CONTAINERD_GO) \ + $(DOCKER_CONTAINERD_BUILD_OPTS) ./$(d)$(sep)) endef define DOCKER_CONTAINERD_INSTALL_TARGET_CMDS 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 + $(INSTALL) -D -m 0755 $(@D)/$(DOCKER_CONTAINERD_BINDIR)/containerd $(TARGET_DIR)/usr/bin/docker-containerd + $(INSTALL) -D -m 0755 $(@D)/$(DOCKER_CONTAINERD_BINDIR)/containerd-shim $(TARGET_DIR)/usr/bin/containerd-shim ln -fs containerd-shim $(TARGET_DIR)/usr/bin/docker-containerd-shim endef -$(eval $(generic-package)) +$(eval $(golang-package))