Fixes to integrate with new bitcoin core dependency management & cache

This commit is contained in:
gdm85 2014-12-31 11:20:00 +01:00
parent 5407f858d4
commit a660cb4367
4 changed files with 53 additions and 31 deletions

View File

@ -7,6 +7,8 @@ FROM gdm85/gitian-host-vms
MAINTAINER Giuseppe Mazzotta "gdm85@users.noreply.github.com"
RUN aptitude install make -y
COPY input-sources/ /home/debian/input-sources/
COPY bin/build-bitcoin.sh /home/debian/
COPY bin/sign.sh /home/debian/

View File

@ -1,7 +1,7 @@
#!/bin/bash
## automatic Gitian build of bitcoin
## @author gdm85
## @version 0.3.0
## @version 0.3.1
## see also https://github.com/gdm85/tenku/blob/master/docker/gitian-bitcoin-host/
##
#
@ -13,14 +13,26 @@ fi
VERSION="$1"
if [ ! -d bitcoin ]; then
git clone https://github.com/bitcoin/bitcoin.git || exit $?
fi
cd bitcoin && \
git checkout v${VERSION} && \
cd ../gitian-builder && \
mkdir -p inputs && cd inputs/ || exit $?
CLONE="$HOME/bitcoin"
function verlte() {
[ "$1" = "`echo -e "$1\n$2" | sort -V | head -n1`" ]
}
cd gitian-builder && \
mkdir -p inputs && \
cd .. || exit $?
if [ ! -d bitcoin ]; then
git clone https://github.com/bitcoin/bitcoin.git && \
cd bitcoin && \
git checkout v$VERSION && \
cd .. || exit $?
fi
## old logic using descriptors
if ! verlte 0.10.0rc1 ${VERSION}; then
cd gitian-builder/inputs || exit $?
## get each dependency
## they are validated afterwards by gbuild
while read -r URL FNAME; do
@ -35,11 +47,20 @@ done < ../../input-sources/${VERSION}-inputs.txt | parallel -j10 || exit $?
## verify that all sources are correct before continuing
md5sum -c < ../../input-sources/${VERSION}-inputs.md5 && \
cd .. && \
for DESC in $(<../input-sources/${VERSION}-descriptors.txt); do
DESCRIPTORS="$(<../input-sources/${VERSION}-descriptors.txt)" && \
cd .. || exit $?
for DESC in $DESCRIPTORS; do
./bin/gbuild ../bitcoin/contrib/gitian-descriptors/${DESC}.yml && \
mv -v $(find build/out -type f -name '*gz' -o -name '*.zip') inputs/ || exit $?
done && \
./bin/gbuild --commit bitcoin=v${VERSION} ../bitcoin/contrib/gitian-descriptors/gitian-linux.yml && \
echo "Completed successfully." && \
echo "The output files are in: gitian-builder/build/out/"
done
else
cd bitcoin/depends && \
make download-linux SOURCES_PATH="$HOME/gitian-builder/cache/common" && \
cd ../.. || exit $?
fi
## proceed to build
cd gitian-builder && \
./bin/gbuild -u bitcoin=$CLONE $CLONE/contrib/gitian-descriptors/gitian-linux.yml && \
echo "Build completed successfully, output files are in: ~/gitian-builder/build/out/"

View File

@ -1,5 +1,4 @@
-#!/bin/bash
set -e
#!/bin/bash
if [[ ! $# -eq 2 ]]; then
echo "Please specify version and signer id" 1>&2
@ -9,5 +8,5 @@ fi
VERSION="$1"
SIGNER="$2"
cd gitian-builder
cd gitian-builder && \
./bin/gsign --signer $SIGNER --release ${VERSION} --destination ../gitian.sigs/ ../bitcoin/contrib/gitian-descriptors/gitian-linux.yml

View File

@ -56,7 +56,7 @@ COPY bash_profile /home/debian/.bash_profile
## script used to build base VMs
COPY bin/build-base-vms.sh /home/debian/
RUN git clone https://github.com/devrandom/gitian-builder.git && cd gitian-builder && git checkout ffd04a46a2b3c1277937c939cdb151fcf0eac613
RUN git clone https://github.com/devrandom/gitian-builder.git && cd gitian-builder && git checkout 2bcc06e6b75b3f7a0167cde7237331757dd559c6
COPY gitian.patch /home/debian/