Skipped building if the patch's sha matches the previously written patch's sha.
This commit is contained in:
parent
7de5ac32de
commit
b798ea918d
@ -6,6 +6,7 @@ depends_dir=$($root_dir/platform/os.sh depends_dir)
|
|||||||
os_dir=$(${root_dir}/platform/os.sh osdir)
|
os_dir=$(${root_dir}/platform/os.sh osdir)
|
||||||
host=$(${root_dir}/platform/os.sh host)
|
host=$(${root_dir}/platform/os.sh host)
|
||||||
btc_dir="${root_dir}/libbitcoind"
|
btc_dir="${root_dir}/libbitcoind"
|
||||||
|
ext=$($root_dir/platform/os.sh ext)
|
||||||
echo "Using BTC directory: ${btc_dir}"
|
echo "Using BTC directory: ${btc_dir}"
|
||||||
|
|
||||||
cd "${root_dir}"
|
cd "${root_dir}"
|
||||||
@ -61,6 +62,18 @@ if [ "${BITCOINDJS_ENV}" == "test" ]; then
|
|||||||
options=`cat ${root_dir}/bin/config_options_test.sh`
|
options=`cat ${root_dir}/bin/config_options_test.sh`
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
patch_file_sha=$(shasum -a 256 "${root_dir}/etc/bitcoin.patch" | awk '{print $1}')
|
||||||
|
if [ "${ext}" == "dylib" ]; then
|
||||||
|
last_patch_file_sha=$(cat "${os_dir}"/lib/patch_sha.txt)
|
||||||
|
else
|
||||||
|
last_patch_file_sha=$(cat "${os_dir}"/patch_sha.txt)
|
||||||
|
fi
|
||||||
|
shared_file_built=false
|
||||||
|
if [ "${last_patch_file_sha}" == "${patch_file_sha}" ]; then
|
||||||
|
shared_file_built=true
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "${shared_file_built}" = false ]; then
|
||||||
only_make=false
|
only_make=false
|
||||||
if [ -d "${btc_dir}" ]; then
|
if [ -d "${btc_dir}" ]; then
|
||||||
echo "running compare patch..."
|
echo "running compare patch..."
|
||||||
@ -94,7 +107,7 @@ fi
|
|||||||
set -e
|
set -e
|
||||||
|
|
||||||
if [ "${only_make}" = false ]; then
|
if [ "${only_make}" = false ]; then
|
||||||
echo "Removing cloning, patching, and building libbitcoind..."
|
echo "Cloning, patching, and building libbitcoind..."
|
||||||
get_patch_file
|
get_patch_file
|
||||||
echo "attempting to checkout tag: ${tag} of bitcoin from github..."
|
echo "attempting to checkout tag: ${tag} of bitcoin from github..."
|
||||||
cd "${root_dir}"
|
cd "${root_dir}"
|
||||||
@ -125,7 +138,6 @@ ${full_options}
|
|||||||
echo 'make V=1'
|
echo 'make V=1'
|
||||||
make V=1
|
make V=1
|
||||||
|
|
||||||
ext=$($root_dir/platform/os.sh ext)
|
|
||||||
echo 'Copying libbitcoind.{so|dylib} to its appropriate location.'
|
echo 'Copying libbitcoind.{so|dylib} to its appropriate location.'
|
||||||
if test -e "${btc_dir}/src/.libs/libbitcoind.${ext}"; then
|
if test -e "${btc_dir}/src/.libs/libbitcoind.${ext}"; then
|
||||||
if [ "$ext" = "dylib" ]; then
|
if [ "$ext" = "dylib" ]; then
|
||||||
@ -139,6 +151,11 @@ if test -e "${btc_dir}/src/.libs/libbitcoind.${ext}"; then
|
|||||||
fi
|
fi
|
||||||
cp -P "${btc_dir}"/src/.libs/libbitcoind.so* "${os_dir}/"
|
cp -P "${btc_dir}"/src/.libs/libbitcoind.so* "${os_dir}/"
|
||||||
fi
|
fi
|
||||||
|
echo "Creating the sha marker for the patching in libbitcoind..."
|
||||||
|
echo -n `shasum -a 256 "${root_dir}"/etc/bitcoin.patch | awk '{print $1}'` > "${os_dir}"/patch_sha.txt
|
||||||
|
fi
|
||||||
|
echo 'Build finished successfully.'
|
||||||
|
else
|
||||||
|
echo 'Using existing shared library.'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo 'Build finished successfully.'
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user