From 374c80f6582d0cedc61654bd300d21297a953a89 Mon Sep 17 00:00:00 2001 From: Johannes Date: Sat, 15 Jun 2019 13:36:02 +0200 Subject: [PATCH] rdedup: fix cross --- srcpkgs/rdedup/patches/bindgen-cross.patch | 12 ++++++++++++ srcpkgs/rdedup/template | 13 +++++++++---- 2 files changed, 21 insertions(+), 4 deletions(-) create mode 100644 srcpkgs/rdedup/patches/bindgen-cross.patch diff --git a/srcpkgs/rdedup/patches/bindgen-cross.patch b/srcpkgs/rdedup/patches/bindgen-cross.patch new file mode 100644 index 00000000000..dd07d48b99c --- /dev/null +++ b/srcpkgs/rdedup/patches/bindgen-cross.patch @@ -0,0 +1,12 @@ +patch bindgen to use BINDGEN_EXTRA_CLANG_ARGS variable to set sysroot for cross builds +https://github.com/jnbr/rust-bindgen/tree/0.37.4-clang_args + +--- Cargo.toml.orig 2019-06-15 13:18:05.509893680 +0200 ++++ Cargo.toml 2019-06-15 13:19:48.854887006 +0200 +@@ -53,3 +53,6 @@ + slog-term = "2" + slog-async = "2" + url = "1" ++ ++[patch.crates-io] ++bindgen = {git = 'https://github.com/jnbr/rust-bindgen', rev = '4afb05213b3e7e0ec928b84ea85d9f2b99477586'} diff --git a/srcpkgs/rdedup/template b/srcpkgs/rdedup/template index 351259b7030..671165b1c07 100644 --- a/srcpkgs/rdedup/template +++ b/srcpkgs/rdedup/template @@ -1,18 +1,23 @@ # Template file for 'rdedup' pkgname=rdedup version=3.1.1 -revision=2 +revision=3 wrksrc=rdedup-rdedup-v${version} build_style=cargo -hostmakedepends="pkg-config" -makedepends="libressl-devel liblzma-devel libsodium-devel clang" +hostmakedepends="pkg-config clang" +makedepends="libressl-devel liblzma-devel libsodium-devel" short_desc="Data deduplication engine" maintainer="Renato Aguiar " license="MPL-2.0" homepage="https://github.com/dpc/rdedup" distfiles="https://github.com/dpc/rdedup/archive/rdedup-v${version}.tar.gz" checksum=5e7c09c40897cd2f2635e8c213c2ff0f5c4d7ceccbd22980cd4cb0a16f3dfc28 -nocross="error: failed to run custom build command for libloading v0.5.0" + +if [ "$CROSS_BUILD" ]; then + export HOST_CC="$BUILD_CC" + export HOST_CFLAGS="$BUILD_CFLAGS" + export BINDGEN_EXTRA_CLANG_ARGS="--sysroot=${XBPS_CROSS_BASE}" +fi pre_build() { cargo update --package openssl-sys --precise 0.9.46