All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v2 01/10] package/pkg-cargo.mk: Introduce the cargo package infrastructure.
@ 2020-02-14 12:48 Patrick Havelange
  2020-02-14 12:48 ` [Buildroot] [PATCH v2 02/10] docs/manual/cargo: Update manual for cargo packages Patrick Havelange
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: Patrick Havelange @ 2020-02-14 12:48 UTC (permalink / raw)
  To: buildroot

In order to be package agnostic, the install phase is now using
cargo instead of install.

Signed-off-by: Patrick Havelange <patrick.havelange@essensium.com>

---
This is the V2 of the previously posted series :
http://patchwork.ozlabs.org/project/buildroot/list/?series=156166&state=%2A&archive=both

A lot of changes following the buildroot developer meeting's
decisions from February 2020.

Needs to be applied on top of the rust 1.40 bump
---
 package/Makefile.in  |  1 +
 package/pkg-cargo.mk | 89 ++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 90 insertions(+)
 create mode 100644 package/pkg-cargo.mk

diff --git a/package/Makefile.in b/package/Makefile.in
index 285e2837ef..650d7c166e 100644
--- a/package/Makefile.in
+++ b/package/Makefile.in
@@ -426,3 +426,4 @@ include package/pkg-kernel-module.mk
 include package/pkg-waf.mk
 include package/pkg-golang.mk
 include package/pkg-meson.mk
+include package/pkg-cargo.mk
diff --git a/package/pkg-cargo.mk b/package/pkg-cargo.mk
new file mode 100644
index 0000000000..2242f3a082
--- /dev/null
+++ b/package/pkg-cargo.mk
@@ -0,0 +1,89 @@
+################################################################################
+# Cargo package infrastructure
+#
+# This file implements an infrastructure that eases development of package
+# .mk files for Cargo packages. It should be used for all packages that use
+# Cargo as their build system.
+#
+# See the Buildroot documentation for details on the usage of this
+# infrastructure
+#
+# In terms of implementation, this Cargo 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 <PKG>_BUILD_CMDS is already defined,
+# it is used as the list of commands to perform to build the package,
+# instead of the default Cargo behaviour. The package can also define some
+# post operation hooks.
+#
+################################################################################
+
+################################################################################
+# inner-cargo-package -- defines how the configuration, compilation and
+# installation of a cargo package should be done, implements a few hooks
+# to tune the build process for cargo specifities 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-cargo-package
+
+# We need host-rustc to run cargo
+$(2)_DEPENDENCIES += host-rustc
+
+$(2)_CARGO_ENV = CARGO_HOME=$(HOST_DIR)/share/cargo
+$(2)_CARGO_MODE = $(if $(BR2_ENABLE_DEBUG),debug,release)
+
+ifeq ($(4),target)
+    $(2)_CARGO_TARGET_OPT = --target $$(RUSTC_TARGET_NAME)
+endif
+
+#
+# Build step. Only define it if not already defined by the package .mk
+# file.
+#
+ifndef $(2)_BUILD_CMDS
+define $(2)_BUILD_CMDS
+	$(TARGET_MAKE_ENV) $$($(2)_CARGO_ENV) \
+		cargo build \
+			--$$($(2)_CARGO_MODE) \
+			$$($(2)_CARGO_TARGET_OPT) \
+			--manifest-path $$(@D)/Cargo.toml
+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
+	$(TARGET_MAKE_ENV) $$($(2)_CARGO_ENV) \
+		cargo install \
+			--root $(TARGET_DIR)/usr/ \
+			--bins \
+			--path $$(@D) \
+			$$($(2)_CARGO_TARGET_OPT) \
+			--force
+endef
+endif
+
+# Call the generic package infrastructure to generate the necessary
+# make targets
+$(call inner-generic-package,$(1),$(2),$(3),$(4))
+
+endef
+
+################################################################################
+# cargo-package -- the target generator macro for Cargo packages
+################################################################################
+
+cargo-package = $(call inner-cargo-package,$(pkgname),$(call UPPERCASE,$(pkgname)),$(call UPPERCASE,$(pkgname)),target)
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [Buildroot] [PATCH v2 02/10] docs/manual/cargo: Update manual for cargo packages.
  2020-02-14 12:48 [Buildroot] [PATCH v2 01/10] package/pkg-cargo.mk: Introduce the cargo package infrastructure Patrick Havelange
@ 2020-02-14 12:48 ` Patrick Havelange
  2020-02-14 12:48 ` [Buildroot] [PATCH v2 03/10] package/ripgrep: convert to cargo infrastructure Patrick Havelange
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Patrick Havelange @ 2020-02-14 12:48 UTC (permalink / raw)
  To: buildroot

Signed-off-by: Patrick Havelange <patrick.havelange@essensium.com>
---
 docs/manual/adding-packages-cargo.txt | 54 +++++----------------------
 1 file changed, 10 insertions(+), 44 deletions(-)

diff --git a/docs/manual/adding-packages-cargo.txt b/docs/manual/adding-packages-cargo.txt
index bb078b6981..9a496224e3 100644
--- a/docs/manual/adding-packages-cargo.txt
+++ b/docs/manual/adding-packages-cargo.txt
@@ -27,9 +27,9 @@ The +Config.in+ file of Cargo-based package 'foo' should contain:
 
 ==== Cargo-based package's +.mk+ file
 
-Buildroot does not (yet) provide a dedicated package infrastructure for
-Cargo-based packages. So, we will explain how to write a +.mk+ file for such a
-package. Let's start with an example:
+Buildroot provides a dedicated package infrastructure for Cargo-based packages.
+So, we will explain how to write a +.mk+ file for such a package. Let's start
+with an example:
 
 ------------------------------
 01: ################################################################################
@@ -44,53 +44,19 @@ package. Let's start with an example:
 10: FOO_LICENSE = GPL-3.0+
 11: FOO_LICENSE_FILES = COPYING
 12:
-13: FOO_DEPENDENCIES = host-rustc
-14:
-15: FOO_CARGO_ENV = CARGO_HOME=$(HOST_DIR)/share/cargo
-16: FOO_CARGO_MODE = $(if $(BR2_ENABLE_DEBUG),debug,release)
-17:
-18: FOO_BIN_DIR = target/$(RUSTC_TARGET_NAME)/$(FOO_CARGO_MODE)
-19:
-20: FOO_CARGO_OPTS = \
-21:   --$(FOO_CARGO_MODE) \
-22: 	--target=$(RUSTC_TARGET_NAME) \
-23: 	--manifest-path=$(@D)/Cargo.toml
-24:
-25: define FOO_BUILD_CMDS
-26: 	$(TARGET_MAKE_ENV) $(FOO_CARGO_ENV) \
-27: 		cargo build $(FOO_CARGO_OPTS)
-28: endef
-29:
-30: define FOO_INSTALL_TARGET_CMDS
-31: 	$(INSTALL) -D -m 0755 $(@D)/$(FOO_BIN_DIR)/foo \
-32: 		$(TARGET_DIR)/usr/bin/foo
-33: endef
-34:
-35: $(eval $(generic-package))
+13: $(eval $(cargo-package))
 --------------------------------
 
 The Makefile starts with the definition of the standard variables for package
 declaration (lines 7 to 11).
 
-As seen in line 35, it is based on the
-xref:generic-package-tutorial[+generic-package+ infrastructure]. So, it defines
-the variables required by this particular infrastructure, where Cargo is
-invoked:
+As seen in line 13, 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.
 
-* +FOO_BUILD_CMDS+: Cargo is invoked to perform the build. The options required
-  to configure the cross-compilation of the package are passed via
-  +FOO_CONF_OPTS+.
-
-* +FOO_INSTALL_TARGET_CMDS+: The binary executable generated is installed on
-  the target.
-
-In order to have Cargo available for the build, +FOO_DEPENDENCIES+ needs to
-contain +host-cargo+.
-
-To sum it up, to add a new Cargo-based package, the Makefile example can be
-copied verbatim then edited to replace all occurences of +FOO+ with the
-uppercase name of the new package and update the values of the standard
-variables.
+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
 
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [Buildroot] [PATCH v2 03/10] package/ripgrep: convert to cargo infrastructure
  2020-02-14 12:48 [Buildroot] [PATCH v2 01/10] package/pkg-cargo.mk: Introduce the cargo package infrastructure Patrick Havelange
  2020-02-14 12:48 ` [Buildroot] [PATCH v2 02/10] docs/manual/cargo: Update manual for cargo packages Patrick Havelange
@ 2020-02-14 12:48 ` Patrick Havelange
  2020-02-14 12:48 ` [Buildroot] [PATCH v2 04/10] support/download/dl-wrapper: rework backend parsing Patrick Havelange
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Patrick Havelange @ 2020-02-14 12:48 UTC (permalink / raw)
  To: buildroot

Signed-off-by: Patrick Havelange <patrick.havelange@essensium.com>
---
 package/ripgrep/ripgrep.mk | 23 +----------------------
 1 file changed, 1 insertion(+), 22 deletions(-)

diff --git a/package/ripgrep/ripgrep.mk b/package/ripgrep/ripgrep.mk
index 832c076f26..97e9e2ce5f 100644
--- a/package/ripgrep/ripgrep.mk
+++ b/package/ripgrep/ripgrep.mk
@@ -9,25 +9,4 @@ RIPGREP_SITE = $(call github,burntsushi,ripgrep,$(RIPGREP_VERSION))
 RIPGREP_LICENSE = MIT
 RIPGREP_LICENSE_FILES = LICENSE-MIT
 
