Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v8 0/9] Add support for the Rust programming language
@ 2017-12-17 17:57 Eric Le Bihan
  2017-12-17 17:58 ` [Buildroot] [PATCH 1/9] rustc: new virtual package Eric Le Bihan
                   ` (9 more replies)
  0 siblings, 10 replies; 17+ messages in thread
From: Eric Le Bihan @ 2017-12-17 17:57 UTC (permalink / raw)
  To: buildroot

This series adds support for the Rust programming language by adding the
following packages:

 - rustc: a virtual package for the Rust compiler.
 - rust-bin: provides a pre-built version of rustc.
 - cargo-bin: provides a pre-built version of Rust package manager.
 - rust: builds rustc from source.
 - cargo: builds Rust package manager from source.
 - rust-cargo: a virtual package for the Rust package manager.

Only the host variants are provided.

The rustc and rust-cargo virtual packages are inspired by the mysql one.

v7 -> v8:

 - replace cargo-bootstrap by cargo-bin
 - drop rust-bootstrap and use rust-bin instead
 - rust-bin and rust versions are the same
 - cargo-bin and cargo versions are the same
 - bump cargo to 0.23.0
 - bump rust to 1.22.1
 - add rust-cargo virtual package

v6 -> v7:

 - add cargo 0.20.0
 - bump rust to 1.19.0
 - bump rust-bootstrap to 1.18.0
 - bump cargo-bootstrap to 0.19.0
 - bump rust-bin to 1.19.0
 - fix mips64 target name in rustc

v5 -> v6:

 - bump rust to 1.18.0
 - bump rust-bootstrap to 1.17.0
 - bump rust-bin to 1.18.0

v4 -> v5:

 - add rustc virtual package
 - add rust-bin, provider for rustc
 - rework rust to be a provider for rustc
 - rework some commit messages

v3 -> v4:

 - bump rust to 1.16.0
 - bump rust-bootstrap to 1.15.1
 - add cargo-bootstrap
 - use built-in target specifications
 - drop external Python script to generate target specifications
 - enable support for PowerPC
 - expose host variant in menuconfig

v2 -> v3:

 - bump rust to 1.10.0
 - rework and bump rust-bootstrap to 1.9.0
 - host-rust requires at least GCC 4.7 because of LLVM (suggested by R. Naour)
 - rust requires a glibc-based cross-compiler
 - rust requires GCC 5.x or above for Aarch64

v1 -> v2:

 - bump rust to version 1.9.0.
 - drop patch for bzip2 support in host-python.
 - add package for jemalloc.
 - add dependency on host being a x86 machine.
 - add dependency on toolchain.
 - use dedicated package to provide bootstrapping binary: rust-bootstrap.
 - let ./configure find out host/build on its own.
 - remove entry from configuration menu.

Eric Le Bihan (9):
  rustc: new virtual package
  rust-bin: new package
  cargo-bin: new package
  rust: new package
  libssh2: add host variant
  libhttpparser: add host variant
  libcurl: add host variant
  cargo: new package
  rust-cargo: new virtual package

 DEVELOPERS                                         |   4 +
 package/Config.in.host                             |   2 +
 package/cargo-bin/cargo-bin.hash                   |   4 +
 package/cargo-bin/cargo-bin.mk                     |  18 +
 package/cargo/cargo.hash                           |   4 +
 package/cargo/cargo.mk                             |  96 +++
 package/cargo/config.in                            |   2 +
 package/libcurl/libcurl.mk                         |  13 +
 package/libhttpparser/libhttpparser.mk             |   9 +
 package/libssh2/libssh2.mk                         |   6 +
 package/rust-bin/rust-bin.hash                     |  30 +
 package/rust-bin/rust-bin.mk                       |  61 ++
 package/rust-cargo/Config.in.host                  |  41 ++
 .../rust/0001-vendor-remove-cargo-toml-orig.patch  | 650 +++++++++++++++++++++
 package/rust/rust.hash                             |   2 +
 package/rust/rust.mk                               |  66 +++
 package/rustc/Config.in.host                       |  62 ++
 package/rustc/rustc.mk                             |  31 +
 18 files changed, 1101 insertions(+)
 create mode 100644 package/cargo-bin/cargo-bin.hash
 create mode 100644 package/cargo-bin/cargo-bin.mk
 create mode 100644 package/cargo/cargo.hash
 create mode 100644 package/cargo/cargo.mk
 create mode 100644 package/cargo/config.in
 create mode 100644 package/rust-bin/rust-bin.hash
 create mode 100644 package/rust-bin/rust-bin.mk
 create mode 100644 package/rust-cargo/Config.in.host
 create mode 100644 package/rust/0001-vendor-remove-cargo-toml-orig.patch
 create mode 100644 package/rust/rust.hash
 create mode 100644 package/rust/rust.mk
 create mode 100644 package/rustc/Config.in.host
 create mode 100644 package/rustc/rustc.mk

-- 
2.14.3

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

* [Buildroot] [PATCH 1/9] rustc: new virtual package
  2017-12-17 17:57 [Buildroot] [PATCH v8 0/9] Add support for the Rust programming language Eric Le Bihan
@ 2017-12-17 17:58 ` Eric Le Bihan
  2017-12-17 17:58 ` [Buildroot] [PATCH 2/9] rust-bin: new package Eric Le Bihan
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 17+ messages in thread
From: Eric Le Bihan @ 2017-12-17 17:58 UTC (permalink / raw)
  To: buildroot

The compiler for the Rust programming language is called rustc.

There is only one reference implementation for it, based on LLVM, from
the Rust project [1]. It can generate code for various architectures so
it can be labeled as a cross-compiler. But, as for GCC, building it
from source takes time.

So it would be sensible to have at least one package which provides it
as a pre-built version, fetched from the upstream project. Later another
package can be added, to build it from source code.

In addition to the compiler, the standard library for the host and/or
the target should also be fetched/built.

So, add a virtual package named rustc to enable support for multiple
providers.

Currently, only the host variant will be available to allow the user to
cross-compile Rust programs for the target.

[1] http://rust-lang.org

Signed-off-by: Eric Le Bihan <eric.le.bihan.dev@free.fr>
---
 package/Config.in.host       |  1 +
 package/rustc/Config.in.host | 17 +++++++++++++++++
 package/rustc/rustc.mk       | 31 +++++++++++++++++++++++++++++++
 3 files changed, 49 insertions(+)
 create mode 100644 package/rustc/Config.in.host
 create mode 100644 package/rustc/rustc.mk

diff --git a/package/Config.in.host b/package/Config.in.host
index dd6415bba5..2f20dd0e48 100644
--- a/package/Config.in.host
+++ b/package/Config.in.host
@@ -46,6 +46,7 @@ menu "Host utilities"
 	source "package/qemu/Config.in.host"
 	source "package/raspberrypi-usbboot/Config.in.host"
 	source "package/rauc/Config.in.host"
+	source "package/rustc/Config.in.host"
 	source "package/s6-rc/Config.in.host"
 	source "package/sam-ba/Config.in.host"
 	source "package/squashfs/Config.in.host"
