Added cbindgen

This commit is contained in:
Jan Horak 2019-09-03 14:44:53 +02:00
parent c65ef0279a
commit 0ca10b45fa
4 changed files with 61 additions and 0 deletions

1
.gitignore vendored
View File

@ -257,3 +257,4 @@ thunderbird-langpacks-3.1.2-20100803.tar.bz2
/thunderbird-68.0.source.tar.xz
/thunderbird-langpacks-68.0-20190829.tar.xz
/lightning-langpacks-68.0.tar.xz
/cbindgen-vendor.tar.xz

32
gen_cbindgen-vendor.sh Executable file
View File

@ -0,0 +1,32 @@
#!/bin/bash
set -x
# Dummy Cargo.toml file with cbindgen dependency
cat > Cargo.toml <<EOL
[package]
name = "dummy"
version = "0.0.1"
description = """
This is a dummy package which contains dependency on cbindgen
to be used with 'cargo vendor' commmand.
"""
[dependencies]
cbindgen = "0.9.0"
[[bin]]
name = "dummy"
path = "dummy.rs"
doc = false
EOL
cargo install cargo-vendor
cargo vendor
cd vendor
tar -cJf ../cbindgen-vendor.tar.xz *
cd ..
rm -f Cargo.toml
rm -rf vendor

View File

@ -1,3 +1,4 @@
SHA512 (thunderbird-68.0.source.tar.xz) = 91f82016b71d65b58c1383248ac6f7a8cd8217409323eb14e8aabf2e509391bba4d18e0aa6d0cdac191d10e9794977f22f509078b7c5e3ac7c22afe379a0f299
SHA512 (thunderbird-langpacks-68.0-20190829.tar.xz) = c11ca1f39c146cfbad8b2e4d5e1e8698caa6d97c9bb650b788a7df487dc3e2ee551aec9b814baae064b06543f0ae832583005e02c9d5cab1f3e66dbe1b28b08f
SHA512 (lightning-langpacks-68.0.tar.xz) = d51c99a5d3dd95b66552fab6fdf9d55d00f56dcc73389790354846078a0f973bbd6273ada0d342f09a4045f3453c7e2bdd166821b4100efc0bc511f77a099148
SHA512 (cbindgen-vendor.tar.xz) = 88afa0bc6af525cbb46bc75578b90419b28b95b396d5002fbf299a78a173681b840096ff83ef6e48553d1a5e0aa04e79383ab4d09bf431f3b864fcbacc7de46d

View File

@ -15,6 +15,7 @@ ExcludeArch: s390x
%define build_langpacks 1
%global build_with_clang 0
%global use_bundled_cbindgen 1
%global disable_elfhack 0
%if 0%{?fedora} > 28
@ -192,8 +193,15 @@ Provides: thunderbird-lightning
Obsoletes: thunderbird-lightning-gdata <= 1:3.3.0.14
BuildRequires: rust
BuildRequires: cargo
%if 0%{?build_with_clang}
BuildRequires: clang-devel
%endif
BuildRequires: python2-devel
%if !0%{?use_bundled_cbindgen}
BuildRequires: cbindgen
%endif
Suggests: u2f-hidraw-policy
%description
@ -377,6 +385,25 @@ echo "ac_add_options --disable-crashreporter" >> .mozconfig
#===============================================================================
%build
%if 0%{?use_bundled_cbindgen}
mkdir -p my_rust_vendor
cd my_rust_vendor
%{__tar} xf %{SOURCE2}
cd -
mkdir -p .cargo
cat > .cargo/config <<EOL
[source.crates-io]
replace-with = "vendored-sources"
[source.vendored-sources]
directory = "`pwd`/my_rust_vendor"
EOL
env CARGO_HOME=.cargo cargo install cbindgen
export PATH=`pwd`/.cargo/bin:$PATH
%endif
%if %{?system_sqlite}
# Do not proceed with build if the sqlite require would be broken:
# make sure the minimum requirement is non-empty, ...