-RIPGREP_DEPENDENCIES = host-rustc
-RIPGREP_CARGO_ENV = CARGO_HOME=$(HOST_DIR)/share/cargo
-RIPGREP_CARGO_MODE = $(if $(BR2_ENABLE_DEBUG),debug,release)
-
-RIPGREP_BIN_DIR = target/$(RUSTC_TARGET_NAME)/$(RIPGREP_CARGO_MODE)
-
-RIPGREP_CARGO_OPTS = \
-	--$(RIPGREP_CARGO_MODE) \
-	--target=$(RUSTC_TARGET_NAME) \
-	--manifest-path=$(@D)/Cargo.toml
-
-define RIPGREP_BUILD_CMDS
-	$(TARGET_MAKE_ENV) $(RIPGREP_CARGO_ENV) \
-		cargo build $(RIPGREP_CARGO_OPTS)
-endef
-
-define RIPGREP_INSTALL_TARGET_CMDS
-	$(INSTALL) -D -m 0755 $(@D)/$(RIPGREP_BIN_DIR)/rg \
-		$(TARGET_DIR)/usr/bin/rg
-endef
-
-$(eval $(generic-package))
+$(eval $(cargo-package))
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [Buildroot] [PATCH v2 04/10] support/download/dl-wrapper: rework backend parsing
  2020-02-14 12:48 [Buildroot] [PATCH v2 01/10] package/pkg-cargo.mk: Introduce the cargo package infrastructure Patrick Havelange
  2020-02-14 12:48 ` [Buildroot] [PATCH v2 02/10] docs/manual/cargo: Update manual for cargo packages Patrick Havelange
  2020-02-14 12:48 ` [Buildroot] [PATCH v2 03/10] package/ripgrep: convert to cargo infrastructure Patrick Havelange
@ 2020-02-14 12:48 ` Patrick Havelange
  2020-02-14 12:48 ` [Buildroot] [PATCH v2 05/10] docs/manual/adding-packages-generic: update for new FOO_PKGMGR value Patrick Havelange
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Patrick Havelange @ 2020-02-14 12:48 UTC (permalink / raw)
  To: buildroot

The point of this modification is to be more generic in the way
the backends/options are parsed from the urls.
The '+' char serves as delimiter between the backends and the
actual url.
The '|' char serves as separator between the different
options or backends.
This will be useful later when more options or backends would be
needed.

pkg-generic.mk now passes the optional FOO_PKGMGR value in case a
package needs to use a second backend.

Signed-off-by: Patrick Havelange <patrick.havelange@essensium.com>
---
 package/pkg-generic.mk      |  2 +-
 support/download/dl-wrapper | 34 ++++++++++++++++++++++------------
 2 files changed, 23 insertions(+), 13 deletions(-)

diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk
index 268d999efb..a5038ebff4 100644
--- a/package/pkg-generic.mk
+++ b/package/pkg-generic.mk
@@ -541,7 +541,7 @@ ifndef $(2)_PATCH
 endif
 
 $(2)_ALL_DOWNLOADS = \
