Go back to working version

This commit is contained in:
Demi M. Obenour 2019-01-04 09:14:09 -05:00
parent 8518a6262e
commit 2994827edf
1 changed files with 11 additions and 42 deletions

View File

@ -1,43 +1,12 @@
#!/bin/bash --
case $0 in
(/*) dir=${0%/*}/;;
(*/*) dir=./${0%/*};;
(*) dir=.;;
esac
cd "$dir"
unset dir CARGO_INCREMENTAL LD_LIBRARY_PATH LD_RUN_PATH RUST_BACKTRACE
#!/bin/sh --
export RUSTFLAGS='-Clto -Cpanic=abort'
which apt-get >/dev/null 2>&1 &&
sudo apt-get -y install build-essential m4 curl gnupg2 xz cargo gnupg gpg gpgv2
which dnf > /dev/null 2>&1 && sudo dnf -y install gcc gpg xz cargo
tmpdir=$(mktemp -d /var/tmp/vdf.XXXXXX)
trap 'rm -rf -- "$tmpdir"' EXIT
recv_gpg_keys () {
gpg2 --keyserver=keys.gnupg.net \
--homedir=. \
--recv-keys 343c2ff0fbee5ec2edbef399f3599ff828c67298
}
until recv_gpg_keys; do :; done
fetch_file () {
test -f "$1" ||
until curl --location -O --proto '=https' "https://gmplib.org/download/gmp/$1"; do :; done
}
for i in '' .sig; do fetch_file "gmp-6.1.2.tar.xz$i"; done
gpgv2 --keyring=./pubring.kbx gmp-6.1.2.tar.xz.sig gmp-6.1.2.tar.xz || exit $?
mkdir build 2>/dev/null || { rm -rf build && mkdir build; }
tar xJvf gmp-6.1.2.tar.xz
cd build
libdir=/usr/lib
test -d /usr/lib64 && libdir=/usr/lib64
../gmp-6.1.2/configure --prefix=/usr "--libdir=$libdir" 'CFLAGS=-O3 -march=native'
make -j2 && make check
sudo make install
sudo ldconfig
cargo install --force --path=vdf-competition
export DEBIAN_FRONTEND=noninteractive
exec 2>/dev/null
sudo apt-get -y -q update
sudo apt-get install git build-essential libgmp3-dev -y -q
curl https://sh.rustup.rs -sSf | sh -s -- -y
export PATH="$HOME/.cargo/bin:$PATH"
rustup install nightly
rustup default nightly
cargo install --force --path=vdf-competition || :
exit 0