@ -2,13 +2,13 @@
cd " $( dirname " $0 " ) " || exit
cd " $( dirname " $0 " ) " || exit
check_exists( ) {
check_exists( )
{
command -v " $1 " > /dev/null
command -v " $1 " > /dev/null
}
}
num_cores( ) {
# This may be overriden by --python/-p option.
python -c 'import multiprocessing as mp; print(mp.cpu_count())'
python = "python3"
}
# This is needed for systems where GNU is not the default make, like FreeBSD.
# This is needed for systems where GNU is not the default make, like FreeBSD.
if check_exists gmake; then
if check_exists gmake; then
@ -17,6 +17,11 @@ else
make = "make"
make = "make"
fi
fi
num_cores( )
{
${ python } -c 'import multiprocessing as mp; print(mp.cpu_count())'
}
sha256_verify ( )
sha256_verify ( )
{
{
if [ [ " $( uname) " = = "Darwin" ] ] ; then
if [ [ " $( uname) " = = "Darwin" ] ] ; then
@ -574,7 +579,6 @@ install_get_os ()
main ( )
main ( )
{
{
# flags
# flags
python = 'python3'
build_local_tor = ''
build_local_tor = ''
no_gpg_validation = ''
no_gpg_validation = ''
use_os_deps_check = '1'
use_os_deps_check = '1'
@ -590,13 +594,12 @@ main ()
jm_source = " $PWD "
jm_source = " $PWD "
if [ " $with_jmvenv " = = 1 ] ; then
if [ " $with_jmvenv " = = 1 ] ; then
jm_root = " ${ jm_source } /jmvenv "
jm_root = " ${ jm_source } /jmvenv "
else
jm_root = ""
fi
export PKG_CONFIG_PATH = " ${ jm_root } /lib/pkgconfig: ${ PKG_CONFIG_PATH } "
export PKG_CONFIG_PATH = " ${ jm_root } /lib/pkgconfig: ${ PKG_CONFIG_PATH } "
export LD_LIBRARY_PATH = " ${ jm_root } /lib: ${ LD_LIBRARY_PATH } "
export LD_LIBRARY_PATH = " ${ jm_root } /lib: ${ LD_LIBRARY_PATH } "
export C_INCLUDE_PATH = " ${ jm_root } /include: ${ C_INCLUDE_PATH } "
export C_INCLUDE_PATH = " ${ jm_root } /include: ${ C_INCLUDE_PATH } "
MAKEFLAGS = " -j $( num_cores) " && export MAKEFLAGS
else
jm_root = ""
fi
# os check
# os check
install_os = " $( install_get_os ) "
install_os = " $( install_get_os ) "
@ -605,6 +608,9 @@ main ()
echo "Dependecies could not be installed. Exiting."
echo "Dependecies could not be installed. Exiting."
return 1
return 1
fi
fi
MAKEFLAGS = " -j $( num_cores) " && export MAKEFLAGS
if [ " $with_jmvenv " = = 1 ] ; then
if [ " $with_jmvenv " = = 1 ] ; then
if ! venv_setup; then
if ! venv_setup; then
echo "Joinmarket Python virtual environment could not be setup. Exiting."
echo "Joinmarket Python virtual environment could not be setup. Exiting."