summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--contrib/depends/.dockerignore10
-rw-r--r--contrib/depends/packages/native_ccache.mk2
-rw-r--r--contrib/depends/packages/native_mrustc.mk41
-rw-r--r--contrib/depends/packages/packages.mk2
4 files changed, 53 insertions, 2 deletions
diff --git a/contrib/depends/.dockerignore b/contrib/depends/.dockerignore
new file mode 100644
index 0000000..3cb4b9a
--- /dev/null
+++ b/contrib/depends/.dockerignore
@@ -0,0 +1,10 @@
+SDKs/
+work/
+built/
+sources/
+config.site
+x86_64*
+i686*
+mips*
+arm*
+aarch64*
diff --git a/contrib/depends/packages/native_ccache.mk b/contrib/depends/packages/native_ccache.mk
index 1523660..941784f 100644
--- a/contrib/depends/packages/native_ccache.mk
+++ b/contrib/depends/packages/native_ccache.mk
@@ -13,7 +13,7 @@ define $(package)_config_cmds
endef
define $(package)_build_cmds
- cmake --build build --parallel
+ cmake --build build --parallel $(shell nproc)
endef
define $(package)_stage_cmds
diff --git a/contrib/depends/packages/native_mrustc.mk b/contrib/depends/packages/native_mrustc.mk
new file mode 100644
index 0000000..3fe49cd
--- /dev/null
+++ b/contrib/depends/packages/native_mrustc.mk
@@ -0,0 +1,41 @@
+package=native_mrustc
+$(package)_version=0.11
+$(package)_download_path=https://github.com/thepowersgang/mrustc/archive
+$(package)_download_file=b6754f574f8846eb842feba4ccbeeecb10bdfacc.tar.gz
+$(package)_file_name=$(package)-$($(package)_version).tar.gz
+$(package)_sha256_hash=4b006089cf770fd31971ac93d690bf485483a4a309460a6ef41fa64cf1f87649
+$(package)_dependencies=native_ccache
+
+define $(package)_set_vars
+$(package)_config_opts=
+$(package)_build_opts=
+$(package)_build_env=
+endef
+
+define $(package)_preprocess_cmds
+ cd $($(package)_extract_dir) && \
+ if [ -f script-overrides/stable-1.54.0-macos/build_std.txt ]; then \
+ ARCH=`uname -m | sed 's/arm64/aarch64/'` && \
+ sed -i.bak "s/STD_ENV_ARCH=[a-zA-Z0-9_]*/STD_ENV_ARCH=$$ARCH/" script-overrides/stable-1.54.0-macos/build_std.txt; \
+ fi && \
+ if [ `uname -s` = "Darwin" ]; then \
+ echo 'Patching mrustc to work with clang on macOS' && \
+ sed -i.bak 's/-fno-tree-sra//g' Makefile && \
+ grep -rl -- "-fno-tree-sra" . | xargs sed -i.bak 's/-fno-tree-sra//g'; \
+ fi
+endef
+
+define $(package)_build_cmds
+ cd $($(package)_extract_dir) && \
+ $($(package)_build_env) PARLEVEL=$(shell nproc) ./build-1.54.0.sh -j$(shell nproc)
+endef
+
+define $(package)_stage_cmds
+ mkdir -p $($(package)_staging_dir)/native/bin $($(package)_staging_dir)/native/lib && \
+ cp bin/mrustc bin/minicargo $($(package)_staging_dir)/native/bin && \
+ cp -r output-1.54.0 $($(package)_staging_dir)/native/lib
+endef
+
+define $(package)_postprocess_cmds
+ rm -rf $($(package)_staging_dir)/native/lib/output-1.54.0/rustc-build
+endef \ No newline at end of file
diff --git a/contrib/depends/packages/packages.mk b/contrib/depends/packages/packages.mk
index fdeb5f3..571df70 100644
--- a/contrib/depends/packages/packages.mk
+++ b/contrib/depends/packages/packages.mk
@@ -2,7 +2,7 @@ packages:=boost openssl zeromq libiconv expat unbound polyseed
# ccache is useless in gitian builds
ifneq ($(GITIAN),1)
-native_packages := native_ccache
+native_packages := native_ccache native_mrustc
endif
hardware_packages := hidapi protobuf libusb