Skip to content

Commit

Permalink
joinmarket update to v0.9.11 (#145)
Browse files Browse the repository at this point in the history
* joinmarket update to v0.9.11
* remove deprecated install tweak
* remove pyhton 3.7 support
* stop using system-side PySide2
* don't install the QT Gui on ARM
* format start.joininbox.sh
* remove arm specific qtgui deps, no qtgui on build for arm
* don't protect system packages from pip install
* add libltdl-dev to apt-get packages
  • Loading branch information
openoms authored Feb 26, 2024
1 parent a61da71 commit ea5187c
Show file tree
Hide file tree
Showing 4 changed files with 99 additions and 156 deletions.
98 changes: 37 additions & 61 deletions build_joininbox.sh
Original file line number Diff line number Diff line change
Expand Up @@ -266,69 +266,38 @@ echo "##########"
echo
# apt dependencies for python
apt-get install -y python3 virtualenv python3-venv python3-dev python3-wheel python3-jinja2 python3-pip
if [ "${cpu}" = "armv7l" ] || [ "${cpu}" = "armv6l" ]; then
if [ ! -f "/usr/bin/python3.7" ]; then
# install python37
pythonVersion="3.7.9"
majorPythonVersion=$(echo "$pythonVersion" | awk -F. '{print $1"."$2}')
# dependencies
apt-get install software-properties-common build-essential libnss3-dev zlib1g-dev libgdbm-dev libncurses5-dev libssl-dev libffi-dev libreadline-dev libsqlite3-dev libbz2-dev -y
# download
wget --prefer-family=ipv4 --progress=bar:force https://www.python.org/ftp/python/${pythonVersion}/Python-${pythonVersion}.tgz
# optional signature for verification
wget --prefer-family=ipv4 --progress=bar:force https://www.python.org/ftp/python/${pythonVersion}/Python-${pythonVersion}.tgz.asc
# get PGP pubkey of Ned Deily (Python release signing key) <nad@python.org>
gpg --recv-key 0D96DF4D4110E5C43FBFB17F2D347EA6AA65421D
# check for: Good signature from "Pablo Galindo Salgado <pablogsal@gmail.com>"
gpg --verify Python-${pythonVersion}.tgz.asc || exit 1
# unzip
tar xvf Python-${pythonVersion}.tgz
cd Python-${pythonVersion} || exit 1
# configure
./configure --enable-optimizations
# install
make altinstall
# move the python binary to the expected directory
mv "$(which python${majorPythonVersion})" /usr/bin/
# check
ls -la /usr/bin/python${majorPythonVersion} || exit 1
# clean
cd ..
rm Python-${pythonVersion}.tgz
rm -rf Python-${pythonVersion}
fi
update-alternatives --install /usr/bin/python python /usr/bin/python3.7 1
echo "# python calls python3.7"

if [ -f "/usr/bin/python3.8" ]; then
# use python 3.8 if available
update-alternatives --install /usr/bin/python python /usr/bin/python3.8 1
echo "# python calls python3.8"
elif [ -f "/usr/bin/python3.9" ]; then
# use python 3.9 if available
update-alternatives --install /usr/bin/python python /usr/bin/python3.9 1
echo "# python calls python3.9"
elif [ -f "/usr/bin/python3.10" ]; then
# use python 3.10 if available
update-alternatives --install /usr/bin/python python /usr/bin/python3.10 1
echo "# python calls python3.10"
elif [ -f "/usr/bin/python3.11" ]; then
# use python 3.11 if available
update-alternatives --install /usr/bin/python python /usr/bin/python3.11 1
echo "# python calls python3.11"
else
if [ -f "/usr/bin/python3.7" ]; then
# make sure /usr/bin/python exists (and calls Python3.7)
update-alternatives --install /usr/bin/python python /usr/bin/python3.7 1
echo "# python calls python3.7"
elif [ -f "/usr/bin/python3.8" ]; then
# use python 3.8 if available
update-alternatives --install /usr/bin/python python /usr/bin/python3.8 1
echo "# python calls python3.8"
elif [ -f "/usr/bin/python3.9" ]; then
# use python 3.9 if available
update-alternatives --install /usr/bin/python python /usr/bin/python3.9 1
echo "# python calls python3.9"
elif [ -f "/usr/bin/python3.10" ]; then
# use python 3.10 if available
update-alternatives --install /usr/bin/python python /usr/bin/python3.10 1
echo "# python calls python3.10"
elif [ -f "/usr/bin/python3.11" ]; then
# use python 3.11 if available
update-alternatives --install /usr/bin/python python /usr/bin/python3.11 1
echo "# python calls python3.11"
else
echo "# FAIL- there is no tested version of python present"
exit 1
fi
echo "# FAIL- there is no tested version of python present"
exit 1
fi

# make sure /usr/bin/pip exists (and calls pip3)
update-alternatives --install /usr/bin/pip pip /usr/bin/pip3 1

# don't protect system packages from pip install
# tracking issue: https://github.com/raspiblitz/raspiblitz/issues/4170
for PYTHONDIR in /usr/lib/python3.*; do
if [ -f "$PYTHONDIR/EXTERNALLY-MANAGED" ]; then
rm "$PYTHONDIR/EXTERNALLY-MANAGED"
fi
done

# setuptools needed for Nyx
pip install setuptools

Expand Down Expand Up @@ -359,6 +328,8 @@ apt-get install -y dialog
apt-get install -y qrencode
# unzip for the pruned node snapshot
apt-get install -y unzip
# JoinMarket dependency https://github.com/JoinMarket-Org/joinmarket-clientserver/blob/5bfa08c6f558458c9a93e8095ce9dc1b62412838/install.sh#L76C10-L76C21
apt-get install -y libltdl-dev
apt-get clean
apt-get -y autoremove

Expand Down Expand Up @@ -593,7 +564,6 @@ echo "#############"
echo "
if [ -f \"/home/joinmarket/joinmarket-clientserver/jmvenv/bin/activate\" ]; then
. /home/joinmarket/joinmarket-clientserver/jmvenv/bin/activate
/home/joinmarket/joinmarket-clientserver/jmvenv/bin/python -c \"import PySide2\"
cd /home/joinmarket/joinmarket-clientserver/scripts/
fi
# shortcut commands
Expand All @@ -616,10 +586,16 @@ echo "######################"
echo "# Install JoinMarket"
echo "######################"

qtgui=true

if [ "${cpu}" = x86_64 ]; then
qtgui=true
else
# no qtgui on arm
qtgui=false
fi
checkEntry=$(runuser joinmarket -c "cat /home/joinmarket/joinin.conf | grep -c qtgui")
if [ ${checkEntry} -eq 0 ]; then
echo "qtgui=true" | tee -a /home/joinmarket/joinin.conf
echo "qtgui=$qtgui" | tee -a /home/joinmarket/joinin.conf
fi
if [ "$4" = "without-qt" ]; then
qtgui="false"
Expand Down
1 change: 0 additions & 1 deletion scripts/_functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ fi

function activateJMvenv() {
. /home/joinmarket/joinmarket-clientserver/jmvenv/bin/activate || exit 1
/home/joinmarket/joinmarket-clientserver/jmvenv/bin/python -c "import PySide2"
}

function openMenuIfCancelled() {
Expand Down
37 changes: 3 additions & 34 deletions scripts/install.joinmarket.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/bin/bash

testedJMversion="v0.9.10"
# https://github.com/JoinMarket-Org/joinmarket-clientserver/releases
testedJMversion="v0.9.11"

PGPsigner="kristapsk"
PGPpkeys="https://github.com/kristapsk.gpg"
Expand Down Expand Up @@ -140,7 +141,6 @@ if [ "${user}" != "joinmarket" ]; then
echo "
if [ -f \"/home/${user}/joinmarket-clientserver/jmvenv/bin/activate\" ]; then
. /home/${user}/joinmarket-clientserver/jmvenv/bin/activate
/home/${user}/joinmarket-clientserver/jmvenv/bin/python -c \"import PySide2\"
cd /home/${user}/joinmarket-clientserver/scripts/
fi
" | sudo -u ${user} tee -a /home/${user}/.bashrc
Expand All @@ -158,14 +158,7 @@ fi

# installJoinMarket [update|testPR <PRnumber>|commit]
function installJoinMarket() {
cpu=$(uname -m)
cd /home/${user} || exit 1
if [ "${qtgui}" = "true" ]; then
# PySide2 for armf: https://packages.debian.org/buster/python3-pyside2.qtcore
echo "# Installing ARM specific dependencies to run the QT GUI"
sudo apt-get install -y python3-pyside2.qtcore python3-pyside2.qtgui \
python3-pyside2.qtwidgets zlib1g-dev libjpeg-dev python3-pyqt5 libltdl-dev
fi
# https://github.com/JoinMarket-Org/joinmarket-clientserver/issues/668#issuecomment-717815719
sudo apt-get install -y build-essential automake pkg-config libffi-dev python3-dev
sudo -u ${user} pip install libtool asn1crypto cffi pycparser
Expand Down Expand Up @@ -202,7 +195,7 @@ function installJoinMarket() {
echo "# WARNING --> the PGP fingerprint is not as expected for ${PGPsigner}"
echo "# Should contain PGP: ${PGPcheck}"
echo "# PRESS ENTER to TAKE THE RISK if you think all is OK"
read key
read -r
fi
sudo -u ${user} gpg --import ./pgp_keys.asc

Expand Down Expand Up @@ -232,30 +225,6 @@ function installJoinMarket() {
fi
# do not clear screen during installation
sudo -u ${user} sed -i 's/clear//g' install.sh
# do not stop at installing Debian dependencies
sudo -u ${user} sed -i \
"s#^ if ! sudo apt-get install \${deb_deps\[@\]}; then#\
if ! sudo apt-get install -y \${deb_deps\[@\]}; then#g" install.sh

if [ ${cpu} != "x86_64" ]; then
echo "# Make install.sh set up jmvenv with -- system-site-packages on arm"
# and import the PySide2 armf package from the system
sudo -u ${user} sed -i "s#^ virtualenv -p \"\${python}\" \"\${jm_source}/jmvenv\" || return 1#\
virtualenv --system-site-packages -p \"\${python}\" \"\${jm_source}/jmvenv\" || return 1 ;\
/home/${user}/joinmarket-clientserver/jmvenv/bin/python -c \'import PySide2\'\
#g" install.sh
# don't install PySide2 - using the system-site-package instead
sudo -u ${user} sed -i "s#^PySide2.*##g" requirements/gui.txt
# don't install PyQt5 - using the system package instead
sudo -u ${user} sed -i "s#^PyQt5.*##g" requirements/gui.txt
sudo -u ${user} sed -i "s#PyQt5!=5.15.0,!=5.15.1,!=5.15.2,!=6.0##g" jmqtui/setup.py
fi

# pin werkzeug dependency to 2.2.0 as in:
# https://github.com/JoinMarket-Org/joinmarket-clientserver/pull/1485/files
if ! grep 'werkzeug==' jmclient/setup.py; then
sed -i "s/autobahn==20.12.3/&', 'werkzeug==2.2.0/g" jmclient/setup.py
fi

if [ "${qtgui}" = "false" ]; then
GUIchoice="--without-qt"
Expand Down
Loading

0 comments on commit ea5187c

Please sign in to comment.