2018-08-26 00:44:08 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -e # fail on any error
|
|
|
|
set -u # treat unset variables as error
|
2018-10-02 01:03:58 +02:00
|
|
|
|
2018-08-26 00:44:08 +02:00
|
|
|
echo "__________Show ENVIROMENT__________"
|
2018-10-02 01:03:58 +02:00
|
|
|
echo "CI_SERVER_NAME: " $CI_SERVER_NAME
|
|
|
|
echo "CARGO_HOME: " $CARGO_HOME
|
|
|
|
echo "CARGO_TARGET: " $CARGO_TARGET
|
|
|
|
echo "CC: " $CC
|
|
|
|
echo "CXX: " $CXX
|
2019-01-18 12:03:18 +01:00
|
|
|
#strip ON
|
|
|
|
export RUSTFLAGS=" -C link-arg=-s"
|
2019-02-25 12:56:38 +01:00
|
|
|
# Linker for crosscomile
|
|
|
|
echo "_____ Linker _____"
|
|
|
|
cat .cargo/config
|
2018-08-26 00:44:08 +02:00
|
|
|
|
2019-01-15 17:27:43 +01:00
|
|
|
echo "_____ Building target: "$CARGO_TARGET" _____"
|
2018-11-06 20:26:05 +01:00
|
|
|
if [ "${CARGO_TARGET}" = "armv7-linux-androideabi" ]
|
|
|
|
then
|
2019-01-15 17:27:43 +01:00
|
|
|
time cargo build --target $CARGO_TARGET --release -p parity-clib --features final
|
2018-11-06 20:26:05 +01:00
|
|
|
else
|
2019-01-15 17:27:43 +01:00
|
|
|
time cargo build --target $CARGO_TARGET --release --features final
|
|
|
|
time cargo build --target $CARGO_TARGET --release -p evmbin
|
|
|
|
time cargo build --target $CARGO_TARGET --release -p ethstore-cli
|
|
|
|
time cargo build --target $CARGO_TARGET --release -p ethkey-cli
|
|
|
|
time cargo build --target $CARGO_TARGET --release -p whisper-cli
|
2018-11-06 20:26:05 +01:00
|
|
|
fi
|
|
|
|
|
2018-08-26 00:44:08 +02:00
|
|
|
echo "_____ Post-processing binaries _____"
|
2019-02-21 19:14:59 +01:00
|
|
|
rm -rf artifacts/*
|
2019-02-07 18:49:50 +01:00
|
|
|
mkdir -p artifacts/$CARGO_TARGET
|
|
|
|
cd artifacts/$CARGO_TARGET
|
|
|
|
|
2019-01-15 17:27:43 +01:00
|
|
|
if [ "${CARGO_TARGET}" = "armv7-linux-androideabi" ]
|
|
|
|
then
|
|
|
|
cp -v ../../target/$CARGO_TARGET/release/libparity.so ./libparity.so
|
|
|
|
else
|
|
|
|
cp -v ../../target/$CARGO_TARGET/release/parity ./parity
|
|
|
|
cp -v ../../target/$CARGO_TARGET/release/parity-evm ./parity-evm
|
|
|
|
cp -v ../../target/$CARGO_TARGET/release/ethstore ./ethstore
|
|
|
|
cp -v ../../target/$CARGO_TARGET/release/ethkey ./ethkey
|
|
|
|
cp -v ../../target/$CARGO_TARGET/release/whisper ./whisper
|
|
|
|
fi
|
2018-11-06 20:26:05 +01:00
|
|
|
|
2018-08-26 00:44:08 +02:00
|
|
|
echo "_____ Calculating checksums _____"
|
|
|
|
for binary in $(ls)
|
|
|
|
do
|
2019-02-25 12:56:38 +01:00
|
|
|
rhash --sha256 $binary -o $binary.sha256 #do we still need this hash (SHA2)?
|
2019-03-22 11:46:57 +01:00
|
|
|
if [[ $CARGO_TARGET == *"x86_64"* ]];
|
|
|
|
then
|
|
|
|
./parity tools hash $binary > $binary.sha3
|
|
|
|
else
|
|
|
|
echo "> ${binary} cannot be hashed with cross-compiled binary (keccak256)"
|
|
|
|
fi
|
2018-08-26 00:44:08 +02:00
|
|
|
done
|