-	$$(if $$($(2)_SOURCE),$$($(2)_SITE_METHOD)+$$($(2)_SITE)/$$($(2)_SOURCE)) \
+	$$(if $$($(2)_SOURCE),$$($(2)_PKGMGR)$$($(2)_SITE_METHOD)+$$($(2)_SITE)/$$($(2)_SOURCE)) \
 	$$(foreach p,$$($(2)_PATCH) $$($(2)_EXTRA_DOWNLOADS),\
 		$$(if $$(findstring ://,$$(p)),$$(p),\
 			$$($(2)_SITE_METHOD)+$$($(2)_SITE)/$$(p)))
diff --git a/support/download/dl-wrapper b/support/download/dl-wrapper
index 3315bd410e..3f613bb622 100755
--- a/support/download/dl-wrapper
+++ b/support/download/dl-wrapper
@@ -21,8 +21,8 @@ export BR_BACKEND_DL_GETOPTS=":hc:d:o:n:N:H:ru:qf:e"
 
 main() {
     local OPT OPTARG
-    local backend output hfile recurse quiet rc
-    local -a uris
+    local backend backends_str output hfile recurse quiet rc backend2
+    local -a uris backends
 
     # Parse our options; anything after '--' is for the backend
     while getopts ":c:d:D:o:n:N:H:rf:u:q" OPT; do
@@ -85,18 +85,24 @@ main() {
     download_and_check=0
     rc=1
     for uri in "${uris[@]}"; do
-        backend_urlencode="${uri%%+*}"
-        backend="${backend_urlencode%|*}"
-        case "${backend}" in
-            git|svn|cvs|bzr|file|scp|hg) ;;
-            *) backend="wget" ;;
-        esac
+        urlencode=""
+        backend="wget"
+        backend2=""
+
+        # Extract the backends list, separated by '+' from the actual url
+        backends_str="${uri%%+*}"
+        # make an array out of it, backends are '|' separated
+        IFS='|' read -r -a backends <<< "${backends_str}"
+        # parse each of them, set flags and set the real backend
+        for b in "${backends[@]}" ; do
+            case "${b}" in
+                urlencode) urlencode="${b}" ;;
+                git|svn|cvs|bzr|file|scp|hg) backend="${b}" ;;
+                # insert here supported second backends) backend2="${b}" ;;
+            esac
+        done
         uri=${uri#*+}
 
-        urlencode=${backend_urlencode#*|}
-        # urlencode must be "urlencode"
-        [ "${urlencode}" != "urlencode" ] && urlencode=""
-
         # tmpd is a temporary directory in which backends may store
         # intermediate by-products of the download.
         # tmpf is the file in which the backends should put the downloaded
@@ -138,6 +144,10 @@ main() {
         # cd back to free the temp-dir, so we can remove it later
         cd "${OLDPWD}"
 
+        if [ -n "${backend2}" ] ; then
+	    support/download/${backend2} "${tmpf}" "${tmpd}" "${old_dl_dir}"
+        fi
+
         # Check if the downloaded file is sane, and matches the stored hashes
         # for that file
         if support/download/check-hash ${quiet} "${hfile}" "${tmpf}" "${output##*/}"; then
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [Buildroot] [PATCH v2 05/10] docs/manual/adding-packages-generic: update for new FOO_PKGMGR value
  2020-02-14 12:48 [Buildroot] [PATCH v2 01/10] package/pkg-cargo.mk: Introduce the cargo package infrastructure Patrick Havelange
                   ` (2 preceding siblings ...)
  2020-02-14 12:48 ` [Buildroot] [PATCH v2 04/10] support/download/dl-wrapper: rework backend parsing Patrick Havelange
@ 2020-02-14 12:48 ` Patrick Havelange
  2020-02-14 12:48 ` [Buildroot] [PATCH v2 06/10] package/pkg-cargo.mk: Introduce the cargo dl backend Patrick Havelange
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Patrick Havelange @ 2020-02-14 12:48 UTC (permalink / raw)
  To: buildroot

Signed-off-by: Patrick Havelange <patrick.havelange@essensium.com>
---
 docs/manual/adding-packages-generic.txt | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/docs/manual/adding-packages-generic.txt b/docs/manual/adding-packages-generic.txt
index baa052e31c..7fd58ed9a7 100644
--- a/docs/manual/adding-packages-generic.txt
+++ b/docs/manual/adding-packages-generic.txt
@@ -265,6 +265,13 @@ not and can not work as people would expect it should:
     +LIBFOO_SITE=/opt/software/libfoo.tar.gz+ +
     +LIBFOO_SITE=$(TOPDIR)/../src/libfoo+
 
+* +LIBFOO_PKGMGR+ may contain the name of the second backend used
+  to complete the sources tarball. This second backend is called after
+  the first archive has been generated (e.g. git) or simply downloaded
+  (wget). It can be useful in the case where some other files are
+  needed for the build and require to be downloaded by a specific tool.
+  The value of this variable must end with a '|' (serves as a separator).
+
 * +LIBFOO_DL_OPTS+ is a space-separated list of additional options to
   pass to the downloader. Useful for retrieving documents with
   server-side checking for user logins and passwords, or to use a proxy.
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [Buildroot] [PATCH v2 06/10] package/pkg-cargo.mk: Introduce the cargo dl backend
  2020-02-14 12:48 [Buildroot] [PATCH v2 01/10] package/pkg-cargo.mk: Introduce the cargo package infrastructure Patrick Havelange
                   ` (3 preceding siblings ...)
  2020-02-14 12:48 ` [Buildroot] [PATCH v2 05/10] docs/manual/adding-packages-generic: update for new FOO_PKGMGR value Patrick Havelange
@ 2020-02-14 12:48 ` Patrick Havelange
  2020-02-14 12:48 ` [Buildroot] [PATCH v2 07/10] docs/manual/adding-packages-cargo: update doc for new infra Patrick Havelange
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Patrick Havelange @ 2020-02-14 12:48 UTC (permalink / raw)
  To: buildroot

Cargo is now a fully supported PKGMGR, automatically set for any
package using the cargo infrastructure.
This effectively splits the download phase and the build phase.

The cargo backend will set CARGO_HOME inside DL_DIR during download.
The cached files in CARGO_HOME permits to download only once the
crates index and each dependencies.
During download phase, it will call cargo vendor to copy the
dependencies inside the VENDOR directory inside the source archive.

A local cargo config is also inserted inside the archive in order
to use the VENDOR dir during the build phase.
The build phase is forced to not query the online repository anymore
and thus will be using the vendored dependencies from the tarball.
This also permits to have offline builds.

Signed-off-by: Patrick Havelange <patrick.havelange@essensium.com>
---
 package/pkg-cargo.mk         | 10 ++++--
 package/ripgrep/ripgrep.hash |  2 +-
 support/download/cargo       | 65 ++++++++++++++++++++++++++++++++++++
 support/download/dl-wrapper  |  2 +-
 4 files changed, 75 insertions(+), 4 deletions(-)
 create mode 100755 support/download/cargo

diff --git a/package/pkg-cargo.mk b/package/pkg-cargo.mk
index 2242f3a082..3067b12a56 100644
--- a/package/pkg-cargo.mk
+++ b/package/pkg-cargo.mk
@@ -39,6 +39,8 @@ define inner-cargo-package
 # We need host-rustc to run cargo
 $(2)_DEPENDENCIES += host-rustc
 
+$(2)_PKGMGR = cargo\|
+
 $(2)_CARGO_ENV = CARGO_HOME=$(HOST_DIR)/share/cargo
 $(2)_CARGO_MODE = $(if $(BR2_ENABLE_DEBUG),debug,release)
 
@@ -52,11 +54,13 @@ endif
 #
 ifndef $(2)_BUILD_CMDS
 define $(2)_BUILD_CMDS
+	cd $$(@D) && \
 	$(TARGET_MAKE_ENV) $$($(2)_CARGO_ENV) \
 		cargo build \
 			--$$($(2)_CARGO_MODE) \
 			$$($(2)_CARGO_TARGET_OPT) \
-			--manifest-path $$(@D)/Cargo.toml
+			--manifest-path Cargo.toml \
+			--offline
 endef
 endif
 
@@ -66,12 +70,14 @@ endif
 #
 ifndef $(2)_INSTALL_TARGET_CMDS
 define $(2)_INSTALL_TARGET_CMDS
+	cd $$(@D) && \
 	$(TARGET_MAKE_ENV) $$($(2)_CARGO_ENV) \
 		cargo install \
 			--root $(TARGET_DIR)/usr/ \
 			--bins \
-			--path $$(@D) \
+			--path ./ \
 			$$($(2)_CARGO_TARGET_OPT) \
+			--offline \
 			--force
 endef
 endif
diff --git a/package/ripgrep/ripgrep.hash b/package/ripgrep/ripgrep.hash
index 0841c0185c..8c48458cd8 100644
--- a/package/ripgrep/ripgrep.hash
+++ b/package/ripgrep/ripgrep.hash
@@ -1,3 +1,3 @@
 # Locally calculated
-sha256 7035379fce0c1e32552e8ee528b92c3d01b8d3935ea31d26c51a73287be74bb3 ripgrep-0.8.1.tar.gz
+sha256 cb895cff182740c219fefbbaaf903e60f005a4ac4688cac1e43e5fbbbccc5a94 ripgrep-0.8.1.tar.gz
 sha256 0f96a83840e146e43c0ec96a22ec1f392e0680e6c1226e6f3ba87e0740af850f LICENSE-MIT
diff --git a/support/download/cargo b/support/download/cargo
new file mode 100755
index 0000000000..0ce94cf16b
--- /dev/null
+++ b/support/download/cargo
@@ -0,0 +1,65 @@
+#!/usr/bin/env bash
+
+# We want to catch any unexpected failure, and exit immediately
+set -e
+
+# Download helper for cargo package. It will populate the VENDOR directory
+# inside the archive with the dependencies of the package
+#
+# Arguments are in this order:
+# $1 mandatory fullpath to an already downloaded source file of a cargo package
+# $2 mandatory fullpath to a temp dir
+# $3 mandatory fullpath to the DL_DIR
+#
+# Environment:
+# cargo in PATH
+
+tmpd=""
+
+do_clean() {
+    if [ -n "${tmpd}" ]; then
+        rm -rf "${tmpd}"
+    fi
+}
+
+trap do_clean EXIT
+
+if [ $# -le 2 ] ; then
+    echo 'Need at least 3 arguments' >&2
+    exit 1
+fi;
+
+tmpd="$(mktemp -d -p "$2")"
+cd "${tmpd}"
+
+tar xf "${1}"
+cd ./*/
+echo "Running cargo vendor."
+CARGO_HOME="${3}"/cargo_home cargo vendor -q --locked VENDOR
+# Create the local .cargo/config with vendor info
+mkdir -p .cargo/
+cat <<EOF >.cargo/config
+[source.crates-io]
+replace-with = "vendored-sources"
+
+[source.vendored-sources]
+directory = "VENDOR"
+EOF
+
+cd ..
+
+# Generate the archive, sort with the C locale so that it is reproducible.
+find "$(basename "$OLDPWD")" -not -type d -print0 >files.list
+LC_ALL=C sort -z <files.list >files.list.sorted
+# let's use a fixed hardcoded date to be reproducible
+date="2020-02-06 01:02:03"
+
+# Create GNU-format tarballs, since that's the format of the tarballs on
+# sources.buildroot.org and used in the *.hash files
+echo "Creating final archive."
+tar cf new.tar --null --verbatim-files-from --numeric-owner --format=gnu \
+    --owner=0 --group=0 --mtime="${date}" -T files.list.sorted
+gzip -6 -n <new.tar >new.tar.gz
+mv "${1}" "${1}".old
+mv new.tar.gz "${1}"
+rm "${1}".old
diff --git a/support/download/dl-wrapper b/support/download/dl-wrapper
index 3f613bb622..5e52b3e60f 100755
--- a/support/download/dl-wrapper
+++ b/support/download/dl-wrapper
@@ -98,7 +98,7 @@ main() {
             case "${b}" in
                 urlencode) urlencode="${b}" ;;
                 git|svn|cvs|bzr|file|scp|hg) backend="${b}" ;;
-                # insert here supported second backends) backend2="${b}" ;;
+                cargo) backend2="${b}" ;;
             esac
         done
         uri=${uri#*+}
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [Buildroot] [PATCH v2 07/10] docs/manual/adding-packages-cargo: update doc for new infra
  2020-02-14 12:48 [Buildroot] [PATCH v2 01/10] package/pkg-cargo.mk: Introduce the cargo package infrastructure Patrick Havelange
                   ` (4 preceding siblings ...)
  2020-02-14 12:48 ` [Buildroot] [PATCH v2 06/10] package/pkg-cargo.mk: Introduce the cargo dl backend Patrick Havelange
@ 2020-02-14 12:48 ` Patrick Havelange
  2020-02-14 12:48 ` [Buildroot] [PATCH v2 08/10] package/ripgrep: bump to version 11.0.1 Patrick Havelange
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Patrick Havelange @ 2020-02-14 12:48 UTC (permalink / raw)
  To: buildroot

Signed-off-by: Patrick Havelange <patrick.havelange@essensium.com>
---
 docs/manual/adding-packages-cargo.txt | 16 ++++------------
 1 file changed, 4 insertions(+), 12 deletions(-)

diff --git a/docs/manual/adding-packages-cargo.txt b/docs/manual/adding-packages-cargo.txt
index 9a496224e3..e7d03eb7b5 100644
--- a/docs/manual/adding-packages-cargo.txt
+++ b/docs/manual/adding-packages-cargo.txt
@@ -61,16 +61,8 @@ Those will then replace the commands from the cargo infrastructure.
 ==== About Dependencies Management
 
 A crate can depend on other libraries from crates.io or git repositories, listed
-in its Cargo.toml file. Before starting a build, Cargo usually downloads
-automatically them. This step can also be performed independently, via the
-+cargo fetch+ command.
+in its Cargo.toml file. Before starting a build, the +cargo vendor+ command
+will be run and will take care of downloading those dependencies.
 
-Cargo maintains a local cache of the registry index and of git checkouts of the
-crates, whose location is given by +$CARGO_HOME+. As seen in the package
-Makefile example at line 15, this environment variable is set to
-+$(HOST_DIR)/share/cargo+.
-
-This dependency download mechanism is not convenient when performing an offline
-build, as Cargo will fail to fetch the dependencies. In that case, it is advised
-to generate a tarball of the dependencies using the +cargo vendor+ and add it to
-+FOO_EXTRA_DOWNLOADS+.
+The final source tarball will contain all the required dependencies, effectively
+permitting us to do an offline build.
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [Buildroot] [PATCH v2 08/10] package/ripgrep: bump to version 11.0.1
  2020-02-14 12:48 [Buildroot] [PATCH v2 01/10] package/pkg-cargo.mk: Introduce the cargo package infrastructure Patrick Havelange
                   ` (5 preceding siblings ...)
  2020-02-14 12:48 ` [Buildroot] [PATCH v2 07/10] docs/manual/adding-packages-cargo: update doc for new infra Patrick Havelange
@ 2020-02-14 12:48 ` Patrick Havelange
  2020-02-14 12:48 ` [Buildroot] [PATCH v2 09/10] package/ripgrep: add legal-info for dependencies Patrick Havelange
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Patrick Havelange @ 2020-02-14 12:48 UTC (permalink / raw)
  To: buildroot

This bump is needed because the old cached archive of the
tarball of ripgrep is still using the old format and can't
be used anymore (as the expected content of the final archive has
changed with the recent infrastructure changes for cargo packages).

Signed-off-by: Patrick Havelange <patrick.havelange@essensium.com>
---
 package/ripgrep/ripgrep.hash | 2 +-
 package/ripgrep/ripgrep.mk   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/package/ripgrep/ripgrep.hash b/package/ripgrep/ripgrep.hash
index 8c48458cd8..1e70cbae5a 100644
--- a/package/ripgrep/ripgrep.hash
+++ b/package/ripgrep/ripgrep.hash
@@ -1,3 +1,3 @@
 # Locally calculated
-sha256 cb895cff182740c219fefbbaaf903e60f005a4ac4688cac1e43e5fbbbccc5a94 ripgrep-0.8.1.tar.gz
+sha256 c02fe3077c95872175b098d002f872a619195436569a7dff443bbb605bc27474 ripgrep-11.0.1.tar.gz
 sha256 0f96a83840e146e43c0ec96a22ec1f392e0680e6c1226e6f3ba87e0740af850f LICENSE-MIT
diff --git a/package/ripgrep/ripgrep.mk b/package/ripgrep/ripgrep.mk
index 97e9e2ce5f..1023b4bad8 100644
--- a/package/ripgrep/ripgrep.mk
+++ b/package/ripgrep/ripgrep.mk
@@ -4,7 +4,7 @@
 #
 ################################################################################
 
-RIPGREP_VERSION = 0.8.1
+RIPGREP_VERSION = 11.0.1
 RIPGREP_SITE = $(call github,burntsushi,ripgrep,$(RIPGREP_VERSION))
 RIPGREP_LICENSE = MIT
 RIPGREP_LICENSE_FILES = LICENSE-MIT
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [Buildroot] [PATCH v2 09/10] package/ripgrep: add legal-info for dependencies
  2020-02-14 12:48 [Buildroot] [PATCH v2 01/10] package/pkg-cargo.mk: Introduce the cargo package infrastructure Patrick Havelange
                   ` (6 preceding siblings ...)
  2020-02-14 12:48 ` [Buildroot] [PATCH v2 08/10] package/ripgrep: bump to version 11.0.1 Patrick Havelange
@ 2020-02-14 12:48 ` Patrick Havelange
  2020-02-14 12:48 ` [Buildroot] [PATCH v2 10/10] docs/manual/adding-packages-cargo: Update for legal-info Patrick Havelange
  2020-02-17 23:45 ` [Buildroot] [PATCH v2 01/10] package/pkg-cargo.mk: Introduce the cargo package infrastructure Sam Voss
  9 siblings, 0 replies; 11+ messages in thread
From: Patrick Havelange @ 2020-02-14 12:48 UTC (permalink / raw)
  To: buildroot

As the dependencies are now vendored in the tarball, we can
extract them easily. Added a helper script to list them.
Updated the .hash & .mk files with those new licenses.

Signed-off-by: Patrick Havelange <patrick.havelange@essensium.com>
---
 package/ripgrep/find_vendor_licenses.sh |   6 +
 package/ripgrep/ripgrep.hash            | 167 +++++++++++++++++++++++
 package/ripgrep/ripgrep.mk              |   4 +-
 package/ripgrep/vendor.inc              | 169 ++++++++++++++++++++++++
 4 files changed, 345 insertions(+), 1 deletion(-)
 create mode 100755 package/ripgrep/find_vendor_licenses.sh
 create mode 100644 package/ripgrep/vendor.inc

diff --git a/package/ripgrep/find_vendor_licenses.sh b/package/ripgrep/find_vendor_licenses.sh
new file mode 100755
index 0000000000..fd8638e399
--- /dev/null
+++ b/package/ripgrep/find_vendor_licenses.sh
@@ -0,0 +1,6 @@
+#!/bin/sh
+# to run from the extracted final sources
+find VENDOR/ -type f \
+    \( -iname '*license*' -o -iname 'licence*' -o -iname 'copying*' -o -iname 'copyright*' \) \
+    -a -not -name '*.a' | \
+    sort
diff --git a/package/ripgrep/ripgrep.hash b/package/ripgrep/ripgrep.hash
index 1e70cbae5a..cad9fdc865 100644
--- a/package/ripgrep/ripgrep.hash
+++ b/package/ripgrep/ripgrep.hash
@@ -1,3 +1,170 @@
 # Locally calculated
 sha256 c02fe3077c95872175b098d002f872a619195436569a7dff443bbb605bc27474 ripgrep-11.0.1.tar.gz
 sha256 0f96a83840e146e43c0ec96a22ec1f392e0680e6c1226e6f3ba87e0740af850f LICENSE-MIT
+# Locally calculated with:
+# for i in $(find_vendor_licenses.sh) ; do echo -n "sha256 " ; sha256sum $i ; done | sort --key=3
+sha256 01c266bced4a434da0051174d6bee16a4c82cf634e2679b6155d40d75012390f  VENDOR/aho-corasick/COPYING
+sha256 0f96a83840e146e43c0ec96a22ec1f392e0680e6c1226e6f3ba87e0740af850f  VENDOR/aho-corasick/LICENSE-MIT
+sha256 7e12e5df4bae12cb21581ba157ced20e1986a0508dd10d0e8a4ab9a4cf94e85c  VENDOR/aho-corasick/UNLICENSE
+sha256 f3f8d32084848316048c5a1e125a3c5003eb32145a5f5f2a0d5586377324f9ba  VENDOR/atty/LICENSE
+sha256 a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2  VENDOR/autocfg/LICENSE-APACHE
+sha256 27995d58ad5c1145c1a8cd86244ce844886958a35eb2b78c6b772748669999ac  VENDOR/autocfg/LICENSE-MIT
+sha256 a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2  VENDOR/base64/LICENSE-APACHE
+sha256 0dd882e53de11566d50f8e8e2d5a651bcf3fabee4987d70f306233cf39094ba7  VENDOR/base64/LICENSE-MIT
+sha256 a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2  VENDOR/bitflags/LICENSE-APACHE
+sha256 6485b8ed310d3f0340bf1ad1f47645069ce4069dcc6bb46c7d5c6faf41de1fdb  VENDOR/bitflags/LICENSE-MIT
+sha256 13361f93b3db60ddb43f8fdc97ba469461019bbf7589f6bde833eb3d995d2497  VENDOR/bstr/COPYING
+sha256 a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2  VENDOR/bstr/LICENSE-APACHE
+sha256 0f96a83840e146e43c0ec96a22ec1f392e0680e6c1226e6f3ba87e0740af850f  VENDOR/bstr/LICENSE-MIT
+sha256 b40930bbcf80744c86c46a12bc9da056641d722716c378f5659b9e555ef833e1  VENDOR/bytecount/LICENSE.Apache2
+sha256 a5dea80c1f383cb5f80a6bb0da5e55a2beb9f24adb123ce6300af2cbaaa3bf65  VENDOR/bytecount/LICENSE.MIT
+sha256 01c266bced4a434da0051174d6bee16a4c82cf634e2679b6155d40d75012390f  VENDOR/byteorder/COPYING
+sha256 0f96a83840e146e43c0ec96a22ec1f392e0680e6c1226e6f3ba87e0740af850f  VENDOR/byteorder/LICENSE-MIT
+sha256 7e12e5df4bae12cb21581ba157ced20e1986a0508dd10d0e8a4ab9a4cf94e85c  VENDOR/byteorder/UNLICENSE
+sha256 a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2  VENDOR/cc/LICENSE-APACHE
+sha256 378f5840b258e2779c39418f3f2d7b2ba96f1c7917dd6be0713f88305dbda397  VENDOR/cc/LICENSE-MIT
+sha256 a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2  VENDOR/cfg-if/LICENSE-APACHE
+sha256 378f5840b258e2779c39418f3f2d7b2ba96f1c7917dd6be0713f88305dbda397  VENDOR/cfg-if/LICENSE-MIT
+sha256 6725d1437fc6c77301f2ff0e7d52914cf4f9509213e1078dc77d9356dbe6eac5  VENDOR/clap/LICENSE-MIT
+sha256 a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2  VENDOR/crossbeam-channel/LICENSE-APACHE
+sha256 23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3  VENDOR/crossbeam-channel/LICENSE-MIT
+sha256 924a49392dc8304def57586be4ebd69aaf51e16fd245b55b4b69ad2cce6b715a  VENDOR/crossbeam-channel/LICENSE-THIRD-PARTY
+sha256 a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2  VENDOR/crossbeam-utils/LICENSE-APACHE
+sha256 23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3  VENDOR/crossbeam-utils/LICENSE-MIT
+sha256 8b98376eb373dcf81950474efe34b5576a8171460dff500cc58a1ed8d160cd57  VENDOR/encoding_rs/COPYRIGHT
+sha256 13361f93b3db60ddb43f8fdc97ba469461019bbf7589f6bde833eb3d995d2497  VENDOR/encoding_rs_io/COPYING
+sha256 a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2  VENDOR/encoding_rs_io/LICENSE-APACHE
+sha256 0f96a83840e146e43c0ec96a22ec1f392e0680e6c1226e6f3ba87e0740af850f  VENDOR/encoding_rs_io/LICENSE-MIT
+sha256 cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30  VENDOR/encoding_rs/LICENSE-APACHE
+sha256 f2ad48641d9c997d9ae3b95d93d1cd6e1ab12ab4c44de89937c7bfabbd076a4a  VENDOR/encoding_rs/LICENSE-MIT
+sha256 a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2  VENDOR/fnv/LICENSE-APACHE
+sha256 65fdb6c76cd61612070c066eec9ecdb30ee74fb27859d0d9af58b9f499fd0c3e  VENDOR/fnv/LICENSE-MIT
+sha256 03b114f53e6587a398931762ee11e2395bfdba252a329940e2c8c9e81813845b  VENDOR/fuchsia-cprng/LICENSE
+sha256 a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2  VENDOR/glob/LICENSE-APACHE
+sha256 6485b8ed310d3f0340bf1ad1f47645069ce4069dcc6bb46c7d5c6faf41de1fdb  VENDOR/glob/LICENSE-MIT
+sha256 a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2  VENDOR/itoa/LICENSE-APACHE
+sha256 23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3  VENDOR/itoa/LICENSE-MIT
+sha256 a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2  VENDOR/lazy_static/LICENSE-APACHE
+sha256 0621878e61f0d0fda054bcbe02df75192c28bde1ecc8289cbd86aeba2dd72720  VENDOR/lazy_static/LICENSE-MIT
+sha256 a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2  VENDOR/libc/LICENSE-APACHE
+sha256 6485b8ed310d3f0340bf1ad1f47645069ce4069dcc6bb46c7d5c6faf41de1fdb  VENDOR/libc/LICENSE-MIT
+sha256 a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2  VENDOR/log/LICENSE-APACHE
+sha256 6485b8ed310d3f0340bf1ad1f47645069ce4069dcc6bb46c7d5c6faf41de1fdb  VENDOR/log/LICENSE-MIT
+sha256 01c266bced4a434da0051174d6bee16a4c82cf634e2679b6155d40d75012390f  VENDOR/memchr/COPYING
+sha256 0f96a83840e146e43c0ec96a22ec1f392e0680e6c1226e6f3ba87e0740af850f  VENDOR/memchr/LICENSE-MIT
+sha256 7e12e5df4bae12cb21581ba157ced20e1986a0508dd10d0e8a4ab9a4cf94e85c  VENDOR/memchr/UNLICENSE
+sha256 04ea4849dba9dcae07113850c6f1b1a69052c625210639914eee352023f750ad  VENDOR/memmap/LICENSE-APACHE
+sha256 bd1d8f06a6ce1f7645991e347b95864b970eed43624305eb4bb78c09aef8692d  VENDOR/memmap/LICENSE-MIT
+sha256 a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2  VENDOR/num_cpus/LICENSE-APACHE
+sha256 0593d22d122d4bfec6407115e3907546312976f75473417aaa4c57ecd2095ae6  VENDOR/num_cpus/LICENSE-MIT
+sha256 a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2  VENDOR/packed_simd/LICENSE-APACHE
+sha256 6485b8ed310d3f0340bf1ad1f47645069ce4069dcc6bb46c7d5c6faf41de1fdb  VENDOR/packed_simd/LICENSE-MIT
+sha256 01c266bced4a434da0051174d6bee16a4c82cf634e2679b6155d40d75012390f  VENDOR/pcre2/COPYING
+sha256 cb3c929a05e6cbc9de9ab06a4c57eeb60ca8c724bef6c138c87d3a577e27aa14  VENDOR/pcre2/LICENSE-MIT
+sha256 01c266bced4a434da0051174d6bee16a4c82cf634e2679b6155d40d75012390f  VENDOR/pcre2-sys/COPYING
+sha256 cb3c929a05e6cbc9de9ab06a4c57eeb60ca8c724bef6c138c87d3a577e27aa14  VENDOR/pcre2-sys/LICENSE-MIT
+sha256 46cde7dc11e64c78d650b4851b88f6704b4665ff60f22a1caf68ceb15e217e5b  VENDOR/pcre2-sys/pcre2/cmake/COPYING-CMAKE-SCRIPTS
+sha256 99272c55f3dcfa07a8a7e15a5c1a33096e4727de74241d65fa049fccfdd59507  VENDOR/pcre2-sys/pcre2/COPYING
+sha256 c4a8b89cd38d6a7501d5b11a472fa15e71a051b66d6331c6cda364101389d6ee  VENDOR/pcre2-sys/pcre2/LICENCE
+sha256 7e12e5df4bae12cb21581ba157ced20e1986a0508dd10d0e8a4ab9a4cf94e85c  VENDOR/pcre2-sys/UNLICENSE
+sha256 7e12e5df4bae12cb21581ba157ced20e1986a0508dd10d0e8a4ab9a4cf94e85c  VENDOR/pcre2/UNLICENSE
+sha256 a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2  VENDOR/pkg-config/LICENSE-APACHE
+sha256 378f5840b258e2779c39418f3f2d7b2ba96f1c7917dd6be0713f88305dbda397  VENDOR/pkg-config/LICENSE-MIT
+sha256 a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2  VENDOR/proc-macro2/LICENSE-APACHE
+sha256 378f5840b258e2779c39418f3f2d7b2ba96f1c7917dd6be0713f88305dbda397  VENDOR/proc-macro2/LICENSE-MIT
+sha256 a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2  VENDOR/quote/LICENSE-APACHE
+sha256 c9a75f18b9ab2927829a208fc6aa2cf4e63b8420887ba29cdb265d6619ae82d5  VENDOR/quote/LICENSE-MIT
+sha256 90eb64f0279b0d9432accfa6023ff803bc4965212383697eee27a0f426d5f8d5  VENDOR/rand_chacha/COPYRIGHT
+sha256 aaff376532ea30a0cd5330b9502ad4a4c8bf769c539c87ffe78819d188a18ebf  VENDOR/rand_chacha/LICENSE-APACHE
+sha256 209fbbe0ad52d9235e37badf9cadfe4dbdc87203179c0899e738b39ade42177b  VENDOR/rand_chacha/LICENSE-MIT
+sha256 90eb64f0279b0d9432accfa6023ff803bc4965212383697eee27a0f426d5f8d5  VENDOR/rand/COPYRIGHT
+sha256 90eb64f0279b0d9432accfa6023ff803bc4965212383697eee27a0f426d5f8d5  VENDOR/rand_core-0.3.1/COPYRIGHT
+sha256 aaff376532ea30a0cd5330b9502ad4a4c8bf769c539c87ffe78819d188a18ebf  VENDOR/rand_core-0.3.1/LICENSE-APACHE
+sha256 209fbbe0ad52d9235e37badf9cadfe4dbdc87203179c0899e738b39ade42177b  VENDOR/rand_core-0.3.1/LICENSE-MIT
+sha256 90eb64f0279b0d9432accfa6023ff803bc4965212383697eee27a0f426d5f8d5  VENDOR/rand_core/COPYRIGHT
+sha256 aaff376532ea30a0cd5330b9502ad4a4c8bf769c539c87ffe78819d188a18ebf  VENDOR/rand_core/LICENSE-APACHE
+sha256 209fbbe0ad52d9235e37badf9cadfe4dbdc87203179c0899e738b39ade42177b  VENDOR/rand_core/LICENSE-MIT
+sha256 90eb64f0279b0d9432accfa6023ff803bc4965212383697eee27a0f426d5f8d5  VENDOR/rand_hc/COPYRIGHT
+sha256 aaff376532ea30a0cd5330b9502ad4a4c8bf769c539c87ffe78819d188a18ebf  VENDOR/rand_hc/LICENSE-APACHE
+sha256 a771e4354f6b3ad4c92da1a5c9a239b6c291527db869632ecea4f20e24ca1135  VENDOR/rand_hc/LICENSE-MIT
+sha256 90eb64f0279b0d9432accfa6023ff803bc4965212383697eee27a0f426d5f8d5  VENDOR/rand_isaac/COPYRIGHT
+sha256 aaff376532ea30a0cd5330b9502ad4a4c8bf769c539c87ffe78819d188a18ebf  VENDOR/rand_isaac/LICENSE-APACHE
+sha256 209fbbe0ad52d9235e37badf9cadfe4dbdc87203179c0899e738b39ade42177b  VENDOR/rand_isaac/LICENSE-MIT
+sha256 90eb64f0279b0d9432accfa6023ff803bc4965212383697eee27a0f426d5f8d5  VENDOR/rand_jitter/COPYRIGHT
+sha256 aaff376532ea30a0cd5330b9502ad4a4c8bf769c539c87ffe78819d188a18ebf  VENDOR/rand_jitter/LICENSE-APACHE
+sha256 209fbbe0ad52d9235e37badf9cadfe4dbdc87203179c0899e738b39ade42177b  VENDOR/rand_jitter/LICENSE-MIT
+sha256 aaff376532ea30a0cd5330b9502ad4a4c8bf769c539c87ffe78819d188a18ebf  VENDOR/rand/LICENSE-APACHE
+sha256 209fbbe0ad52d9235e37badf9cadfe4dbdc87203179c0899e738b39ade42177b  VENDOR/rand/LICENSE-MIT
+sha256 90eb64f0279b0d9432accfa6023ff803bc4965212383697eee27a0f426d5f8d5  VENDOR/rand_os/COPYRIGHT
+sha256 aaff376532ea30a0cd5330b9502ad4a4c8bf769c539c87ffe78819d188a18ebf  VENDOR/rand_os/LICENSE-APACHE
+sha256 209fbbe0ad52d9235e37badf9cadfe4dbdc87203179c0899e738b39ade42177b  VENDOR/rand_os/LICENSE-MIT
+sha256 90eb64f0279b0d9432accfa6023ff803bc4965212383697eee27a0f426d5f8d5  VENDOR/rand_pcg/COPYRIGHT
+sha256 aaff376532ea30a0cd5330b9502ad4a4c8bf769c539c87ffe78819d188a18ebf  VENDOR/rand_pcg/LICENSE-APACHE
+sha256 2234e3cefee876aeb686ad89e978bdb07bf118a1186ab1cf161bcdf69d4b4f57  VENDOR/rand_pcg/LICENSE-MIT
+sha256 90eb64f0279b0d9432accfa6023ff803bc4965212383697eee27a0f426d5f8d5  VENDOR/rand_xorshift/COPYRIGHT
+sha256 aaff376532ea30a0cd5330b9502ad4a4c8bf769c539c87ffe78819d188a18ebf  VENDOR/rand_xorshift/LICENSE-APACHE
+sha256 209fbbe0ad52d9235e37badf9cadfe4dbdc87203179c0899e738b39ade42177b  VENDOR/rand_xorshift/LICENSE-MIT
+sha256 00d7b0c8bf95ea93162fccc84da96b906b15add708eade04f7ee6141f7b53141  VENDOR/rdrand/LICENSE
+sha256 efcfee7981ff72431fffb06925cad00a23dce079ed4354f61030ad5abdb78829  VENDOR/redox_syscall/LICENSE
+sha256 cb46b697c3fd9d27d7bfe1b1ad48f8a58a284984504c6eb215ae2164538df7cb  VENDOR/redox_termios/LICENSE
+sha256 01c266bced4a434da0051174d6bee16a4c82cf634e2679b6155d40d75012390f  VENDOR/regex-automata/COPYING
+sha256 58cf078acc03da3e280a938c2bd9943f554fc9b6ced89ad93ba35ca436872899  VENDOR/regex-automata/data/fowler-tests/LICENSE
+sha256 58cf078acc03da3e280a938c2bd9943f554fc9b6ced89ad93ba35ca436872899  VENDOR/regex-automata/data/tests/fowler/LICENSE
+sha256 0f96a83840e146e43c0ec96a22ec1f392e0680e6c1226e6f3ba87e0740af850f  VENDOR/regex-automata/LICENSE-MIT
+sha256 7e12e5df4bae12cb21581ba157ced20e1986a0508dd10d0e8a4ab9a4cf94e85c  VENDOR/regex-automata/UNLICENSE
+sha256 a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2  VENDOR/regex/LICENSE-APACHE
+sha256 6485b8ed310d3f0340bf1ad1f47645069ce4069dcc6bb46c7d5c6faf41de1fdb  VENDOR/regex/LICENSE-MIT
+sha256 58cf078acc03da3e280a938c2bd9943f554fc9b6ced89ad93ba35ca436872899  VENDOR/regex/src/testdata/LICENSE
+sha256 a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2  VENDOR/regex-syntax/LICENSE-APACHE
+sha256 6485b8ed310d3f0340bf1ad1f47645069ce4069dcc6bb46c7d5c6faf41de1fdb  VENDOR/regex-syntax/LICENSE-MIT
+sha256 74db5baf44a41b1000312c673544b3374e4198af5605c7f9080a402cec42cfa3  VENDOR/regex-syntax/src/unicode_tables/LICENSE-UNICODE
+sha256 c6c8c9dbe29fb4d68d829c7a402f9f6baae3472ecf107cc2a57c75a9a8d1b85c  VENDOR/remove_dir_all/LICENCE-APACHE
+sha256 db264505cb1856383e255c8373da9e5aeadc1cd92b570fcc94fd1fb7d892db78  VENDOR/remove_dir_all/LICENCE-MIT
+sha256 c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4  VENDOR/ryu/LICENSE-APACHE
+sha256 c9bff75738922193e67fa726fa225535870d2aa1059f91452c411736284ad566  VENDOR/ryu/LICENSE-BOOST
+sha256 01c266bced4a434da0051174d6bee16a4c82cf634e2679b6155d40d75012390f  VENDOR/same-file/COPYING
+sha256 cb3c929a05e6cbc9de9ab06a4c57eeb60ca8c724bef6c138c87d3a577e27aa14  VENDOR/same-file/LICENSE-MIT
+sha256 7e12e5df4bae12cb21581ba157ced20e1986a0508dd10d0e8a4ab9a4cf94e85c  VENDOR/same-file/UNLICENSE
+sha256 a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2  VENDOR/serde_derive/LICENSE-APACHE
+sha256 23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3  VENDOR/serde_derive/LICENSE-MIT
+sha256 a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2  VENDOR/serde_json/LICENSE-APACHE
+sha256 23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3  VENDOR/serde_json/LICENSE-MIT
+sha256 a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2  VENDOR/serde/LICENSE-APACHE
+sha256 23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3  VENDOR/serde/LICENSE-MIT
+sha256 a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2  VENDOR/smallvec/LICENSE-APACHE
+sha256 0b28172679e0009b655da42797c03fd163a3379d5cfa67ba1f1655e974a2a1a9  VENDOR/smallvec/LICENSE-MIT
+sha256 1738b51502ae831fb59ffbeb22ebdd90bf17e5c72fe57c00b47552415f133fd8  VENDOR/strsim/LICENSE
+sha256 a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2  VENDOR/syn/LICENSE-APACHE
+sha256 23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3  VENDOR/syn/LICENSE-MIT
+sha256 a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2  VENDOR/tempfile/LICENSE-APACHE
+sha256 8b427f5bc501764575e52ba4f9d95673cf8f6d80a86d0d06599852e1a9a20a36  VENDOR/tempfile/LICENSE-MIT
+sha256 01c266bced4a434da0051174d6bee16a4c82cf634e2679b6155d40d75012390f  VENDOR/termcolor/COPYING
+sha256 0f96a83840e146e43c0ec96a22ec1f392e0680e6c1226e6f3ba87e0740af850f  VENDOR/termcolor/LICENSE-MIT
+sha256 7e12e5df4bae12cb21581ba157ced20e1986a0508dd10d0e8a4ab9a4cf94e85c  VENDOR/termcolor/UNLICENSE
+sha256 6252f0c8d4a0df9b2dc0c6464cb2489dbe8859b0eb727e19c14e6af1ee432394  VENDOR/termion/LICENSE
+sha256 ce93600c49fbb3e14df32efe752264644f6a2f8e08a735ba981725799e5309ef  VENDOR/textwrap/LICENSE
+sha256 a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2  VENDOR/thread_local/LICENSE-APACHE
+sha256 c9a75f18b9ab2927829a208fc6aa2cf4e63b8420887ba29cdb265d6619ae82d5  VENDOR/thread_local/LICENSE-MIT
+sha256 a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2  VENDOR/ucd-util/LICENSE-APACHE
+sha256 0f96a83840e146e43c0ec96a22ec1f392e0680e6c1226e6f3ba87e0740af850f  VENDOR/ucd-util/LICENSE-MIT
+sha256 ea8df489e83b7674d5c9d50c320bec3b15d2e2eeb7a3a8879a666d91e5640c16  VENDOR/ucd-util/LICENSE-UNICODE
+sha256 23860c2a7b5d96b21569afedf033469bab9fe14a1b24a35068b8641c578ce24d  VENDOR/unicode-width/COPYRIGHT
+sha256 a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2  VENDOR/unicode-width/LICENSE-APACHE
+sha256 7b63ecd5f1902af1b63729947373683c32745c16a10e8e6292e2e2dcd7e90ae0  VENDOR/unicode-width/LICENSE-MIT
+sha256 23860c2a7b5d96b21569afedf033469bab9fe14a1b24a35068b8641c578ce24d  VENDOR/unicode-xid/COPYRIGHT
+sha256 a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2  VENDOR/unicode-xid/LICENSE-APACHE
+sha256 7b63ecd5f1902af1b63729947373683c32745c16a10e8e6292e2e2dcd7e90ae0  VENDOR/unicode-xid/LICENSE-MIT
+sha256 01c266bced4a434da0051174d6bee16a4c82cf634e2679b6155d40d75012390f  VENDOR/utf8-ranges/COPYING
+sha256 0f96a83840e146e43c0ec96a22ec1f392e0680e6c1226e6f3ba87e0740af850f  VENDOR/utf8-ranges/LICENSE-MIT
+sha256 7e12e5df4bae12cb21581ba157ced20e1986a0508dd10d0e8a4ab9a4cf94e85c  VENDOR/utf8-ranges/UNLICENSE
+sha256 01c266bced4a434da0051174d6bee16a4c82cf634e2679b6155d40d75012390f  VENDOR/walkdir/COPYING
+sha256 0f96a83840e146e43c0ec96a22ec1f392e0680e6c1226e6f3ba87e0740af850f  VENDOR/walkdir/LICENSE-MIT
+sha256 7e12e5df4bae12cb21581ba157ced20e1986a0508dd10d0e8a4ab9a4cf94e85c  VENDOR/walkdir/UNLICENSE
+sha256 b40930bbcf80744c86c46a12bc9da056641d722716c378f5659b9e555ef833e1  VENDOR/winapi/LICENSE-APACHE
+sha256 ce7bc3499fee93d5022ef430d5e4201e79a6d9154f3974e42f41349f0569e09b  VENDOR/winapi/LICENSE-MIT
+sha256 01c266bced4a434da0051174d6bee16a4c82cf634e2679b6155d40d75012390f  VENDOR/winapi-util/COPYING
+sha256 cb3c929a05e6cbc9de9ab06a4c57eeb60ca8c724bef6c138c87d3a577e27aa14  VENDOR/winapi-util/LICENSE-MIT
+sha256 7e12e5df4bae12cb21581ba157ced20e1986a0508dd10d0e8a4ab9a4cf94e85c  VENDOR/winapi-util/UNLICENSE
+sha256 01c266bced4a434da0051174d6bee16a4c82cf634e2679b6155d40d75012390f  VENDOR/wincolor/COPYING
+sha256 0f96a83840e146e43c0ec96a22ec1f392e0680e6c1226e6f3ba87e0740af850f  VENDOR/wincolor/LICENSE-MIT
+sha256 7e12e5df4bae12cb21581ba157ced20e1986a0508dd10d0e8a4ab9a4cf94e85c  VENDOR/wincolor/UNLICENSE
diff --git a/package/ripgrep/ripgrep.mk b/package/ripgrep/ripgrep.mk
index 1023b4bad8..3be143e15c 100644
--- a/package/ripgrep/ripgrep.mk
+++ b/package/ripgrep/ripgrep.mk
@@ -4,9 +4,11 @@
 #
 ################################################################################
 
+include package/ripgrep/vendor.inc
+
 RIPGREP_VERSION = 11.0.1
 RIPGREP_SITE = $(call github,burntsushi,ripgrep,$(RIPGREP_VERSION))
 RIPGREP_LICENSE = MIT
-RIPGREP_LICENSE_FILES = LICENSE-MIT
+RIPGREP_LICENSE_FILES = LICENSE-MIT $(RIPGREP_VENDOR_LICENSE_FILES)
 
 $(eval $(cargo-package))
diff --git a/package/ripgrep/vendor.inc b/package/ripgrep/vendor.inc
new file mode 100644
index 0000000000..df131ac533
--- /dev/null
+++ b/package/ripgrep/vendor.inc
@@ -0,0 +1,169 @@
+# Generated with:
+# (echo "RIPGREP_VENDOR_LICENSE_FILES = \\" ; \
+# 	find_vendor_licenses.sh | sed 's%^\(.*\)$%\t\1 \\%') 
+RIPGREP_VENDOR_LICENSE_FILES = \
+	VENDOR/aho-corasick/COPYING \
+	VENDOR/aho-corasick/LICENSE-MIT \
+	VENDOR/aho-corasick/UNLICENSE \
+	VENDOR/atty/LICENSE \
+	VENDOR/autocfg/LICENSE-APACHE \
+	VENDOR/autocfg/LICENSE-MIT \
+	VENDOR/base64/LICENSE-APACHE \
+	VENDOR/base64/LICENSE-MIT \
+	VENDOR/bitflags/LICENSE-APACHE \
+	VENDOR/bitflags/LICENSE-MIT \
+	VENDOR/bstr/COPYING \
+	VENDOR/bstr/LICENSE-APACHE \
+	VENDOR/bstr/LICENSE-MIT \
+	VENDOR/bytecount/LICENSE.Apache2 \
+	VENDOR/bytecount/LICENSE.MIT \
+	VENDOR/byteorder/COPYING \
+	VENDOR/byteorder/LICENSE-MIT \
+	VENDOR/byteorder/UNLICENSE \
+	VENDOR/cc/LICENSE-APACHE \
+	VENDOR/cc/LICENSE-MIT \
+	VENDOR/cfg-if/LICENSE-APACHE \
+	VENDOR/cfg-if/LICENSE-MIT \
+	VENDOR/clap/LICENSE-MIT \
+	VENDOR/crossbeam-channel/LICENSE-APACHE \
+	VENDOR/crossbeam-channel/LICENSE-MIT \
+	VENDOR/crossbeam-channel/LICENSE-THIRD-PARTY \
+	VENDOR/crossbeam-utils/LICENSE-APACHE \
+	VENDOR/crossbeam-utils/LICENSE-MIT \
+	VENDOR/encoding_rs/COPYRIGHT \
+	VENDOR/encoding_rs_io/COPYING \
+	VENDOR/encoding_rs_io/LICENSE-APACHE \
+	VENDOR/encoding_rs_io/LICENSE-MIT \
+	VENDOR/encoding_rs/LICENSE-APACHE \
+	VENDOR/encoding_rs/LICENSE-MIT \
+	VENDOR/fnv/LICENSE-APACHE \
+	VENDOR/fnv/LICENSE-MIT \
+	VENDOR/fuchsia-cprng/LICENSE \
+	VENDOR/glob/LICENSE-APACHE \
+	VENDOR/glob/LICENSE-MIT \
+	VENDOR/itoa/LICENSE-APACHE \
+	VENDOR/itoa/LICENSE-MIT \
+	VENDOR/lazy_static/LICENSE-APACHE \
+	VENDOR/lazy_static/LICENSE-MIT \
+	VENDOR/libc/LICENSE-APACHE \
+	VENDOR/libc/LICENSE-MIT \
+	VENDOR/log/LICENSE-APACHE \
+	VENDOR/log/LICENSE-MIT \
+	VENDOR/memchr/COPYING \
+	VENDOR/memchr/LICENSE-MIT \
+	VENDOR/memchr/UNLICENSE \
+	VENDOR/memmap/LICENSE-APACHE \
+	VENDOR/memmap/LICENSE-MIT \
+	VENDOR/num_cpus/LICENSE-APACHE \
+	VENDOR/num_cpus/LICENSE-MIT \
+	VENDOR/packed_simd/LICENSE-APACHE \
+	VENDOR/packed_simd/LICENSE-MIT \
+	VENDOR/pcre2/COPYING \
+	VENDOR/pcre2/LICENSE-MIT \
+	VENDOR/pcre2-sys/COPYING \
+	VENDOR/pcre2-sys/LICENSE-MIT \
+	VENDOR/pcre2-sys/pcre2/cmake/COPYING-CMAKE-SCRIPTS \
+	VENDOR/pcre2-sys/pcre2/COPYING \
+	VENDOR/pcre2-sys/pcre2/LICENCE \
+	VENDOR/pcre2-sys/UNLICENSE \
+	VENDOR/pcre2/UNLICENSE \
+	VENDOR/pkg-config/LICENSE-APACHE \
+	VENDOR/pkg-config/LICENSE-MIT \
+	VENDOR/proc-macro2/LICENSE-APACHE \
+	VENDOR/proc-macro2/LICENSE-MIT \
+	VENDOR/quote/LICENSE-APACHE \
+	VENDOR/quote/LICENSE-MIT \
+	VENDOR/rand_chacha/COPYRIGHT \
+	VENDOR/rand_chacha/LICENSE-APACHE \
+	VENDOR/rand_chacha/LICENSE-MIT \
+	VENDOR/rand/COPYRIGHT \
+	VENDOR/rand_core-0.3.1/COPYRIGHT \
+	VENDOR/rand_core-0.3.1/LICENSE-APACHE \
+	VENDOR/rand_core-0.3.1/LICENSE-MIT \
+	VENDOR/rand_core/COPYRIGHT \
+	VENDOR/rand_core/LICENSE-APACHE \
+	VENDOR/rand_core/LICENSE-MIT \
+	VENDOR/rand_hc/COPYRIGHT \
+	VENDOR/rand_hc/LICENSE-APACHE \
+	VENDOR/rand_hc/LICENSE-MIT \
+	VENDOR/rand_isaac/COPYRIGHT \
+	VENDOR/rand_isaac/LICENSE-APACHE \
+	VENDOR/rand_isaac/LICENSE-MIT \
+	VENDOR/rand_jitter/COPYRIGHT \
+	VENDOR/rand_jitter/LICENSE-APACHE \
+	VENDOR/rand_jitter/LICENSE-MIT \
+	VENDOR/rand/LICENSE-APACHE \
+	VENDOR/rand/LICENSE-MIT \
+	VENDOR/rand_os/COPYRIGHT \
+	VENDOR/rand_os/LICENSE-APACHE \
+	VENDOR/rand_os/LICENSE-MIT \
+	VENDOR/rand_pcg/COPYRIGHT \
+	VENDOR/rand_pcg/LICENSE-APACHE \
+	VENDOR/rand_pcg/LICENSE-MIT \
+	VENDOR/rand_xorshift/COPYRIGHT \
+	VENDOR/rand_xorshift/LICENSE-APACHE \
+	VENDOR/rand_xorshift/LICENSE-MIT \
+	VENDOR/rdrand/LICENSE \
+	VENDOR/redox_syscall/LICENSE \
+	VENDOR/redox_termios/LICENSE \
+	VENDOR/regex-automata/COPYING \
+	VENDOR/regex-automata/data/fowler-tests/LICENSE \
+	VENDOR/regex-automata/data/tests/fowler/LICENSE \
+	VENDOR/regex-automata/LICENSE-MIT \
+	VENDOR/regex-automata/UNLICENSE \
+	VENDOR/regex/LICENSE-APACHE \
+	VENDOR/regex/LICENSE-MIT \
+	VENDOR/regex/src/testdata/LICENSE \
+	VENDOR/regex-syntax/LICENSE-APACHE \
+	VENDOR/regex-syntax/LICENSE-MIT \
+	VENDOR/regex-syntax/src/unicode_tables/LICENSE-UNICODE \
+	VENDOR/remove_dir_all/LICENCE-APACHE \
+	VENDOR/remove_dir_all/LICENCE-MIT \
+	VENDOR/ryu/LICENSE-APACHE \
+	VENDOR/ryu/LICENSE-BOOST \
+	VENDOR/same-file/COPYING \
+	VENDOR/same-file/LICENSE-MIT \
+	VENDOR/same-file/UNLICENSE \
+	VENDOR/serde_derive/LICENSE-APACHE \
+	VENDOR/serde_derive/LICENSE-MIT \
+	VENDOR/serde_json/LICENSE-APACHE \
+	VENDOR/serde_json/LICENSE-MIT \
+	VENDOR/serde/LICENSE-APACHE \
+	VENDOR/serde/LICENSE-MIT \
+	VENDOR/smallvec/LICENSE-APACHE \
+	VENDOR/smallvec/LICENSE-MIT \
+	VENDOR/strsim/LICENSE \
+	VENDOR/syn/LICENSE-APACHE \
+	VENDOR/syn/LICENSE-MIT \
+	VENDOR/tempfile/LICENSE-APACHE \
+	VENDOR/tempfile/LICENSE-MIT \
+	VENDOR/termcolor/COPYING \
+	VENDOR/termcolor/LICENSE-MIT \
+	VENDOR/termcolor/UNLICENSE \
+	VENDOR/termion/LICENSE \
+	VENDOR/textwrap/LICENSE \
+	VENDOR/thread_local/LICENSE-APACHE \
+	VENDOR/thread_local/LICENSE-MIT \
+	VENDOR/ucd-util/LICENSE-APACHE \
+	VENDOR/ucd-util/LICENSE-MIT \
+	VENDOR/ucd-util/LICENSE-UNICODE \
+	VENDOR/unicode-width/COPYRIGHT \
+	VENDOR/unicode-width/LICENSE-APACHE \
+	VENDOR/unicode-width/LICENSE-MIT \
+	VENDOR/unicode-xid/COPYRIGHT \
+	VENDOR/unicode-xid/LICENSE-APACHE \
+	VENDOR/unicode-xid/LICENSE-MIT \
+	VENDOR/utf8-ranges/COPYING \
+	VENDOR/utf8-ranges/LICENSE-MIT \
+	VENDOR/utf8-ranges/UNLICENSE \
+	VENDOR/walkdir/COPYING \
+	VENDOR/walkdir/LICENSE-MIT \
+	VENDOR/walkdir/UNLICENSE \
+	VENDOR/winapi/LICENSE-APACHE \
+	VENDOR/winapi/LICENSE-MIT \
+	VENDOR/winapi-util/COPYING \
+	VENDOR/winapi-util/LICENSE-MIT \
+	VENDOR/winapi-util/UNLICENSE \
+	VENDOR/wincolor/COPYING \
+	VENDOR/wincolor/LICENSE-MIT \
+	VENDOR/wincolor/UNLICENSE \
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [Buildroot] [PATCH v2 10/10] docs/manual/adding-packages-cargo: Update for legal-info
  2020-02-14 12:48 [Buildroot] [PATCH v2 01/10] package/pkg-cargo.mk: Introduce the cargo package infrastructure Patrick Havelange
                   ` (7 preceding siblings ...)
  2020-02-14 12:48 ` [Buildroot] [PATCH v2 09/10] package/ripgrep: add legal-info for dependencies Patrick Havelange
@ 2020-02-14 12:48 ` Patrick Havelange
  2020-02-17 23:45 ` [Buildroot] [PATCH v2 01/10] package/pkg-cargo.mk: Introduce the cargo package infrastructure Sam Voss
  9 siblings, 0 replies; 11+ messages in thread
From: Patrick Havelange @ 2020-02-14 12:48 UTC (permalink / raw)
  To: buildroot

Added a bit of explanations regarding the vendored licenses.

Signed-off-by: Patrick Havelange <patrick.havelange@essensium.com>
---
 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.
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [Buildroot] [PATCH v2 01/10] package/pkg-cargo.mk: Introduce the cargo package infrastructure.
  2020-02-14 12:48 [Buildroot] [PATCH v2 01/10] package/pkg-cargo.mk: Introduce the cargo package infrastructure Patrick Havelange
                   ` (8 preceding siblings ...)
  2020-02-14 12:48 ` [Buildroot] [PATCH v2 10/10] docs/manual/adding-packages-cargo: Update for legal-info Patrick Havelange
@ 2020-02-17 23:45 ` Sam Voss
  9 siblings, 0 replies; 11+ messages in thread
From: Sam Voss @ 2020-02-17 23:45 UTC (permalink / raw)
  To: buildroot

Patrick, All,

On Fri, Feb 14, 2020 at 6:49 AM Patrick Havelange
<patrick.havelange@essensium.com> wrote:
>
> In order to be package agnostic, the install phase is now using
> cargo instead of install.
>
> Signed-off-by: Patrick Havelange <patrick.havelange@essensium.com>
>
> ---
> This is the V2 of the previously posted series :
> http://patchwork.ozlabs.org/project/buildroot/list/?series=156166&state=%2A&archive=both
>
> A lot of changes following the buildroot developer meeting's
> decisions from February 2020.
>
> Needs to be applied on top of the rust 1.40 bump
> ---
>  package/Makefile.in  |  1 +
>  package/pkg-cargo.mk | 89 ++++++++++++++++++++++++++++++++++++++++++++
>  2 files changed, 90 insertions(+)
>  create mode 100644 package/pkg-cargo.mk
>
> diff --git a/package/Makefile.in b/package/Makefile.in
> index 285e2837ef..650d7c166e 100644
> --- a/package/Makefile.in
> +++ b/package/Makefile.in
> @@ -426,3 +426,4 @@ include package/pkg-kernel-module.mk
>  include package/pkg-waf.mk
>  include package/pkg-golang.mk
>  include package/pkg-meson.mk
> +include package/pkg-cargo.mk
> diff --git a/package/pkg-cargo.mk b/package/pkg-cargo.mk
> new file mode 100644
> index 0000000000..2242f3a082
> --- /dev/null
> +++ b/package/pkg-cargo.mk
> @@ -0,0 +1,89 @@
> +################################################################################
> +# Cargo package infrastructure
> +#
> +# This file implements an infrastructure that eases development of package
> +# .mk files for Cargo packages. It should be used for all packages that use
> +# Cargo as their build system.
> +#
> +# See the Buildroot documentation for details on the usage of this
> +# infrastructure
> +#
> +# In terms of implementation, this Cargo 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 <PKG>_BUILD_CMDS is already defined,
> +# it is used as the list of commands to perform to build the package,
> +# instead of the default Cargo behaviour. The package can also define some
> +# post operation hooks.
> +#
> +################################################################################
> +
> +################################################################################
> +# inner-cargo-package -- defines how the configuration, compilation and
> +# installation of a cargo package should be done, implements a few hooks
> +# to tune the build process for cargo specifities 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-cargo-package
> +
> +# We need host-rustc to run cargo
> +$(2)_DEPENDENCIES += host-rustc
> +
> +$(2)_CARGO_ENV = CARGO_HOME=$(HOST_DIR)/share/cargo

Rust has the ability to use c code, and as such has to compile/link[1]
against it. To do this when cross compiling, it uses cargo's
`--target=<arch>` flag to find the compiler. This does not take into
account the vendor portion of the toolchain name, such as buildroot when
using an "internal" toolchain.

`cc-rs` allows the compiler to be passed down with the standard `CC`
variables, so we will need to add  $(TARGET_CONFIGURE_OPTS)
somewhere.

I just did a very quick test and put it here under $(2)_CARGO_ENV and
it worked when testing with the procs package at version v0.9.11 -
with the exact same $(eval $(cargo-package)) as ripgrep is in this
same series.

Let me know if you need more information, but this variable will pass
down those standard variables.

1: https://github.com/alexcrichton/cc-rs

-- 
Sam Voss | Sr. Software Engineer | Commercial Avionics
COLLINS AEROSPACE
400 Collins Road NE, Cedar Rapids, Iowa 52498, USA
Tel: +1 319 263 4039
sam.voss at collins.com | collinsaerospace.com

CONFIDENTIALITY WARNING: This message may contain proprietary and/or
privileged information of Collins Aerospace and its affiliated
companies. If you are not the intended recipient, please 1) Do not
disclose, copy, distribute or use this message or its contents. 2)
Advise the sender by return email. 3) Delete all copies (including all
attachments) from your computer. Your cooperation is greatly
appreciated.

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2020-02-17 23:45 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-14 12:48 [Buildroot] [PATCH v2 01/10] package/pkg-cargo.mk: Introduce the cargo package infrastructure Patrick Havelange
2020-02-14 12:48 ` [Buildroot] [PATCH v2 02/10] docs/manual/cargo: Update manual for cargo packages Patrick Havelange
2020-02-14 12:48 ` [Buildroot] [PATCH v2 03/10] package/ripgrep: convert to cargo infrastructure Patrick Havelange
2020-02-14 12:48 ` [Buildroot] [PATCH v2 04/10] support/download/dl-wrapper: rework backend parsing Patrick Havelange
2020-02-14 12:48 ` [Buildroot] [PATCH v2 05/10] docs/manual/adding-packages-generic: update for new FOO_PKGMGR value Patrick Havelange
2020-02-14 12:48 ` [Buildroot] [PATCH v2 06/10] package/pkg-cargo.mk: Introduce the cargo dl backend Patrick Havelange
2020-02-14 12:48 ` [Buildroot] [PATCH v2 07/10] docs/manual/adding-packages-cargo: update doc for new infra Patrick Havelange
2020-02-14 12:48 ` [Buildroot] [PATCH v2 08/10] package/ripgrep: bump to version 11.0.1 Patrick Havelange
2020-02-14 12:48 ` [Buildroot] [PATCH v2 09/10] package/ripgrep: add legal-info for dependencies Patrick Havelange
2020-02-14 12:48 ` [Buildroot] [PATCH v2 10/10] docs/manual/adding-packages-cargo: Update for legal-info Patrick Havelange
2020-02-17 23:45 ` [Buildroot] [PATCH v2 01/10] package/pkg-cargo.mk: Introduce the cargo package infrastructure Sam Voss

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.