rust/build_sysroot/prepare_sysroot_src.sh

33 lines
631 B
Bash
Raw Normal View History

#!/bin/bash
2018-09-18 18:41:41 +02:00
set -e
cd $(dirname "$0")
2018-09-18 18:41:41 +02:00
2018-10-06 11:30:32 +02:00
SRC_DIR=$(dirname $(rustup which rustc))"/../lib/rustlib/src/rust/"
DST_DIR="sysroot_src"
2018-10-06 11:30:32 +02:00
if [ ! -e $SRC_DIR ]; then
echo "Please install rust-src component"
exit 1
fi
rm -rf $DST_DIR
mkdir -p $DST_DIR/src
2018-10-06 14:57:06 +02:00
cp -r $SRC_DIR/src $DST_DIR/
pushd $DST_DIR
echo "[GIT] init"
2018-09-18 18:41:41 +02:00
git init
echo "[GIT] add"
2018-09-18 18:41:41 +02:00
git add .
echo "[GIT] commit"
2018-09-18 18:41:41 +02:00
git commit -m "Initial commit" -q
for file in $(ls ../../patches/ | grep -v patcha); do
echo "[GIT] apply" $file
git apply ../../patches/$file
2019-11-24 15:44:39 +01:00
git add -A
git commit --no-gpg-sign -m "Patch $file"
done
popd
echo "Successfully prepared libcore for building"