@ -82,6 +82,30 @@ deps_install ()
fi
fi
}
}
tor_deps_install ( )
{
debian_deps = ( \
'libevent-dev' \
'libssl-dev' \
'zlib1g-dev' )
darwin_deps = ( \
'libevent' \
'zlib' )
if [ [ ${ use_os_deps_check } != '1' ] ] ; then
return 0
elif [ [ ${ install_os } = = 'debian' ] ] ; then
deb_deps_install " ${ debian_deps [@] } "
return " $? "
elif [ [ ${ install_os } = = 'darwin' ] ] ; then
dar_deps_install " ${ darwin_deps [@] } "
return " $? "
else
return 0
fi
}
deb_deps_check ( )
deb_deps_check ( )
{
{
apt-cache policy ${ deb_deps [@] } | grep "Installed.*none"
apt-cache policy ${ deb_deps [@] } | grep "Installed.*none"
@ -115,17 +139,19 @@ dar_deps_install ()
return 1
return 1
fi
fi
sudo_command = ''
if ! which virtualenv >/dev/null; then
if [ " $with_sudo " = = 1 ] ; then
sudo_command = ''
echo "
if [ " $with_sudo " = = 1 ] ; then
sudo password required to run :
echo "
sudo password required to run :
\` sudo pip3 install virtualenv\`
\` sudo pip3 install virtualenv\`
"
"
sudo_command = "sudo"
sudo_command = "sudo"
fi
fi
if $with_jmvenv && ! $sudo_command pip3 install virtualenv; then
if $with_jmvenv && ! $sudo_command pip3 install virtualenv; then
return 1
return 1
fi
fi
fi
}
}
@ -325,6 +351,49 @@ libsodium_install ()
popd
popd
}
}
tor_build ( )
{
$make uninstall
$make distclean
./configure \
--disable-system-torrc \
--disable-seccomp \
--disable-libscrypt \
--disable-module-relay \
--disable-lzma \
--disable-zstd \
--disable-asciidoc \
--disable-manpage \
--disable-html-manual \
--prefix= " ${ jm_root } "
$make
if ! $make check; then
return 1
fi
}
tor_install ( )
{
tor_version = 'tor-0.4.6.8'
tor_tar = " ${ tor_version } .tar.gz "
tor_sha = '15ce1a37b4cc175b07761e00acdcfa2c08f0d23d6c3ab9c97c464bd38cc5476a'
tor_url = 'https://dist.torproject.org'
if ! dep_get " ${ tor_tar } " " ${ tor_sha } " " ${ tor_url } " ; then
return 1
fi
pushd " ${ tor_version } "
if tor_build; then
$make install
# Create blank tor config, it will default to running socks5 proxy
# at 127.0.0.1:9050 and should be enough for us.
> " ${ jm_root } /etc/tor/torrc "
else
return 1
fi
popd
}
joinmarket_install ( )
joinmarket_install ( )
{
{
reqs = ( 'base.txt' )
reqs = ( 'base.txt' )
@ -379,6 +448,9 @@ parse_flags ()
echo 'ERROR: "--python" requires a non-empty option argument.'
echo 'ERROR: "--python" requires a non-empty option argument.'
return 1
return 1
; ;
; ;
--with-local-tor)
build_local_tor = '1'
; ;
--with-qt)
--with-qt)
with_qt = '1'
with_qt = '1'
; ;
; ;
@ -406,6 +478,7 @@ Options:
--disable-secp-check do not run libsecp256k1 tests ( default is to run them)
--disable-secp-check do not run libsecp256k1 tests ( default is to run them)
--docker-install system wide install as root for minimal Docker installs
--docker-install system wide install as root for minimal Docker installs
--python, -p python version ( only python3 versions are supported)
--python, -p python version ( only python3 versions are supported)
--with-local-tor build Tor locally and autostart when needed
--with-qt build the Qt GUI
--with-qt build the Qt GUI
--without-qt don' t build the Qt GUI
--without-qt don' t build the Qt GUI
"
"
@ -462,6 +535,7 @@ main ()
# flags
# flags
develop_build = ''
develop_build = ''
python = 'python3'
python = 'python3'
build_local_tor = ''
use_os_deps_check = '1'
use_os_deps_check = '1'
use_secp_check = '1'
use_secp_check = '1'
with_qt = ''
with_qt = ''
@ -498,6 +572,12 @@ main ()
fi
fi
source " ${ jm_root } /bin/activate "
source " ${ jm_root } /bin/activate "
fi
fi
if [ [ ${ build_local_tor } = = "1" ] ] ; then
if ! tor_deps_install; then
echo "Tor dependencies could not be installed. Exiting."
return 1
fi
fi
mkdir -p "deps/cache"
mkdir -p "deps/cache"
pushd deps
pushd deps
if ! libsecp256k1_install; then
if ! libsecp256k1_install; then
@ -512,6 +592,12 @@ main ()
echo "Libsodium was not built. Exiting."
echo "Libsodium was not built. Exiting."
return 1
return 1
fi
fi
if [ [ ${ build_local_tor } = = "1" ] ] ; then
if ! tor_install; then
echo "Building local Tor was requested, but not built. Exiting."
return 1
fi
fi
popd
popd
if ! joinmarket_install; then
if ! joinmarket_install; then
echo "Joinmarket was not installed. Exiting."
echo "Joinmarket was not installed. Exiting."