diff --git a/package/rustc/Config.in.host b/package/rustc/Config.in.host
new file mode 100644
index 0000000000..16c95fa0b4
--- /dev/null
+++ b/package/rustc/Config.in.host
@@ -0,0 +1,17 @@
+config BR2_PACKAGE_HOST_RUSTC_ARCH_SUPPORTS
+	bool
+	default y
+	depends on BR2_HOSTARCH = "x86_64" || BR2_HOSTARCH = "x86"
+	depends on BR2_i386 || BR2_x86_64 \
+		|| BR2_arm  || BR2_aarch64 \
+		|| BR2_powerpc  || BR2_powerpc64 \
+		|| BR2_mips || BR2_mipsel || BR2_mips64 || BR2_mips64el
+	depends on !BR2_ARM_CPU_ARMV4 && !BR2_ARM_CPU_ARMV5
+	depends on !BR2_MIPS_NABI32
+	depends on BR2_TOOLCHAIN_USES_GLIBC
+
+config BR2_PACKAGE_HAS_HOST_RUSTC
+	bool
+
+config BR2_PACKAGE_PROVIDES_HOST_RUSTC
+	string
diff --git a/package/rustc/rustc.mk b/package/rustc/rustc.mk
new file mode 100644
index 0000000000..4163a44bc1
--- /dev/null
+++ b/package/rustc/rustc.mk
@@ -0,0 +1,31 @@
+################################################################################
+#
+# rustc
+#
+################################################################################
+
+RUST_ARCH := $(call qstrip,$(BR2_ARCH))
+
+ifeq ($(BR2_ARM_CPU_ARMV7A),y)
+RUST_ARCH := armv7
+endif
+
+ifeq ($(BR2_ARM_EABI),y)
+RUST_ABI := eabi
+else ifeq ($(BR2_ARM_EABIHF),y)
+RUST_ABI := eabihf
+else ifeq ($(BR2_mips64)$(BR2_mips64el),y)
+RUST_ABI := abi64
+endif
+
+RUST_TARGET_NAME := $(RUST_ARCH)-unknown-linux-gnu$(RUST_ABI)
+
+ifeq ($(HOSTARCH),x86)
+RUST_HOST_ARCH = i686
+else
+RUST_HOST_ARCH = $(HOSTARCH)
+endif
+
+RUST_HOST_NAME = $(RUST_HOST_ARCH)-unknown-linux-gnu
+
+$(eval $(host-virtual-package))
-- 
2.14.3

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

