From patchwork Fri Feb 14 12:48:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Havelange X-Patchwork-Id: 1238020 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=B2P7MGa5; 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 48JtVf5j6hz9sRN for ; Fri, 14 Feb 2020 23:49:13 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 233BB8659E; Fri, 14 Feb 2020 12:49:12 +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 4XQVRsJPprTE; Fri, 14 Feb 2020 12:49:09 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id B85EB86599; Fri, 14 Feb 2020 12:49:09 +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 269581BF3A0 for ; Fri, 14 Feb 2020 12:48:51 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 239A187E56 for ; Fri, 14 Feb 2020 12:48:51 +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 MdQqDlBBHL7V for ; Fri, 14 Feb 2020 12:48:50 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) by hemlock.osuosl.org (Postfix) with ESMTPS id 469D487D54 for ; Fri, 14 Feb 2020 12:48:50 +0000 (UTC) Received: by mail-wm1-f53.google.com with SMTP id s10so9837136wmh.3 for ; Fri, 14 Feb 2020 04:48:50 -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=B2P7MGa5eFM7+8331KYIt/cu1o7TQdQzE+tLz7Jfevc9WW8f1znTYl+dRy/xEQLwtw FiUeCSpxDENRPoRtyK69ww7W/3Tu9tb4L6rUHfZ9pquiufMQvARE7LAcEXx+m9las5QP ORwitObFRVrpYqDtvDXKNr0oy6BtEaQR9s4fts/kRBKiSem84KEz3sRWljvYlUoSLcqM 8IDNHTDm868FhvaPw3/NnGItPK0+roP/ikJEh7i/5tWlCGi9uXgcaqh7J1tUc+FmnPvm z3FtB5B4yDyk1AeLy/4JN8TE0kgaoWEVnoSZe55ZDGMKe+3RG09SSaYywADq6kyvBO0x Dm7g== 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=YhT5TzSV3BYZC5Wneufxwna+8VYX/8xZfYO/JPR9CtLEHKLqTFkprzn0QcfPB48qFf JiRLvB+cAhzwu0V9huICqS+FWwo/vd6AjW4jQ0zY6iPCWFgeSMum1BucW8ANbp60MToq ifkGhybLd8wxfwaa4W4kOtZ9dWrtgwCVvnjs4XVDouEu2If2VAn4a4jGqy27OgZS0Rnk WnxgwLm284c0lVMlIMiTOZg1KUS/wdTmARUXiB5T7VktFfZy1rf8U4/JRuU6vwEFgz5P h9uy1A9pAKRfeeqPSlae9T3PoU5SQDDyejr6c9WUgUuBnT2hl9Pk2KFt3/5kT5leLJ18 Najw== X-Gm-Message-State: APjAAAU6kIKhB8tdKovp8FFqbD4p37wQ/YK4Ezc/J/W/oP8Um1jBUdE6 kB0AW3m3aseIpDgRIxo2CAnPH7fZ5iXGhQ== X-Google-Smtp-Source: APXvYqyMmrV5sMii51CV6gS6enUbLZZU0XeghHtl1lOMmoAdEgDAdh3r6/s1GG9NX6SsUxbhQsNgYA== X-Received: by 2002:a1c:6755:: with SMTP id b82mr4648319wmc.126.1581684528174; Fri, 14 Feb 2020 04:48:48 -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 o4sm6888928wrx.25.2020.02.14.04.48.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Feb 2020 04:48:47 -0800 (PST) From: Patrick Havelange To: buildroot@buildroot.org Date: Fri, 14 Feb 2020 13:48:27 +0100 Message-Id: <20200214124827.30767-10-patrick.havelange@essensium.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200214124827.30767-1-patrick.havelange@essensium.com> References: <20200214124827.30767-1-patrick.havelange@essensium.com> MIME-Version: 1.0 Subject: [Buildroot] [PATCH v2 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.