]> git.zerfleddert.de Git - m1-debian/commitdiff
add script to prepare rust
authorThomas Glanzmann <thomas@glanzmann.de>
Mon, 12 Dec 2022 13:40:34 +0000 (14:40 +0100)
committerThomas Glanzmann <thomas@glanzmann.de>
Mon, 12 Dec 2022 13:40:34 +0000 (14:40 +0100)
m1n1_uboot_kernel.sh
prepare_rust.sh [new file with mode: 0644]

index c26d6136fbded9e53e38a37fac06d5a7bb0a6229..2346db3e885d95752478f6e9a2ecc5d63078a73d 100644 (file)
@@ -9,6 +9,10 @@ set -o xtrace
 
 cd "$(dirname "$0")"
 
 
 cd "$(dirname "$0")"
 
+export CARGO_HOME="$(pwd)/build/cargo"
+export RUSTUP_HOME="$(pwd)/build/rust"
+source "$(pwd)/build/cargo/env"
+
 unset LC_CTYPE
 unset LANG
 
 unset LC_CTYPE
 unset LANG
 
@@ -19,8 +23,8 @@ build_linux()
         cd linux
         git fetch -a -t
         git reset --hard asahi-6.1-rc8-3;
         cd linux
         git fetch -a -t
         git reset --hard asahi-6.1-rc8-3;
-        source "$HOME/.cargo/env"
         cat ../../config.txt > .config
         cat ../../config.txt > .config
+        make LLVM=-15 rustavailable
         make LLVM=-15 olddefconfig
         make -j `nproc` LLVM=-15 V=0 bindeb-pkg > /dev/null
 )
         make LLVM=-15 olddefconfig
         make -j `nproc` LLVM=-15 V=0 bindeb-pkg > /dev/null
 )
diff --git a/prepare_rust.sh b/prepare_rust.sh
new file mode 100644 (file)
index 0000000..0cd2be0
--- /dev/null
@@ -0,0 +1,28 @@
+#!/usr/bin/env bash
+
+set -o errexit
+set -o nounset
+set -o pipefail
+set -o xtrace
+
+cd "$(dirname "$0")"
+
+unset LC_CTYPE
+unset LANG
+
+main() {
+        mkdir -p "$(pwd)/build"
+        export CARGO_HOME="$(pwd)/build/cargo"
+        export RUSTUP_HOME="$(pwd)/build/rust"
+        rm -rf ${CARGO_HOME} ${RUSTUP_HOME}
+        curl https://sh.rustup.rs -sSf | sh -s -- -y --no-modify-path --default-toolchain none
+        source "$(pwd)/build/cargo/env"
+        rustup override set 1.62.0
+        rustup component add rust-src
+        cargo install --locked --version 0.56.0 bindgen
+        rustup component add rustfmt
+        rustup component add clippy
+}
+
+main "$@"
+
Impressum, Datenschutz