* [Buildroot] [PATCH 2/9] rust-bin: new package
  2017-12-17 17:57 [Buildroot] [PATCH v8 0/9] Add support for the Rust programming language Eric Le Bihan
  2017-12-17 17:58 ` [Buildroot] [PATCH 1/9] rustc: new virtual package Eric Le Bihan
@ 2017-12-17 17:58 ` Eric Le Bihan
  2017-12-17 17:58 ` [Buildroot] [PATCH 3/9] cargo-bin: " Eric Le Bihan
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 17+ messages in thread
From: Eric Le Bihan @ 2017-12-17 17:58 UTC (permalink / raw)
  To: buildroot

This package provides a pre-built version of rustc, the compiler for the
Rust programming language, fetched from the upstream project.

A pre-built version of the standard library for the host as well as one
for the chosen target are also fetched and installed.

Only the host variant is provided to allow the user to cross-compile
Rust programs and run them on the target.

The menuconfig entry for rustc is also updated to expose this provider.

Signed-off-by: Eric Le Bihan <eric.le.bihan.dev@free.fr>
---
 DEVELOPERS                     |  1 +
 package/rust-bin/rust-bin.hash | 30 +++++++++++++++++++++
 package/rust-bin/rust-bin.mk   | 61 ++++++++++++++++++++++++++++++++++++++++++
 package/rustc/Config.in.host   | 29 ++++++++++++++++++++
 4 files changed, 121 insertions(+)
 create mode 100644 package/rust-bin/rust-bin.hash
 create mode 100644 package/rust-bin/rust-bin.mk

diff --git a/DEVELOPERS b/DEVELOPERS
index af800d862a..6f7b03ca4a 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -543,6 +543,7 @@ F:	package/execline/
 F:	package/hicolor-icon-theme/
 F:	package/jemalloc/
 F:	package/ninja/
+F:	package/rust-bin/
 F:	package/s6/
 F:	package/s6-dns/
 F:	package/s6-linux-init/
diff --git a/package/rust-bin/rust-bin.hash b/package/rust-bin/rust-bin.hash
new file mode 100644
index 0000000000..211f9fbbe0
--- /dev/null
+++ b/package/rust-bin/rust-bin.hash
@@ -0,0 +1,30 @@
+# From https://static.rust-lang.org/dist/rustc-1.22.1-i686-unknown-linux-gnu.tar.xz.sha256
+sha256 d87e15a8f8b3d53270866076824559926d01145733144c4a5905affff3819b47  rustc-1.22.1-i686-unknown-linux-gnu.tar.xz
+# From https://static.rust-lang.org/dist/rustc-1.22.1-x86_64-unknown-linux-gnu.tar.xz.sha256
+sha256 9730e46b2301417a5c5e1410f8ab8b8b6979f448b7fffc5e63221bd1bdaa15a3  rustc-1.22.1-x86_64-unknown-linux-gnu.tar.xz
+# From https://static.rust-lang.org/dist/rust-std-1.22.1-aarch64-unknown-linux-gnu.tar.xz.sha256
+sha256 b9c004288c5516dae88e325d24f26c10702dc617268e35b51b4bc83f4f2fc30d  rust-std-1.22.1-aarch64-unknown-linux-gnu.tar.xz
+# From https://static.rust-lang.org/dist/rust-std-1.22.1-arm-unknown-linux-gnueabi.tar.xz.sha256
+sha256 d48e918af118cacd2074c1c357cea46f2db73d42510c54fdfdcdf0ff60ba58ec  rust-std-1.22.1-arm-unknown-linux-gnueabi.tar.xz
+# From https://static.rust-lang.org/dist/rust-std-1.22.1-arm-unknown-linux-gnueabihf.tar.xz.sha256
+sha256 b64b4047dcdfa4aa617f7606a92320c95cdd44cadadac72d3e7d162addc62c92  rust-std-1.22.1-arm-unknown-linux-gnueabihf.tar.xz
+# From https://static.rust-lang.org/dist/rust-std-1.22.1-armv7-unknown-linux-gnueabihf.tar.xz.sha256
+sha256 e85b649aa18e1903e3c9c899ded55652713017a1e3a35e6fd58a7f40738805be  rust-std-1.22.1-armv7-unknown-linux-gnueabihf.tar.xz
+# From https://static.rust-lang.org/dist/rust-std-1.22.1-i686-unknown-linux-gnu.tar.xz.sha256
+sha256 112e17646bc5c513e81396b2c8042a44071a268b0d77810e378bdc9122abedc1  rust-std-1.22.1-i686-unknown-linux-gnu.tar.xz
+# From https://static.rust-lang.org/dist/rust-std-1.22.1-mips-unknown-linux-gnu.tar.xz.sha256
+sha256 80f0bc95273805e1ffe424b004b71a23d6d36acac2999d7361ce3cd3b17f39e9  rust-std-1.22.1-mips-unknown-linux-gnu.tar.xz
+# From https://static.rust-lang.org/dist/rust-std-1.22.1-mips64-unknown-linux-gnuabi64.tar.xz.sha256
+sha256 d50e4b52133b58235ff6f2c9de18d2ca81647fc2ef50aeaf9c1df5d726b3b2a3  rust-std-1.22.1-mips64-unknown-linux-gnuabi64.tar.xz
+# From https://static.rust-lang.org/dist/rust-std-1.22.1-mips64el-unknown-linux-gnuabi64.tar.xz.sha256
+sha256 6f61b30cd54c24fcdffddb67eb4073b2199dbea487c7be2c9ab6dd4bab46dabf  rust-std-1.22.1-mips64el-unknown-linux-gnuabi64.tar.xz
+# From https://static.rust-lang.org/dist/rust-std-1.22.1-mipsel-unknown-linux-gnu.tar.xz.sha256
+sha256 01278fa6596d8193bff76ddaacb78c339d610c5dbe035a38f7d0d9ebcf2bcce7  rust-std-1.22.1-mipsel-unknown-linux-gnu.tar.xz
+# From https://static.rust-lang.org/dist/rust-std-1.22.1-powerpc-unknown-linux-gnu.tar.xz.sha256
+sha256 39b26eaa3006aea11539d63bffdeada7078d79a4a06916cc8e6f6d66434e0a91  rust-std-1.22.1-powerpc-unknown-linux-gnu.tar.xz
+# From https://static.rust-lang.org/dist/rust-std-1.22.1-powerpc64-unknown-linux-gnu.tar.xz.sha256
+sha256 dcaf8f636ad4290bc761566d5fac77f4d6757046fe0ee539417fc6543246877b  rust-std-1.22.1-powerpc64-unknown-linux-gnu.tar.xz
+# From https://static.rust-lang.org/dist/rust-std-1.22.1-powerpc64le-unknown-linux-gnu.tar.xz.sha256
+sha256 9f5f047c8817b9c9bb45465fdccf55be9a551ebae5859100fdfa2c429f9d0574  rust-std-1.22.1-powerpc64le-unknown-linux-gnu.tar.xz
+# From https://static.rust-lang.org/dist/rust-std-1.22.1-x86_64-unknown-linux-gnu.tar.xz.sha256
+sha256 edd3313eb6523b2c08c84fc9cd7a80e4fb14c32168639d1833fd1b46e088a9a1  rust-std-1.22.1-x86_64-unknown-linux-gnu.tar.xz
diff --git a/package/rust-bin/rust-bin.mk b/package/rust-bin/rust-bin.mk
new file mode 100644
index 0000000000..517faad5ac
--- /dev/null
+++ b/package/rust-bin/rust-bin.mk
@@ -0,0 +1,61 @@
+################################################################################
+#
+# rust-bin
+#
+################################################################################
+
+RUST_BIN_VERSION = 1.22.1
+RUST_BIN_SITE = https://static.rust-lang.org/dist
+RUST_BIN_LICENSE = Apache-2.0 or MIT
+RUST_BIN_LICENSE_FILES = LICENSE-APACHE LICENSE-MIT
+
+HOST_RUST_BIN_PROVIDES = host-rustc
+
+HOST_RUST_BIN_SOURCE = rustc-$(RUST_BIN_VERSION)-$(RUST_HOST_NAME).tar.xz
+HOST_RUST_BIN_LIBSTD_SOURCES = \
+	rust-std-$(RUST_BIN_VERSION)-$(RUST_HOST_NAME).tar.xz \
+	rust-std-$(RUST_BIN_VERSION)-$(RUST_TARGET_NAME).tar.xz
+
+HOST_RUST_BIN_EXTRA_DOWNLOADS = $(HOST_RUST_BIN_LIBSTD_SOURCES)
+
+HOST_RUST_BIN_LIBSTD_HOST_PREFIX = rust-std-$(RUST_BIN_VERSION)-$(RUST_HOST_NAME)/rust-std-$(RUST_HOST_NAME)
+
+define HOST_RUST_BIN_LIBSTD_EXTRACT
+	mkdir -p $(@D)/std
+	for file in $(addprefix $(DL_DIR)/,$(HOST_RUST_BIN_LIBSTD_SOURCES)); do \
+		$(TAR) -C $(@D)/std -xJf $${file}; \
+	done
+	(\
+		cd $(@D)/rustc/lib/rustlib; \
+		ln -sf ../../../std/$(HOST_RUST_BIN_LIBSTD_HOST_PREFIX)/lib/rustlib/$(RUST_HOST_NAME) \
+	)
+endef
+
+HOST_RUST_BIN_POST_EXTRACT_HOOKS += HOST_RUST_BIN_LIBSTD_EXTRACT
+
+HOST_RUST_BIN_INSTALL_OPTS = \
+	--prefix=$(HOST_DIR) \
+	--disable-ldconfig
+
+define HOST_RUST_BIN_INSTALL_RUSTC
+	(cd $(@D); \
+		./install.sh $(HOST_RUST_BIN_INSTALL_OPTS))
+endef
+
+define HOST_RUST_BIN_INSTALL_LIBSTD_HOST
+	(cd $(@D)/std/rust-std-$(RUST_BIN_VERSION)-$(RUST_HOST_NAME); \
+		./install.sh $(HOST_RUST_BIN_INSTALL_OPTS))
+endef
+
+define HOST_RUST_BIN_INSTALL_LIBSTD_TARGET
+	(cd $(@D)/std/rust-std-$(RUST_BIN_VERSION)-$(RUST_TARGET_NAME); \
+		./install.sh $(HOST_RUST_BIN_INSTALL_OPTS))
+endef
+
+define HOST_RUST_BIN_INSTALL_CMDS
+	$(HOST_RUST_BIN_INSTALL_RUSTC)
+	$(HOST_RUST_BIN_INSTALL_LIBSTD_HOST)
+	$(HOST_RUST_BIN_INSTALL_LIBSTD_TARGET)
+endef
+
+$(eval $(host-generic-package))
diff --git a/package/rustc/Config.in.host b/package/rustc/Config.in.host
index 16c95fa0b4..e42187d477 100644
--- a/package/rustc/Config.in.host
+++ b/package/rustc/Config.in.host
@@ -10,8 +10,37 @@ config BR2_PACKAGE_HOST_RUSTC_ARCH_SUPPORTS
 	depends on !BR2_MIPS_NABI32
 	depends on BR2_TOOLCHAIN_USES_GLIBC
 
+config BR2_PACKAGE_HOST_RUSTC
+	bool "host rustc"
+	depends on BR2_PACKAGE_HOST_RUSTC_ARCH_SUPPORTS
+	help
+	  Compiler for the Rust language
+
+	  http://www.rust-lang.org
+
+if BR2_PACKAGE_HOST_RUSTC
+
+choice
+	prompt "Rust compiler variant"
+	default BR2_PACKAGE_HOST_RUST_BIN
+	help
+	  Select a Rust compiler
+
+config BR2_PACKAGE_HOST_RUST_BIN
+	bool "host rust (pre-built)"
+	select BR2_PACKAGE_HAS_HOST_RUSTC
+	help
+	  This package will install pre-built versions of the compiler
+	  for the host and the Rust standard library for the target.
+
+endchoice
+
 config BR2_PACKAGE_HAS_HOST_RUSTC
 	bool
 
 config BR2_PACKAGE_PROVIDES_HOST_RUSTC
 	string
+	default "host-rust-bin" if BR2_PACKAGE_HOST_RUST_BIN
+
+endif
+
-- 
2.14.3

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

* [Buildroot] [PATCH 3/9] cargo-bin: new package
  2017-12-17 17:57 [Buildroot] [PATCH v8 0/9] Add support for the Rust programming language Eric Le Bihan
  2017-12-17 17:58 ` [Buildroot] [PATCH 1/9] rustc: new virtual package Eric Le Bihan
  2017-12-17 17:58 ` [Buildroot] [PATCH 2/9] rust-bin: new package Eric Le Bihan
@ 2017-12-17 17:58 ` Eric Le Bihan
  2017-12-17 17:58 ` [Buildroot] [PATCH 5/9] libssh2: add host variant Eric Le Bihan
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 17+ messages in thread
From: Eric Le Bihan @ 2017-12-17 17:58 UTC (permalink / raw)
  To: buildroot

This new package fetches a binary version of Cargo, suitable to
bootstrap the host variants of the Rust compiler and Cargo, the package
manager.

Signed-off-by: Eric Le Bihan <eric.le.bihan.dev@free.fr>
---
 DEVELOPERS                       |  1 +
 package/cargo-bin/cargo-bin.hash |  4 ++++
 package/cargo-bin/cargo-bin.mk   | 18 ++++++++++++++++++
 3 files changed, 23 insertions(+)
 create mode 100644 package/cargo-bin/cargo-bin.hash
 create mode 100644 package/cargo-bin/cargo-bin.mk

diff --git a/DEVELOPERS b/DEVELOPERS
index 6f7b03ca4a..fb0c709861 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -537,6 +537,7 @@ F:	package/xxhash/
 
 N:	Eric Le Bihan <eric.le.bihan.dev@free.fr>
 F:	package/adwaita-icon-theme/
+F:	package/cargo-bin/
 F:	package/darkhttpd/
 F:	package/eudev/
 F:	package/execline/
diff --git a/package/cargo-bin/cargo-bin.hash b/package/cargo-bin/cargo-bin.hash
new file mode 100644
index 0000000000..70fb101be7
--- /dev/null
+++ b/package/cargo-bin/cargo-bin.hash
@@ -0,0 +1,4 @@
+# From https://static.rust-lang.org/dist/cargo-0.23.0-i686-unknown-linux-gnu.tar.gz.sha256
+sha256 7ebe231e5da2a06370f17050285ee694cf09ac2010d87dab334ae7eb7fb2d975  cargo-0.23.0-i686-unknown-linux-gnu.tar.gz
+# From https://static.rust-lang.org/dist/cargo-0.23.0-x86_64-unknown-linux-gnu.tar.xz.sha256
+sha256 4f33d9e511cfcbb370f470d3813e4877da10761d5f75460e538503fa07fa64f8  cargo-0.23.0-x86_64-unknown-linux-gnu.tar.xz
diff --git a/package/cargo-bin/cargo-bin.mk b/package/cargo-bin/cargo-bin.mk
new file mode 100644
index 0000000000..5c5d2daca3
--- /dev/null
+++ b/package/cargo-bin/cargo-bin.mk
@@ -0,0 +1,18 @@
+################################################################################
+#
+# cargo-bin
+#
+################################################################################
+
+CARGO_BIN_VERSION = 0.23.0
+CARGO_BIN_SITE = https://static.rust-lang.org/dist
+CARGO_BIN_SOURCE = cargo-$(CARGO_BIN_VERSION)-$(RUST_HOST_NAME).tar.xz
+CARGO_BIN_LICENSE = Apache-2.0 or MIT
+CARGO_BIN_LICENSE_FILES = LICENSE-APACHE LICENSE-MIT
+CARGO_BIN_STRIP_COMPONENTS = 1
+
+define HOST_CARGO_BIN_INSTALL_CMDS
+	(cd $(@D); ./install.sh --prefix=$(HOST_DIR) --disable-ldconfig)
+endef
+
+$(eval $(host-generic-package))
-- 
2.14.3

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

* [Buildroot] [PATCH 5/9] libssh2: add host variant
  2017-12-17 17:57 [Buildroot] [PATCH v8 0/9] Add support for the Rust programming language Eric Le Bihan
                   ` (2 preceding siblings ...)
  2017-12-17 17:58 ` [Buildroot] [PATCH 3/9] cargo-bin: " Eric Le Bihan
@ 2017-12-17 17:58 ` Eric Le Bihan
  2017-12-17 17:58 ` [Buildroot] [PATCH 6/9] libhttpparser: " Eric Le Bihan
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 17+ messages in thread
From: Eric Le Bihan @ 2017-12-17 17:58 UTC (permalink / raw)
  To: buildroot

Allow build of host variant of libssh2, which depends on host-openssl.

Signed-off-by: Eric Le Bihan <eric.le.bihan.dev@free.fr>
---
 package/libssh2/libssh2.mk | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/package/libssh2/libssh2.mk b/package/libssh2/libssh2.mk
index 18e772c722..c5b0bd855e 100644
--- a/package/libssh2/libssh2.mk
+++ b/package/libssh2/libssh2.mk
@@ -40,4 +40,10 @@ else
 LIBSSH2_CONF_OPTS += --without-libz
 endif
 
+HOST_LIBSSH2_DEPENDENCIES += host-openssl
+HOST_LIBSSH2_CONF_OPTS += --with-openssl \
+	--with-libssl-prefix=$(HOST_DIR)/usr \
+	--without-libgcrypt
+
 $(eval $(autotools-package))
+$(eval $(host-autotools-package))
-- 
2.14.3

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

* [Buildroot] [PATCH 6/9] libhttpparser: add host variant
  2017-12-17 17:57 [Buildroot] [PATCH v8 0/9] Add support for the Rust programming language Eric Le Bihan
                   ` (3 preceding siblings ...)
  2017-12-17 17:58 ` [Buildroot] [PATCH 5/9] libssh2: add host variant Eric Le Bihan
@ 2017-12-17 17:58 ` Eric Le Bihan
  2017-12-17 17:58 ` [Buildroot] [PATCH 7/9] libcurl: " Eric Le Bihan
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 17+ messages in thread
From: Eric Le Bihan @ 2017-12-17 17:58 UTC (permalink / raw)
  To: buildroot

Allow build of host variant of libhttpparser.

Signed-off-by: Eric Le Bihan <eric.le.bihan.dev@free.fr>
---
 package/libhttpparser/libhttpparser.mk | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/package/libhttpparser/libhttpparser.mk b/package/libhttpparser/libhttpparser.mk
index 8ff0413322..1df26017e7 100644
--- a/package/libhttpparser/libhttpparser.mk
+++ b/package/libhttpparser/libhttpparser.mk
@@ -23,4 +23,13 @@ define LIBHTTPPARSER_INSTALL_TARGET_CMDS
 	$(MAKE) $(TARGET_CONFIGURE_OPTS) -C $(@D) PREFIX=$(TARGET_DIR)/usr install
 endef
 
+define HOST_LIBHTTPPARSER_BUILD_CMDS
+	$(MAKE) $(HOST_CONFIGURE_OPTS) -C $(@D) library package
+endef
+
+define HOST_LIBHTTPPARSER_INSTALL_CMDS
+	$(MAKE) $(HOST_CONFIGURE_OPTS) -C $(@D) PREFIX=$(HOST_DIR)/usr install
+endef
+
 $(eval $(generic-package))
+$(eval $(host-generic-package))
-- 
2.14.3

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

* [Buildroot] [PATCH 7/9] libcurl: add host variant
  2017-12-17 17:57 [Buildroot] [PATCH v8 0/9] Add support for the Rust programming language Eric Le Bihan
                   ` (4 preceding siblings ...)
  2017-12-17 17:58 ` [Buildroot] [PATCH 6/9] libhttpparser: " Eric Le Bihan
@ 2017-12-17 17:58 ` Eric Le Bihan
  2017-12-18  5:40   ` Baruch Siach
  2017-12-17 17:58 ` [Buildroot] [PATCH 8/9] cargo: new package Eric Le Bihan
                   ` (3 subsequent siblings)
  9 siblings, 1 reply; 17+ messages in thread
From: Eric Le Bihan @ 2017-12-17 17:58 UTC (permalink / raw)
  To: buildroot

Signed-off-by: Eric Le Bihan <eric.le.bihan.dev@free.fr>
---
 package/libcurl/libcurl.mk | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/package/libcurl/libcurl.mk b/package/libcurl/libcurl.mk
index 0aab58a7de..c95b0eea6b 100644
--- a/package/libcurl/libcurl.mk
+++ b/package/libcurl/libcurl.mk
@@ -88,4 +88,17 @@ endef
 LIBCURL_POST_INSTALL_TARGET_HOOKS += LIBCURL_TARGET_CLEANUP
 endif
 
+HOST_LIBCURL_DEPENDENCIES = host-openssl
+HOST_LIBCURL_CONF_OPTS = \
+	--disable-manual \
+	--disable-ntlm-wb \
+	--disable-curldebug \
+	--without-gnutls \
+	--without-mbedtls \
+	--without-polarssl \
+	--without-nss
+
+HOST_LIBCURL_POST_PATCH_HOOKS += LIBCURL_FIX_DOT_PC
+
 $(eval $(autotools-package))
+$(eval $(host-autotools-package))
-- 
2.14.3

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

* [Buildroot] [PATCH 8/9] cargo: new package
  2017-12-17 17:57 [Buildroot] [PATCH v8 0/9] Add support for the Rust programming language Eric Le Bihan
                   ` (5 preceding siblings ...)
  2017-12-17 17:58 ` [Buildroot] [PATCH 7/9] libcurl: " Eric Le Bihan
@ 2017-12-17 17:58 ` Eric Le Bihan
  2017-12-17 17:58 ` [Buildroot] [PATCH 9/9] rust-cargo: new virtual package Eric Le Bihan
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 17+ messages in thread
From: Eric Le Bihan @ 2017-12-17 17:58 UTC (permalink / raw)
  To: buildroot

This new package provides Cargo, the Rust official package manager.
Cargo is written in Rust and uses Cargo as its build system. It also
depends on other Rust packages.

Normally, a previously installed version of Cargo would be used to:

 1. Fetch the dependencies.
 2. Build the new version of Cargo, using the available Rust compiler.

But the fetching step prevents offline builds. So instead two features
of Cargo are levelled: vendoring [1] and local registry.

First, a tarball of the build dependencies generated using `cargo
vendor` is fetched along with Cargo source code.

Then, the build process is as follows:

 1. The tarball of the build dependencies is uncompressed in a local
    registry.
 2. A snapshot of Cargo, provided by cargo-bin, builds the final
    version of Cargo.
 3. A configuration file telling Cargo how to cross-compile programs for
    the target is generated and installed.

Currently, only the host variant is provided.

[1] https://github.com/alexcrichton/cargo-vendor

Signed-off-by: Eric Le Bihan <eric.le.bihan.dev@free.fr>
---
 DEVELOPERS                   |  1 +
 package/Config.in.host       |  1 +
 package/cargo/Config.in.host |  8 ++++
 package/cargo/cargo.hash     |  4 ++
 package/cargo/cargo.mk       | 96 ++++++++++++++++++++++++++++++++++++++++++++
 package/cargo/config.in      |  2 +
 6 files changed, 112 insertions(+)
 create mode 100644 package/cargo/Config.in.host
 create mode 100644 package/cargo/cargo.hash
 create mode 100644 package/cargo/cargo.mk
 create mode 100644 package/cargo/config.in

diff --git a/DEVELOPERS b/DEVELOPERS
index b3c681747c..97ecec4bba 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -538,6 +538,7 @@ F:	package/xxhash/
 N:	Eric Le Bihan <eric.le.bihan.dev@free.fr>
 F:	package/adwaita-icon-theme/
 F:	package/cargo-bin/
+F:	package/cargo/
 F:	package/darkhttpd/
 F:	package/eudev/
 F:	package/execline/
diff --git a/package/Config.in.host b/package/Config.in.host
index 2f20dd0e48..199a8e9856 100644
--- a/package/Config.in.host
+++ b/package/Config.in.host
@@ -2,6 +2,7 @@ menu "Host utilities"
 
 	source "package/aespipe/Config.in.host"
 	source "package/android-tools/Config.in.host"
+	source "package/cargo/Config.in.host"
 	source "package/cbootimage/Config.in.host"
 	source "package/checkpolicy/Config.in.host"
 	source "package/cmake/Config.in.host"
diff --git a/package/cargo/Config.in.host b/package/cargo/Config.in.host
new file mode 100644
index 0000000000..0f1ca305c6
--- /dev/null
+++ b/package/cargo/Config.in.host
@@ -0,0 +1,8 @@
+config BR2_PACKAGE_HOST_CARGO
+	bool "host cargo"
+	depends on BR2_PACKAGE_HAS_HOST_RUSTC
+	help
+	  Cargo is the package manager for the Rust programming
+	  language.
+
+	  https://crates.io/
diff --git a/package/cargo/cargo.hash b/package/cargo/cargo.hash
new file mode 100644
index 0000000000..2b2ae43f6b
--- /dev/null
+++ b/package/cargo/cargo.hash
@@ -0,0 +1,4 @@
+# Locally generated
+sha256 f4bbe2a8719dbb8da20842235093f7f70f034d01633189e83f75897d68cd274f  cargo-0.23.0.tar.gz
+sha512 9060ec6e67b54f7fad7da8dd8450dd051d62b3f8ed4606196fc238a98beba1c3b43087c787f35d012d9b641c8572e70f50b95b0e01fdd75ed82932b6e6efbbf0  cargo-0.23.0-vendor.tar.xz
+sha256 dc7240d60a869fa24a68c8734fb7c810c27cca0a6dad52df6279865e4e8e7fae  rust-installer-4f994850808a572e2cc8d43f968893c8e942e9bf.tar.gz
diff --git a/package/cargo/cargo.mk b/package/cargo/cargo.mk
new file mode 100644
index 0000000000..fe92b95c9b
--- /dev/null
+++ b/package/cargo/cargo.mk
@@ -0,0 +1,96 @@
+################################################################################
+#
+# cargo
+#
+################################################################################
+
+CARGO_VERSION = 0.23.0
+CARGO_SITE = $(call github,rust-lang,cargo,$(CARGO_VERSION))
+CARGO_LICENSE = Apache-2.0 or MIT
+CARGO_LICENSE_FILES = LICENSE-APACHE LICENSE-MIT
+
+CARGO_DEPS_SHA512 = 9060ec6e67b54f7fad7da8dd8450dd051d62b3f8ed4606196fc238a98beba1c3b43087c787f35d012d9b641c8572e70f50b95b0e01fdd75ed82932b6e6efbbf0
+CARGO_DEPS_SITE = http://pkgs.fedoraproject.org/repo/pkgs/cargo/$(CARGO_DEPS_SOURCE)/sha512/$(CARGO_DEPS_SHA512)
+CARGO_DEPS_SOURCE = cargo-$(CARGO_VERSION)-vendor.tar.xz
+
+CARGO_INSTALLER_VERSION = 4f994850808a572e2cc8d43f968893c8e942e9bf
+CARGO_INSTALLER_SITE = $(call github,rust-lang,rust-installer,$(CARGO_INSTALLER_VERSION))
+CARGO_INSTALLER_SOURCE = rust-installer-$(CARGO_INSTALLER_VERSION).tar.gz
+
+HOST_CARGO_EXTRA_DOWNLOADS = \
+	$(CARGO_DEPS_SITE)/$(CARGO_DEPS_SOURCE) \
+	$(CARGO_INSTALLER_SITE)/$(CARGO_INSTALLER_SOURCE)
+
+HOST_CARGO_DEPENDENCIES = \
+	host-cmake \
+	host-pkgconf \
+	host-openssl \
+	host-libhttpparser \
+	host-libssh2 \
+	host-libcurl \
+	host-rustc \
+	host-cargo-bin-extract
+
+HOST_CARGO_SNAP_BIN = $(HOST_CARGO_BIN_DIR)/cargo/bin/cargo
+HOST_CARGO_HOME = $(HOST_DIR)/share/cargo
+
+define HOST_CARGO_EXTRACT_DEPS
+	@mkdir -p $(@D)/vendor
+	$(call suitable-extractor,$(CARGO_DEPS_SOURCE)) \
+		$(DL_DIR)/$(CARGO_DEPS_SOURCE) | \
+		$(TAR) --strip-components=1 -C $(@D)/vendor $(TAR_OPTIONS) -
+endef
+
+HOST_CARGO_POST_EXTRACT_HOOKS += HOST_CARGO_EXTRACT_DEPS
+
+define HOST_CARGO_EXTRACT_INSTALLER
+	@mkdir -p $(@D)/src/rust-installer
+	$(call suitable-extractor,$(CARGO_INSTALLER_SOURCE)) \
+		$(DL_DIR)/$(CARGO_INSTALLER_SOURCE) | \
+		$(TAR) --strip-components=1 -C $(@D)/src/rust-installer $(TAR_OPTIONS) -
+endef
+
+HOST_CARGO_POST_EXTRACT_HOOKS += HOST_CARGO_EXTRACT_INSTALLER
+
+define HOST_CARGO_SETUP_DEPS
+	mkdir -p $(@D)/.cargo
+	( \
+		echo "[source.crates-io]"; \
+		echo "registry = 'https://github.com/rust-lang/crates.io-index'"; \
+		echo "replace-with = 'vendored-sources'"; \
+		echo "[source.vendored-sources]"; \
+		echo "directory = '$(@D)/vendor'"; \
+	) > $(@D)/.cargo/config
+endef
+
+HOST_CARGO_PRE_CONFIGURE_HOOKS += HOST_CARGO_SETUP_DEPS
+
+HOST_CARGO_SNAP_OPTS = --release
+HOST_CARGO_SNAP_OPTS += $(if $(VERBOSE),--verbose)
+
+HOST_CARGO_ENV = \
+	RUSTFLAGS="-Clink-arg=-Wl,-rpath,$(HOST_DIR)/lib" \
+	CARGO_HOME=$(HOST_DIR)/share/cargo
+
+define HOST_CARGO_BUILD_CMDS
+	(cd $(@D); $(HOST_MAKE_ENV) $(HOST_CARGO_ENV) $(HOST_CARGO_SNAP_BIN) \
+		build $(HOST_CARGO_SNAP_OPTS))
+endef
+
+define HOST_CARGO_INSTALL_CMDS
+	$(INSTALL) -d -m 0755 $(HOST_DIR)/bin
+	$(INSTALL) -m 0755 $(@D)/target/release/cargo $(HOST_DIR)/bin/cargo
+endef
+
+define HOST_CARGO_INSTALL_CONF_FILE
+	$(INSTALL) -D package/cargo/config.in \
+		$(HOST_DIR)/share/cargo/config
+	$(SED) 's/@RUST_TARGET_NAME@/$(RUST_TARGET_NAME)/' \
+		$(HOST_DIR)/share/cargo/config
+	$(SED) 's/@CROSS_PREFIX@/$(notdir $(TARGET_CROSS))/' \
+		$(HOST_DIR)/share/cargo/config
+endef
+
+HOST_CARGO_POST_INSTALL_HOOKS += HOST_CARGO_INSTALL_CONF_FILE
+
+$(eval $(host-generic-package))
diff --git a/package/cargo/config.in b/package/cargo/config.in
new file mode 100644
index 0000000000..cc048c71c4
--- /dev/null
+++ b/package/cargo/config.in
@@ -0,0 +1,2 @@
+[target. at RUST_TARGET_NAME@]
+linker = "@CROSS_PREFIX at gcc"
-- 
2.14.3

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

* [Buildroot] [PATCH 9/9] rust-cargo: new virtual package
  2017-12-17 17:57 [Buildroot] [PATCH v8 0/9] Add support for the Rust programming language Eric Le Bihan
                   ` (6 preceding siblings ...)
  2017-12-17 17:58 ` [Buildroot] [PATCH 8/9] cargo: new package Eric Le Bihan
@ 2017-12-17 17:58 ` Eric Le Bihan
  2017-12-17 18:17 ` [Buildroot] [PATCH v8 0/9] Add support for the Rust programming language Eric Le Bihan
  2017-12-18  6:54 ` Thomas Petazzoni
  9 siblings, 0 replies; 17+ messages in thread
