2020-07-15 17:52:33 -07:00
|
|
|
package=native_rust
|
2022-07-12 05:07:20 -07:00
|
|
|
# To update the Rust compiler, change the version below and then run the script
|
|
|
|
# ./contrib/devtools/update-rust-hashes.sh
|
|
|
|
# The Rust compiler should use the same LLVM version as the Clang compiler; you
|
|
|
|
# can check this with `rustc --version -v`.
|
2023-04-20 14:58:08 -07:00
|
|
|
$(package)_version=1.69.0
|
2018-05-15 15:21:37 -07:00
|
|
|
$(package)_download_path=https://static.rust-lang.org/dist
|
2017-06-09 03:15:27 -07:00
|
|
|
$(package)_file_name_linux=rust-$($(package)_version)-x86_64-unknown-linux-gnu.tar.gz
|
2023-04-20 14:58:08 -07:00
|
|
|
$(package)_sha256_hash_linux=2ca4a306047c0b8b4029c382910fcbc895badc29680e0332c9df990fd1c70d4f
|
2017-06-09 03:15:27 -07:00
|
|
|
$(package)_file_name_darwin=rust-$($(package)_version)-x86_64-apple-darwin.tar.gz
|
2023-04-20 14:58:08 -07:00
|
|
|
$(package)_sha256_hash_darwin=9818dab2c3726d63dfbfde12c9273e62e484ef6d6f6e05a6431a3e089c335454
|
2019-05-22 05:08:59 -07:00
|
|
|
$(package)_file_name_freebsd=rust-$($(package)_version)-x86_64-unknown-freebsd.tar.gz
|
2023-04-20 14:58:08 -07:00
|
|
|
$(package)_sha256_hash_freebsd=2985d98910b4a1dd336bfc7a1ac3b18082ed917cff097b4db6f0d6602016c289
|
2021-09-04 16:17:02 -07:00
|
|
|
$(package)_file_name_aarch64_linux=rust-$($(package)_version)-aarch64-unknown-linux-gnu.tar.gz
|
2023-04-20 14:58:08 -07:00
|
|
|
$(package)_sha256_hash_aarch64_linux=88af5aa7a40c8f1b40416a1f27de8ffbe09c155d933f69d3e109c0ccee92353b
|
2021-09-04 16:17:02 -07:00
|
|
|
|
2018-06-25 10:43:46 -07:00
|
|
|
# Mapping from GCC canonical hosts to Rust targets
|
2020-03-13 02:25:39 -07:00
|
|
|
# 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.
|
2020-09-28 10:20:47 -07:00
|
|
|
$(package)_rust_target_x86_64-pc-linux-gnu=x86_64-unknown-linux-gnu
|
2018-06-25 10:43:46 -07:00
|
|
|
$(package)_rust_target_x86_64-w64-mingw32=x86_64-pc-windows-gnu
|
|
|
|
|
|
|
|
# Mapping from Rust targets to SHA-256 hashes
|
2023-04-20 14:58:08 -07:00
|
|
|
$(package)_rust_std_sha256_hash_aarch64-unknown-linux-gnu=8f42b40c0a0658ee75ce758652c9821fac7db3fbd8d20f7fb2483ec2c57ee0ac
|
|
|
|
$(package)_rust_std_sha256_hash_x86_64-apple-darwin=e44d71250dc5a238da0dc4784dad59d562862653adecd31ea52e0920b85c6a7c
|
|
|
|
$(package)_rust_std_sha256_hash_x86_64-pc-windows-gnu=09ded4a4c27c16aff9c9911640b1bdf6e1172237ce540ed4dc3e166e9438f0d7
|
|
|
|
$(package)_rust_std_sha256_hash_x86_64-unknown-freebsd=eed4b3f3358a8887b0f6a62e021469878a8990af9b94c2fe87d3c1b0220913bb
|
2018-06-25 10:43:46 -07:00
|
|
|
|
2020-03-12 01:02:19 -07:00
|
|
|
define rust_target
|
2021-01-05 14:26:39 -08:00
|
|
|
$(if $($(1)_rust_target_$(2)),$($(1)_rust_target_$(2)),$(if $(findstring darwin,$(3)),x86_64-apple-darwin,$(if $(findstring freebsd,$(3)),x86_64-unknown-freebsd,$(2))))
|
2020-03-12 01:02:19 -07:00
|
|
|
endef
|
|
|
|
|
2023-02-16 07:45:29 -08:00
|
|
|
define $(package)_set_vars
|
|
|
|
$(package)_stage_opts=--disable-ldconfig
|
|
|
|
$(package)_stage_build_opts=--without=rust-docs-json-preview,rust-docs
|
|
|
|
endef
|
|
|
|
|
2018-06-25 10:43:46 -07:00
|
|
|
ifneq ($(canonical_host),$(build))
|
2020-03-13 02:25:39 -07:00
|
|
|
$(package)_rust_target=$(call rust_target,$(package),$(canonical_host),$(host_os))
|
2018-06-25 10:43:46 -07:00
|
|
|
$(package)_exact_file_name=rust-std-$($(package)_version)-$($(package)_rust_target).tar.gz
|
|
|
|
$(package)_exact_sha256_hash=$($(package)_rust_std_sha256_hash_$($(package)_rust_target))
|
2018-04-13 20:40:18 -07:00
|
|
|
$(package)_build_subdir=buildos
|
2018-06-25 10:43:46 -07:00
|
|
|
$(package)_extra_sources=$($(package)_file_name_$(build_os))
|
2018-04-13 20:40:18 -07:00
|
|
|
|
|
|
|
define $(package)_fetch_cmds
|
|
|
|
$(call fetch_file,$(package),$($(package)_download_path),$($(package)_download_file),$($(package)_file_name),$($(package)_sha256_hash)) && \
|
|
|
|
$(call fetch_file,$(package),$($(package)_download_path),$($(package)_file_name_$(build_os)),$($(package)_file_name_$(build_os)),$($(package)_sha256_hash_$(build_os)))
|
|
|
|
endef
|
|
|
|
|
|
|
|
define $(package)_extract_cmds
|
|
|
|
mkdir -p $($(package)_extract_dir) && \
|
|
|
|
echo "$($(package)_sha256_hash) $($(package)_source)" > $($(package)_extract_dir)/.$($(package)_file_name).hash && \
|
|
|
|
echo "$($(package)_sha256_hash_$(build_os)) $($(package)_source_dir)/$($(package)_file_name_$(build_os))" >> $($(package)_extract_dir)/.$($(package)_file_name).hash && \
|
|
|
|
$(build_SHA256SUM) -c $($(package)_extract_dir)/.$($(package)_file_name).hash && \
|
2018-06-25 10:43:46 -07:00
|
|
|
mkdir $(canonical_host) && \
|
|
|
|
tar --strip-components=1 -xf $($(package)_source) -C $(canonical_host) && \
|
2018-04-13 20:40:18 -07:00
|
|
|
mkdir buildos && \
|
|
|
|
tar --strip-components=1 -xf $($(package)_source_dir)/$($(package)_file_name_$(build_os)) -C buildos
|
|
|
|
endef
|
|
|
|
|
|
|
|
define $(package)_stage_cmds
|
2023-02-16 07:45:29 -08:00
|
|
|
bash ./install.sh --destdir=$($(package)_staging_dir) --prefix=$(build_prefix) $($(package)_stage_opts) $($(package)_stage_build_opts) && \
|
|
|
|
../$(canonical_host)/install.sh --destdir=$($(package)_staging_dir) --prefix=$(build_prefix) $($(package)_stage_opts)
|
2018-04-13 20:40:18 -07:00
|
|
|
endef
|
|
|
|
else
|
2017-03-17 10:46:41 -07:00
|
|
|
|
|
|
|
define $(package)_stage_cmds
|
2023-02-16 07:45:29 -08:00
|
|
|
bash ./install.sh --destdir=$($(package)_staging_dir) --prefix=$(build_prefix) $($(package)_stage_opts) $($(package)_stage_build_opts)
|
2017-03-17 10:46:41 -07:00
|
|
|
endef
|
2018-04-13 20:40:18 -07:00
|
|
|
endif
|