]> git.lizzy.rs Git - rust.git/blob - build_sysroot/prepare_sysroot_src.sh
Stop using xargo for building the sysroot
[rust.git] / build_sysroot / prepare_sysroot_src.sh
1 #!/bin/bash
2 set -e
3 cd $(dirname "$0")
4
5 SRC_DIR=$(dirname $(rustup which rustc))"/../lib/rustlib/src/rust/"
6 DST_DIR="sysroot_src"
7
8 if [ ! -e $SRC_DIR ]; then
9     echo "Please install rust-src component"
10     exit 1
11 fi
12
13 rm -rf $DST_DIR
14 mkdir -p $DST_DIR/src
15 cp -r $SRC_DIR/src $DST_DIR/
16
17 pushd $DST_DIR
18 echo "[GIT] init"
19 git init
20 echo "[GIT] add"
21 git add .
22 echo "[GIT] commit"
23 git commit -m "Initial commit" -q
24 for file in $(ls ../../patches/ | grep -v patcha); do
25 echo "[GIT] apply" $file
26 git apply ../../patches/$file
27 git commit -am "Patch $file"
28 done
29 popd
30
31 echo "Successfully prepared libcore for building"