From: Eric Le Bihan @ 2017-12-17 17:58 UTC (permalink / raw)
  To: buildroot

Add a new host virtual package to provide Cargo, the package manager for
the Rust language.

Currently, two providers are available: host-cargo and host-cargo-bin.

Also remove host-cargo from menuconfig.

Signed-off-by: Eric Le Bihan <eric.le.bihan.dev@free.fr>
---
 package/Config.in.host            |  2 +-
 package/cargo/Config.in.host      |  8 --------
 package/rust-cargo/Config.in.host | 41 +++++++++++++++++++++++++++++++++++++++
 3 files changed, 42 insertions(+), 9 deletions(-)
 delete mode 100644 package/cargo/Config.in.host
 create mode 100644 package/rust-cargo/Config.in.host

diff --git a/package/Config.in.host b/package/Config.in.host
index 199a8e9856..892e124722 100644
--- a/package/Config.in.host
+++ b/package/Config.in.host
@@ -2,7 +2,6 @@ menu "Host utilities"
 
 	source "package/aespipe/Config.in.host"
 	source "package/android-tools/Config.in.host"
-	source "package/cargo/Config.in.host"
 	source "package/cbootimage/Config.in.host"
 	source "package/checkpolicy/Config.in.host"
 	source "package/cmake/Config.in.host"
