rust/prepare_libcore.sh
2018-10-06 11:30:32 +02:00

24 lines
473 B
Bash
Executable File

#!/bin/bash --verbose
set -e
SRC_DIR=$(dirname $(rustup which rustc))"/../lib/rustlib/src/rust/"
DST_DIR="target/libcore"
if [ ! -e $SRC_DIR ]; then
echo "Please install rust-src component"
exit 1
fi
rm -rf $DST_DIR
mkdir -p $DST_DIR/src
for crate in libcore libstd; do
cp -r $SRC_DIR/src/$crate $DST_DIR/src/
done
cd $DST_DIR
git init
git add .
git commit -m "Initial commit" -q
git apply ../../000*.patch
echo "Successfully prepared libcore for building"