File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ _dist
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ # Load stack utils
4+ . /usr/bin/stack-utils
5+
6+ # Implement build function
7+ function build() {
8+ generate-stack-path
9+ case " $OS_ARCH " in
10+ ' amd64' )
11+ downloadUrl=" https://static.rust-lang.org/dist/rust-${STACK_VERSION} -x86_64-unknown-linux-gnu.tar.gz" ;
12+ ;;
13+ ' arm64' )
14+ downloadUrl=" https://static.rust-lang.org/dist/rust-${STACK_VERSION} -aarch64-unknown-linux-gnu.tar.gz" ;
15+ ;;
16+ * ) echo >&2 " error: unsupported architecture: '$arch '" ; exit 1 ;;
17+ esac ;
18+ curl -fsSL -o rust.tar.gz " ${downloadUrl} "
19+ tar -xvzf rust.tar.gz
20+ cd rust-${STACK_VERSION} -* -unknown-linux-gnu
21+ ./install.sh --prefix=/opt/drycc/rust
22+ rm -rf /opt/drycc/rust/share /opt/drycc/rust/bin/rustdoc
23+ cp -rf /opt/drycc/rust/* " ${DATA_DIR} "
24+ mkdir -p " ${DATA_DIR} " /target " ${DATA_DIR} " /env
25+ echo " /opt/drycc/rust/target" > " ${DATA_DIR} " /env/CARGO_TARGET_DIR
26+ cd ..
27+
28+ rm -rf rust-${STACK_VERSION} -* -unknown-linux-gnu rust.tar.gz
29+ }
30+
31+ # call build stack
32+ build-stack " ${1} "
You can’t perform that action at this time.
0 commit comments