@@ -48,6 +47,7 @@ menu "Host utilities"
 	source "package/raspberrypi-usbboot/Config.in.host"
 	source "package/rauc/Config.in.host"
 	source "package/rustc/Config.in.host"
+	source "package/rust-cargo/Config.in.host"
 	source "package/s6-rc/Config.in.host"
 	source "package/sam-ba/Config.in.host"
 	source "package/squashfs/Config.in.host"
diff --git a/package/cargo/Config.in.host b/package/cargo/Config.in.host
deleted file mode 100644
index 0f1ca305c6..0000000000
--- a/package/cargo/Config.in.host
+++ /dev/null
@@ -1,8 +0,0 @@
-config BR2_PACKAGE_HOST_CARGO
-	bool "host cargo"
-	depends on BR2_PACKAGE_HAS_HOST_RUSTC
-	help
-	  Cargo is the package manager for the Rust programming
-	  language.
-
-	  https://crates.io/
diff --git a/package/rust-cargo/Config.in.host b/package/rust-cargo/Config.in.host
new file mode 100644
index 0000000000..76929395d4
--- /dev/null
+++ b/package/rust-cargo/Config.in.host
@@ -0,0 +1,41 @@
+config BR2_PACKAGE_HOST_RUST_CARGO
+	bool "host rust cargo"
+	depends on BR2_PACKAGE_HAS_HOST_RUSTC
+	help
+	  Cargo is the package manager for the Rust programming
+	  language.
+
+	  http://crates.io
+
+if BR2_PACKAGE_HOST_RUST_CARGO
+
+choice
+	prompt "Rust package manager variant"
+	default BR2_PACKAGE_HOST_CARGO
+	help
+	  Select a Rust package manager
+
+config BR2_PACKAGE_HOST_CARGO
+	bool "host cargo"
+	select BR2_PACKAGE_HAS_HOST_RUST_CARGO
+	help
+	  This package will build Cargo from source.
+
+config BR2_PACKAGE_HOST_CARGO_BIN
+	bool "host cargo (pre-built)"
+	select BR2_PACKAGE_HAS_HOST_RUST_CARGO
+	help
+	  This package will install a pre-built version of Cargo.
+
+endchoice
+
+config BR2_PACKAGE_HAS_HOST_RUST_CARGO
+	bool
+
+config BR2_PACKAGE_PROVIDES_HOST_RUST_CARGO
+	string
+	default "host-cargo" if BR2_PACKAGE_HOST_CARGO
+	default "host-cargo-bin" if BR2_PACKAGE_HOST_CARGO_BIN
+
+endif
+
-- 
2.14.3

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

