Skip to content

Commit

Permalink
Depends: Move librustzcash crate to source tree
Browse files Browse the repository at this point in the history
First step, actual build system changes to follow
  • Loading branch information
Fuzzbawls authored and furszy committed Aug 3, 2020
1 parent 5eec150 commit 8445e9e
Show file tree
Hide file tree
Showing 21 changed files with 83 additions and 246 deletions.
5 changes: 5 additions & 0 deletions .cargo/config.offline
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[source.crates-io]
replace-with = "vendored-sources"

[source.vendored-sources]
# The directory for this source is set to RUST_VENDORED_SOURCES by src/Makefile.am
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,9 @@ PIVX-Qt.app
background.tiff*

# Rust
src/rust/target
.cargo/.configured-for-*
.cargo/config
target/

# Unit-tests
Makefile.test
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/rust/Cargo.toml → Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ edition = "2018"

[lib]
name = "rustzcash"
path = "src/rustzcash.rs"
path = "src/rust/src/rustzcash.rs"
crate-type = ["staticlib"]

[dependencies]
Expand Down
2 changes: 1 addition & 1 deletion depends/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ $(host_prefix)/share/config.site : config.site.in $(host_prefix)/.stamp_$(final_
-e 's|@CXXFLAGS@|$(strip $(host_CXXFLAGS) $(host_$(release_type)_CXXFLAGS))|' \
-e 's|@CPPFLAGS@|$(strip $(host_CPPFLAGS) $(host_$(release_type)_CPPFLAGS))|' \
-e 's|@LDFLAGS@|$(strip $(host_LDFLAGS) $(host_$(release_type)_LDFLAGS))|' \
-e 's|@rust_target@|$(call rust_target,rust,$(canonical_host))|' \
-e 's|@rust_target@|$(call rust_target,rust,$(canonical_host),$(host_os))|' \
-e 's|@allow_host_packages@|$(ALLOW_HOST_PACKAGES)|' \
-e 's|@no_qt@|$(NO_QT)|' \
-e 's|@no_zmq@|$(NO_ZMQ)|' \
Expand Down
3 changes: 3 additions & 0 deletions depends/config.site.in
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ if test -z $enable_zmq && test -n "@no_zmq@"; then
enable_zmq=no
fi

RUST_TARGET="@rust_target@"
RUST_VENDORED_SOURCES="$depends_prefix/vendored-sources"

if test x@host_os@ = xdarwin; then
BREW=no
PORT=no
Expand Down
4 changes: 2 additions & 2 deletions depends/packages/crate_bellman.mk
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package=crate_bellman
$(package)_crate_name=bellman
$(package)_version=0.1.0
$(package)_version=0.2.0
$(package)_download_path=https://static.crates.io/crates/$($(package)_crate_name)
$(package)_file_name=$($(package)_crate_name)-$($(package)_version).crate
$(package)_sha256_hash=eae372472c7ea8f7c8fc6a62f7d5535db8302de7f1aafda2e13a97c4830d3bcf
$(package)_sha256_hash=8a8b3143b11715f8105882a1df9b3d36386aa8e3a6cfd573a2974c9ea9a22fea
$(package)_crate_versioned_name=$($(package)_crate_name)

define $(package)_preprocess_cmds
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package=crate_bech32
$(package)_crate_name=bech32
$(package)_version=0.7.1
package=crate_ff
$(package)_crate_name=ff
$(package)_version=0.5.0
$(package)_download_path=https://static.crates.io/crates/$($(package)_crate_name)
$(package)_file_name=$($(package)_crate_name)-$($(package)_version).crate
$(package)_sha256_hash=9e0089c35ab7c6f2bc55ab23f769913f0ac65b1023e7e74638a1f43128dd5df2
$(package)_sha256_hash=44b4c77ad8a724f1ebb882af5d2d7a2ab62f4d63c8e401d40ab0de1d75262ea3
$(package)_crate_versioned_name=$($(package)_crate_name)

define $(package)_preprocess_cmds
Expand Down
15 changes: 15 additions & 0 deletions depends/packages/crate_ff_derive.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package=crate_ff_derive
$(package)_crate_name=ff_derive
$(package)_version=0.4.0
$(package)_download_path=https://static.crates.io/crates/$($(package)_crate_name)
$(package)_file_name=$($(package)_crate_name)-$($(package)_version).crate
$(package)_sha256_hash=a9cb38a53026415988765d8d7d81b680187a77a486ba9e249dbccd5a3e74429b
$(package)_crate_versioned_name=$($(package)_crate_name)

define $(package)_preprocess_cmds
$(call generate_crate_checksum,$(package))
endef

define $(package)_stage_cmds
$(call vendor_crate_source,$(package))
endef
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package=crate_rand_os
$(package)_crate_name=rand_os
$(package)_version=0.2.1
package=crate_group
$(package)_crate_name=group
$(package)_version=0.2.0
$(package)_download_path=https://static.crates.io/crates/$($(package)_crate_name)
$(package)_file_name=$($(package)_crate_name)-$($(package)_version).crate
$(package)_sha256_hash=ddb525a78d3a0b0e05b6fe0f7df14d7a4dc957944c7b403911ba5a0f1c694967
$(package)_sha256_hash=8cbdfc48f95bef47e3daf3b9d552a1dde6311e3a5fefa43e16c59f651d56fe5b
$(package)_crate_versioned_name=$($(package)_crate_name)

define $(package)_preprocess_cmds
Expand Down
4 changes: 2 additions & 2 deletions depends/packages/crate_pairing.mk
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package=crate_pairing
$(package)_crate_name=pairing
$(package)_version=0.14.2
$(package)_version=0.15.0
$(package)_download_path=https://static.crates.io/crates/$($(package)_crate_name)
$(package)_file_name=$($(package)_crate_name)-$($(package)_version).crate
$(package)_sha256_hash=ceda21136251c6d5a422d3d798d8ac22515a6e8d3521bb60c59a8349d36d0d57
$(package)_sha256_hash=0ec7b64119b36952d5a0c7baf959ef061a07665751706f046f9f6f0f9d83d459
$(package)_crate_versioned_name=$($(package)_crate_name)

define $(package)_preprocess_cmds
Expand Down
16 changes: 0 additions & 16 deletions depends/packages/crate_sapling_crypto.mk

This file was deleted.

15 changes: 15 additions & 0 deletions depends/packages/crate_zcash_primitives.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package=crate_zcash_primitives
$(package)_crate_name=zcash_primitives
$(package)_version=0.1.0
$(package)_download_path=https://static.crates.io/crates/$($(package)_crate_name)
$(package)_file_name=$($(package)_crate_name)-$($(package)_version).crate
$(package)_sha256_hash=9530749bc784c4ca0d7bf000333cec29acf94f1875ad8db088e12dfee1095d13
$(package)_crate_versioned_name=$($(package)_crate_name)

define $(package)_preprocess_cmds
$(call generate_crate_checksum,$(package))
endef

define $(package)_stage_cmds
$(call vendor_crate_source,$(package))
endef
15 changes: 15 additions & 0 deletions depends/packages/crate_zcash_proofs.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package=crate_zcash_proofs
$(package)_crate_name=zcash_proofs
$(package)_version=0.1.0
$(package)_download_path=https://static.crates.io/crates/$($(package)_crate_name)
$(package)_file_name=$($(package)_crate_name)-$($(package)_version).crate
$(package)_sha256_hash=6f12228d3bff81779e848bc7e7a68f282c717ef2f67a69e6477f4667fbb06078
$(package)_crate_versioned_name=$($(package)_crate_name)

define $(package)_preprocess_cmds
$(call generate_crate_checksum,$(package))
endef

define $(package)_stage_cmds
$(call vendor_crate_source,$(package))
endef
16 changes: 0 additions & 16 deletions depends/packages/crate_zip32.mk

This file was deleted.

73 changes: 0 additions & 73 deletions depends/packages/librustzcash.mk

This file was deleted.

13 changes: 9 additions & 4 deletions depends/packages/packages.mk
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ rust_crates := \
crate_arrayref \
crate_arrayvec \
crate_autocfg \
crate_bech32 \
crate_bellman \
crate_bit_vec \
crate_blake2b_simd \
crate_blake2s_simd \
Expand All @@ -28,11 +28,14 @@ rust_crates := \
crate_digest \
crate_directories \
crate_fake_simd \
crate_ff_derive \
crate_ff \
crate_fpe \
crate_futures_cpupool \
crate_futures \
crate_generic_array \
crate_getrandom \
crate_group \
crate_hex \
crate_lazy_static \
crate_libc \
Expand All @@ -44,13 +47,13 @@ rust_crates := \
crate_num_integer \
crate_num_traits \
crate_opaque_debug \
crate_pairing \
crate_ppv_lite86 \
crate_proc_macro2 \
crate_quote \
crate_rand_chacha \
crate_rand_core \
crate_rand_hc \
crate_rand_os \
crate_rand_xorshift \
crate_rand \
crate_rustc_version \
Expand All @@ -64,9 +67,11 @@ rust_crates := \
crate_wasi \
crate_winapi_i686_pc_windows_gnu \
crate_winapi \
crate_winapi_x86_64_pc_windows_gnu
crate_winapi_x86_64_pc_windows_gnu \
crate_zcash_primitives \
crate_zcash_proofs

rust_packages := rust $(rust_crates) librustzcash
rust_packages := rust $(rust_crates)
packages:=boost openssl libevent gmp $(zcash_packages) libsodium

qt_native_packages = native_protobuf
Expand Down
4 changes: 4 additions & 0 deletions depends/packages/rust.mk
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,13 @@ $(package)_sha256_hash_freebsd=230bcf17e4383fba85d3c87fe25d17737459fe561a5f4668f
# If a mapping is not present, we assume they are identical, unless $host_os is
# "darwin", in which case we assume x86_64-apple-darwin.
$(package)_rust_target_x86_64-w64-mingw32=x86_64-pc-windows-gnu
$(package)_rust_target_i686-pc-linux-gnu=i686-unknown-linux-gnu

# Mapping from Rust targets to SHA-256 hashes
$(package)_rust_std_sha256_hash_arm-unknown-linux-gnueabihf=8ef81603f36588de7b11b0598566b7d35714beb70cf666980030c3f96c02641a
$(package)_rust_std_sha256_hash_aarch64-unknown-linux-gnu=1343f51fc87049327233cee8941629c3d7dfdc425d359385f93665de3d46711b
$(package)_rust_std_sha256_hash_i686-unknown-linux-gnu=3a098f8868879bbd0dad697f80b8bea7041066bc15207a88d4f328d618829597
$(package)_rust_std_sha256_hash_x86_64-unknown-linux-gnu=e6bf5495a8b1cfb849fce2753404b3b7ce7fba0c5d743d940fac3ee4558fda26
$(package)_rust_std_sha256_hash_x86_64-apple-darwin=1d61e9ed5d29e1bb4c18e13d551c6d856c73fb8b410053245dc6e0d3b3a0e92c
$(package)_rust_std_sha256_hash_x86_64-pc-windows-gnu=8a8389f3860df6f42fbf8b76a62ddc7b9b6fe6d0fb526dcfc42faab1005bfb6d

Expand Down
20 changes: 0 additions & 20 deletions depends/patches/librustzcash/cargo.config

This file was deleted.

Loading

0 comments on commit 8445e9e

Please sign in to comment.