From patchwork Thu Feb 20 16:01:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Havelange X-Patchwork-Id: 1241520 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) 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=fail (p=none dis=none) header.from=essensium.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=essensium.com header.i=@essensium.com header.a=rsa-sha256 header.s=google header.b=Hf5Ovuuk; dkim-atps=neutral Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48NfVJ2Rn0z9sPK for ; Fri, 21 Feb 2020 03:02:00 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id A8BFE8606C; Thu, 20 Feb 2020 16:01:58 +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 KPd8NHG1yLQK; Thu, 20 Feb 2020 16:01:57 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 716F985FD4; Thu, 20 Feb 2020 16:01:57 +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 9446A1BF9B3 for ; Thu, 20 Feb 2020 16:01:48 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 8DF1887D1D for ; Thu, 20 Feb 2020 16:01:48 +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 IqqpAIobhBhf for ; Thu, 20 Feb 2020 16:01:47 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wr1-f43.google.com (mail-wr1-f43.google.com [209.85.221.43]) by hemlock.osuosl.org (Postfix) with ESMTPS id 991AC87B05 for ; Thu, 20 Feb 2020 16:01:47 +0000 (UTC) Received: by mail-wr1-f43.google.com with SMTP id c9so5207185wrw.8 for ; Thu, 20 Feb 2020 08:01:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=essensium.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=01gpnsTQNSRzaUzakRtTdSoJgglg+MdPpgGEuWJkrqo=; b=Hf5OvuukOi5Az3M/+6kaPrG7ZLCBnvV5cJke1+7ydDbt6Uh2oy/JdHk9ZKeEls2M3l BwiCOTCJKqoks9rH5gkknq1yJc+syptLDPpe2SFuPgIJELeBtzaEg2Uly6grpHQlBqUb esB2yaKhLpzBOq5CC8pp4LzoKR2NSs/MjcwCNeEutW8SFDk59dbsGcyWHbHKpsPyxfyf sp1Ov6hcpA7/6k7tTeYjxHI3Mal1WLYRnEEVcDJQYplKPfodpVCDeBSyryqW3feSkZiL eFFhAbWBs7hSyr9IAs4hX6W4GEI4i2Ih8zt4cqldYvGgbug+H2lsuLuh+Yg2FcRJZT6m vRpQ== 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:mime-version:content-transfer-encoding; bh=01gpnsTQNSRzaUzakRtTdSoJgglg+MdPpgGEuWJkrqo=; b=K8H4i6bU3A5RETdJDg8TKv5ZScZRd2msgRw5iZqJpcCggIYpvqEkivMdHToBcshxfZ KpKT7T3ZhpkK/WyqnAVm+NcZKImyDGpl76QxC8YYdy0xi7BQ1bB7bFpiIXCd7CGZlmnU eEfUhvkMxCNqI54JrjHmEZJrv3QhaPae6m4mIl0iuTaMMgrCwBtZTRv/PBX4d7l3M4J0 9DnQbNwZ32GST3HPz44bgRwduU2AwOQPtPPJk0oIcoqpt2HA7L2shg33mld77S3Utpt9 NxLJsRll4XUOiRAbQZz3z8iOefXQVA+mI2ycFa6mlplGAExNE6slIEJGlG5qktRJSra7 nSAg== X-Gm-Message-State: APjAAAXoAXZndXqtpTYIDlHqmJnt5YhWHd9wtwGcTZwLdjE8Je2i9yHg SD/Ck7F7UGuaOLzpF6i+odyNNvdgEca/kw== X-Google-Smtp-Source: APXvYqyAc3rJ7jahNteflJSrz47izYtSLuvOkMXFMRdqEfmH3L+uqIqoUvbTmYKWEvjeqC0hSCsTGg== X-Received: by 2002:a5d:4687:: with SMTP id u7mr41544330wrq.176.1582214505723; Thu, 20 Feb 2020 08:01:45 -0800 (PST) Received: from ph-ThinkPad-E560.local.ess-mail.com (ip-188-118-3-185.reverse.destiny.be. [188.118.3.185]) by smtp.gmail.com with ESMTPSA id h5sm5483691wmf.8.2020.02.20.08.01.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Feb 2020 08:01:45 -0800 (PST) From: Patrick Havelange To: buildroot@buildroot.org Date: Thu, 20 Feb 2020 17:01:19 +0100 Message-Id: <20200220160119.3407-10-patrick.havelange@essensium.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200220160119.3407-1-patrick.havelange@essensium.com> References: <20200220160119.3407-1-patrick.havelange@essensium.com> MIME-Version: 1.0 Subject: [Buildroot] [PATCH v3 10/10] docs/manual/adding-packages-cargo: Update for legal-info X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas De Schampheleire , Patrick Havelange , Sam Voss , "Yann E . MORIN" , Thomas Petazzoni Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Added a bit of explanations regarding the vendored licenses. Signed-off-by: Patrick Havelange --- docs/manual/adding-packages-cargo.txt | 45 ++++++++++++++++++++------- 1 file changed, 34 insertions(+), 11 deletions(-) diff --git a/docs/manual/adding-packages-cargo.txt b/docs/manual/adding-packages-cargo.txt index e7d03eb7b5..e92b8bc353 100644 --- a/docs/manual/adding-packages-cargo.txt +++ b/docs/manual/adding-packages-cargo.txt @@ -38,19 +38,25 @@ with an example: 04: # 05: ################################################################################ 06: -07: FOO_VERSION = 1.0 -08: FOO_SOURCE = foo-$(FOO_VERSION).tar.gz -09: FOO_SITE = http://www.foosoftware.org/download -10: FOO_LICENSE = GPL-3.0+ -11: FOO_LICENSE_FILES = COPYING -12: -13: $(eval $(cargo-package)) +07: include package/foo/vendor.inc +08: +09: FOO_VERSION = 1.0 +10: FOO_SOURCE = foo-$(FOO_VERSION).tar.gz +11: FOO_SITE = http://www.foosoftware.org/download +12: FOO_LICENSE = GPL-3.0+ +13: FOO_LICENSE_FILES = COPYING $(FOO_VENDOR_LICENSE_FILES) +14: +15: $(eval $(cargo-package)) -------------------------------- -The Makefile starts with the definition of the standard variables for package -declaration (lines 7 to 11). +The Makefile starts with the inclusion of a second file that +contains the vendored licenses, more info on that topic later. +Then it continues with the definition of the standard variables +for package declaration (lines 9 to 13). -As seen in line 13, it is based on the cargo-package infrastructure. Cargo will +FOO_VENDOR_LICENSE_FILES is defined in the previously included file vendor.inc + +As seen in line 15, it is based on the cargo-package infrastructure. Cargo will be invoked automatically by this infrastructure. The required dependencies of the crate will be downloaded and the buildroot dependencies will also be set. @@ -58,7 +64,20 @@ It is still possible to define custom build commands or install commands (i.e. with FOO_BUILD_CMDS and FOO_INSTALL_TARGET_CMDS). Those will then replace the commands from the cargo infrastructure. -==== About Dependencies Management +The file vendor.inc contains only one variable : + +------------------------------ +01: FOO_VENDOR_LICENSES_FILES = \ +02: VENDOR/bar/COPYING \ +03: VENDOR/blah/LICENSE-MIT \ +04: VENDOR/bleh/COPYING \ +05: +-------------------------------- + +It is recommended to generate the list via scripting. +A script example can be found in the ripgrep directory. + +==== About Dependencies Management and Licenses A crate can depend on other libraries from crates.io or git repositories, listed in its Cargo.toml file. Before starting a build, the +cargo vendor+ command @@ -66,3 +85,7 @@ will be run and will take care of downloading those dependencies. The final source tarball will contain all the required dependencies, effectively permitting us to do an offline build. + +In order for the +legal-info+ target to work as expected, it is necessary to list +the licenses of the vendored dependencies. Each of those entries should be added +to the +.mk+ and +.hash+ files.