* [Buildroot] [PATCH v8 0/9] Add support for the Rust programming language
  2017-12-17 17:57 [Buildroot] [PATCH v8 0/9] Add support for the Rust programming language Eric Le Bihan
                   ` (7 preceding siblings ...)
  2017-12-17 17:58 ` [Buildroot] [PATCH 9/9] rust-cargo: new virtual package Eric Le Bihan
@ 2017-12-17 18:17 ` Eric Le Bihan
  2017-12-18  6:54 ` Thomas Petazzoni
  9 siblings, 0 replies; 17+ messages in thread
From: Eric Le Bihan @ 2017-12-17 18:17 UTC (permalink / raw)
  To: buildroot

Hi!

On 17-12-17 18:57:59, Eric Le Bihan wrote:
> This series adds support for the Rust programming language by adding the
> following packages:
>
>  - rustc: a virtual package for the Rust compiler.
>  - rust-bin: provides a pre-built version of rustc.
>  - cargo-bin: provides a pre-built version of Rust package manager.
>  - rust: builds rustc from source.
>  - cargo: builds Rust package manager from source.
>  - rust-cargo: a virtual package for the Rust package manager.
>
> Only the host variants are provided.
>
> The rustc and rust-cargo virtual packages are inspired by the mysql one.
>
> v7 -> v8:
>
>  - replace cargo-bootstrap by cargo-bin
>  - drop rust-bootstrap and use rust-bin instead
>  - rust-bin and rust versions are the same
>  - cargo-bin and cargo versions are the same
>  - bump cargo to 0.23.0
>  - bump rust to 1.22.1
>  - add rust-cargo virtual package

One patch of this series adds a package to build rust from source. It
contains a patch to remove *.orig files from usptream tarball and patch
some checksum files which list these files (used by Cargo).

Unfortunately, one of these checksum files has a line which exceeds 998
characters, which does not make git-send-email happy. I sent the patch
series using --no-validate, but this may not make all mail clients (or
mailman) happy too!

Should I resent as attachment instead?

Regards,

--
ELB

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

* [Buildroot] [PATCH 7/9] libcurl: add host variant
  2017-12-17 17:58 ` [Buildroot] [PATCH 7/9] libcurl: " Eric Le Bihan
@ 2017-12-18  5:40   ` Baruch Siach
  2017-12-27 18:53     ` Eric Le Bihan
  0 siblings, 1 reply; 17+ messages in thread
From: Baruch Siach @ 2017-12-18  5:40 UTC (permalink / raw)
  To: buildroot

Hi Eric,

On Sun, Dec 17, 2017 at 06:58:06PM +0100, Eric Le Bihan wrote:
> Signed-off-by: Eric Le Bihan <eric.le.bihan.dev@free.fr>
> ---
>  package/libcurl/libcurl.mk | 13 +++++++++++++
>  1 file changed, 13 insertions(+)
> 
> diff --git a/package/libcurl/libcurl.mk b/package/libcurl/libcurl.mk
> index 0aab58a7de..c95b0eea6b 100644
> --- a/package/libcurl/libcurl.mk
> +++ b/package/libcurl/libcurl.mk
> @@ -88,4 +88,17 @@ endef
>  LIBCURL_POST_INSTALL_TARGET_HOOKS += LIBCURL_TARGET_CLEANUP
>  endif
>  
> +HOST_LIBCURL_DEPENDENCIES = host-openssl
> +HOST_LIBCURL_CONF_OPTS = \
> +	--disable-manual \
> +	--disable-ntlm-wb \
> +	--disable-curldebug \
> +	--without-gnutls \
> +	--without-mbedtls \
> +	--without-polarssl \
> +	--without-nss

What about --with-ssl=...? Isn't that needed for the linking with 
host-openssl?

baruch

> +
> +HOST_LIBCURL_POST_PATCH_HOOKS += LIBCURL_FIX_DOT_PC
> +
>  $(eval $(autotools-package))
> +$(eval $(host-autotools-package))

baruch

-- 
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -

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

* [Buildroot] [PATCH v8 0/9] Add support for the Rust programming language
  2017-12-17 17:57 [Buildroot] [PATCH v8 0/9] Add support for the Rust programming language Eric Le Bihan
                   ` (8 preceding siblings ...)
  2017-12-17 18:17 ` [Buildroot] [PATCH v8 0/9] Add support for the Rust programming language Eric Le Bihan
@ 2017-12-18  6:54 ` Thomas Petazzoni
  2017-12-18 10:25   ` Eric Le Bihan
  9 siblings, 1 reply; 17+ messages in thread
From: Thomas Petazzoni @ 2017-12-18  6:54 UTC (permalink / raw)
  To: buildroot

Hello,

On Sun, 17 Dec 2017 18:57:59 +0100, Eric Le Bihan wrote:

> Eric Le Bihan (9):
>   rustc: new virtual package
>   rust-bin: new package
>   cargo-bin: new package
>   rust: new package

This patch didn't make it to the list, because it is too large (2.48
MB). Do we have another option than carrying this use patch in
Buildroot ?

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

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

* [Buildroot] [PATCH v8 0/9] Add support for the Rust programming language
  2017-12-18  6:54 ` Thomas Petazzoni
@ 2017-12-18 10:25   ` Eric Le Bihan
  2017-12-18 10:31     ` Thomas Petazzoni
  2017-12-18 10:49     ` Eric Le Bihan
  0 siblings, 2 replies; 17+ messages in thread
From: Eric Le Bihan @ 2017-12-18 10:25 UTC (permalink / raw)
  To: buildroot

Hi!

> On Sun, 17 Dec 2017 18:57:59 +0100, Eric Le Bihan wrote:
> 
> > Eric Le Bihan (9):
> >   rustc: new virtual package
> >   rust-bin: new package
> >   cargo-bin: new package
> >   rust: new package
> 
> This patch didn't make it to the list, because it is too large (2.48
> MB). Do we have another option than carrying this use patch in
> Buildroot ?

The patch which adds the package to build Rust from source provides a 
patch to fix a problem involving files ending with *.orig.

As the Rust compiler is built using Cargo, the tarball contains vendored
versions of the crates (e.g. src/vendor/backtrace-sys). Each crate 
contains a file named Cargo.toml.orig. An associated file named
.cargo-checksum.json will contain a checksum for Cargo.toml.orig (and
the other source files).

But support/scripts/apply-patches.sh will delete the Cargo.toml.orig 
files. This will cause the build to fail, as Cargo will not be able to 
find the file and verify the checksum.

So the patch included in the rust package removes all Cargo.toml.orig 
entries from the affected .cargo-checksum.json. As these files list all
the source files, this results in a huge patch.

Besides, as these are non-indented JSON files, some are one-lined and 
thus the 998 characters limit enforced by git-send-email is exceeded.

So, if there a way to stop support/scripts/apply-patches.sh from pruning
Cargo.toml.orig files, so this patch can be dropped?

Regards,

--
ELB

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

* [Buildroot] [PATCH v8 0/9] Add support for the Rust programming language
  2017-12-18 10:25   ` Eric Le Bihan
@ 2017-12-18 10:31     ` Thomas Petazzoni
  2017-12-18 15:26       ` Yann E. MORIN
  2017-12-18 10:49     ` Eric Le Bihan
  1 sibling, 1 reply; 17+ messages in thread
From: Thomas Petazzoni @ 2017-12-18 10:31 UTC (permalink / raw)
  To: buildroot

Hello,

On Mon, 18 Dec 2017 11:25:11 +0100 (CET), Eric Le Bihan wrote:

> The patch which adds the package to build Rust from source provides a 
> patch to fix a problem involving files ending with *.orig.
> 
> As the Rust compiler is built using Cargo, the tarball contains vendored
> versions of the crates (e.g. src/vendor/backtrace-sys). Each crate 
> contains a file named Cargo.toml.orig. An associated file named
> .cargo-checksum.json will contain a checksum for Cargo.toml.orig (and
> the other source files).
> 
> But support/scripts/apply-patches.sh will delete the Cargo.toml.orig 
> files. This will cause the build to fail, as Cargo will not be able to 
> find the file and verify the checksum.
> 
> So the patch included in the rust package removes all Cargo.toml.orig 
> entries from the affected .cargo-checksum.json. As these files list all
> the source files, this results in a huge patch.
> 
> Besides, as these are non-indented JSON files, some are one-lined and 
> thus the 998 characters limit enforced by git-send-email is exceeded.
> 
> So, if there a way to stop support/scripts/apply-patches.sh from pruning
> Cargo.toml.orig files, so this patch can be dropped?

Do we really have a reason to remove *.orig files in
apply-patches.sh ? .orig backup files are only produced if -b is passed
to patch, which we are not using.

Are there other cases where .orig files are produced by patch *and* we
really need to remove them?

Peter, Arnout, Yann?

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

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

* [Buildroot] [PATCH v8 0/9] Add support for the Rust programming language
  2017-12-18 10:25   ` Eric Le Bihan
  2017-12-18 10:31     ` Thomas Petazzoni
@ 2017-12-18 10:49     ` Eric Le Bihan
  1 sibling, 0 replies; 17+ messages in thread
From: Eric Le Bihan @ 2017-12-18 10:49 UTC (permalink / raw)
  To: buildroot


> So, if there a way to stop support/scripts/apply-patches.sh from
> pruning Cargo.toml.orig files, so this patch can be dropped?

Now that I think of it, adding a post-extract hook to remove the
Cargo.toml.orig entries from .cargo-checksum.json files may do 
the trick... No more big patch nor apply-patches.sh modifications.

--
ELB

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

* [Buildroot] [PATCH v8 0/9] Add support for the Rust programming language
  2017-12-18 10:31     ` Thomas Petazzoni
@ 2017-12-18 15:26       ` Yann E. MORIN
  0 siblings, 0 replies; 17+ messages in thread
From: Yann E. MORIN @ 2017-12-18 15:26 UTC (permalink / raw)
  To: buildroot

Thomas, Eric, All,

On 2017-12-18 11:31 +0100, Thomas Petazzoni spake thusly:
> On Mon, 18 Dec 2017 11:25:11 +0100 (CET), Eric Le Bihan wrote:
> > The patch which adds the package to build Rust from source provides a 
> > patch to fix a problem involving files ending with *.orig.
> > 
> > As the Rust compiler is built using Cargo, the tarball contains vendored
> > versions of the crates (e.g. src/vendor/backtrace-sys). Each crate 
> > contains a file named Cargo.toml.orig. An associated file named
> > .cargo-checksum.json will contain a checksum for Cargo.toml.orig (and
> > the other source files).
> > 
> > But support/scripts/apply-patches.sh will delete the Cargo.toml.orig 
> > files. This will cause the build to fail, as Cargo will not be able to 
> > find the file and verify the checksum.
> > 
> > So the patch included in the rust package removes all Cargo.toml.orig 
> > entries from the affected .cargo-checksum.json. As these files list all
> > the source files, this results in a huge patch.
> > 
> > Besides, as these are non-indented JSON files, some are one-lined and 
> > thus the 998 characters limit enforced by git-send-email is exceeded.
> > 
> > So, if there a way to stop support/scripts/apply-patches.sh from pruning
> > Cargo.toml.orig files, so this patch can be dropped?
> 
> Do we really have a reason to remove *.orig files in
> apply-patches.sh ? .orig backup files are only produced if -b is passed
> to patch, which we are not using.
> 
> Are there other cases where .orig files are produced by patch *and* we
> really need to remove them?
> 
> Peter, Arnout, Yann?

I have no idea about this, but the removal of .orig file has been there
since the dawn of ages, more than 15 years ago now, and the reason is
not explained.

I think we could very well live with .orig files, though.

Alternatively, we could set and export SIMPLE_BACKUP_SUFFIX=.orig.br (or
to any other singling-out value) which will force the backup suffix just
in case, and then we only remove those files.

Yet, this is adding a bit of complexity, when we could probably lives
happy with .orig files.

Except I suspect some badly-behaving packages could very well do things
like:

    data:
        call_my_tool $(wildcard #(top_srcdir)/data/*)

and thus, if we happen to patch a file in the data/ subdir, we'd break
the build of that package.

So, I would go for not removing .orig files, and in case there is one
package where this causes a problem, either we fix it, or we add a
post-patch hook to remove the .orig files, or we switch to using the
SIMPLE_BACKUP_SUFFIX variable if too many packages are impacted.

Deal? ;-)

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

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

* [Buildroot] [PATCH 7/9] libcurl: add host variant
  2017-12-18  5:40   ` Baruch Siach
@ 2017-12-27 18:53     ` Eric Le Bihan
  0 siblings, 0 replies; 17+ messages in thread
From: Eric Le Bihan @ 2017-12-27 18:53 UTC (permalink / raw)
  To: buildroot

Hi!

On 17-12-18 07:40:48, Baruch Siach wrote:
> Hi Eric,
>
> On Sun, Dec 17, 2017 at 06:58:06PM +0100, Eric Le Bihan wrote:
> > Signed-off-by: Eric Le Bihan <eric.le.bihan.dev@free.fr>
> > ---
> >  package/libcurl/libcurl.mk | 13 +++++++++++++
> >  1 file changed, 13 insertions(+)
> >
> > diff --git a/package/libcurl/libcurl.mk b/package/libcurl/libcurl.mk
> > index 0aab58a7de..c95b0eea6b 100644
> > --- a/package/libcurl/libcurl.mk
> > +++ b/package/libcurl/libcurl.mk
> > @@ -88,4 +88,17 @@ endef
> >  LIBCURL_POST_INSTALL_TARGET_HOOKS += LIBCURL_TARGET_CLEANUP
> >  endif
> >
> > +HOST_LIBCURL_DEPENDENCIES = host-openssl
> > +HOST_LIBCURL_CONF_OPTS = \
> > +	--disable-manual \
> > +	--disable-ntlm-wb \
> > +	--disable-curldebug \
> > +	--without-gnutls \
> > +	--without-mbedtls \
> > +	--without-polarssl \
> > +	--without-nss
>
> What about --with-ssl=...? Isn't that needed for the linking with
> host-openssl?

Though the configuration script properly detects the openssl library and
enables support for it, it is true that it might be better to explicitly
enable it. I'll add this in the next spin. Thanks.

Regards,

--
ELB

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

end of thread, other threads:[~2017-12-27 18:53 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-17 17:57 [Buildroot] [PATCH v8 0/9] Add support for the Rust programming language Eric Le Bihan
2017-12-17 17:58 ` [Buildroot] [PATCH 1/9] rustc: new virtual package Eric Le Bihan
2017-12-17 17:58 ` [Buildroot] [PATCH 2/9] rust-bin: new package Eric Le Bihan
2017-12-17 17:58 ` [Buildroot] [PATCH 3/9] cargo-bin: " Eric Le Bihan
2017-12-17 17:58 ` [Buildroot] [PATCH 5/9] libssh2: add host variant Eric Le Bihan
2017-12-17 17:58 ` [Buildroot] [PATCH 6/9] libhttpparser: " Eric Le Bihan
2017-12-17 17:58 ` [Buildroot] [PATCH 7/9] libcurl: " Eric Le Bihan
2017-12-18  5:40   ` Baruch Siach
2017-12-27 18:53     ` Eric Le Bihan
2017-12-17 17:58 ` [Buildroot] [PATCH 8/9] cargo: new package Eric Le Bihan
2017-12-17 17:58 ` [Buildroot] [PATCH 9/9] rust-cargo: new virtual package Eric Le Bihan
2017-12-17 18:17 ` [Buildroot] [PATCH v8 0/9] Add support for the Rust programming language Eric Le Bihan
2017-12-18  6:54 ` Thomas Petazzoni
2017-12-18 10:25   ` Eric Le Bihan
2017-12-18 10:31     ` Thomas Petazzoni
2017-12-18 15:26       ` Yann E. MORIN
2017-12-18 10:49     ` Eric Le Bihan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox