From 8d779f3760e04a9575c40c182a7b192ae0b2ff9e Mon Sep 17 00:00:00 2001 From: "kuldeep.k@cisinlabs.com" Date: Mon, 15 Nov 2021 20:41:57 +0530 Subject: [PATCH] Added more instructions to INSTALL.md, rearranges the steps and added warning for ubuntu 20 & greater --- INSTALL.md | 167 +++++++++++++++++++++---------------------------- checkdeps.py | 5 ++ src/depends.py | 20 ++++++ 3 files changed, 98 insertions(+), 94 deletions(-) diff --git a/INSTALL.md b/INSTALL.md index 3117cfeb..f4aefbed 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -1,108 +1,87 @@ # PyBitmessage Installation Instructions +- Binary (no separate installation of dependencies required) + - windows (32bit only): https://download.bitmessage.org/snapshots/ + - linux (64bit): https://appimage.bitmessage.org/releases/ + - mac (64bit, not up to date): https://github.com/Bitmessage/PyBitmessage/releases/tag/v0.6.3 +- Source + git clone git://github.com/Bitmessage/PyBitmessage.git -For an up-to-date version of these instructions, please visit the -[Bitmessage Wiki](https://bitmessage.org/wiki/Compiling_instructions). +## Helper Script for building from source +Go to the directory with PyBitmessage source code and run: +``` +python checkdeps.py +``` +If there are missing dependencies, it will explain you what is missing and for many Unix-like systems also what you have to do to resolve it. You need to repeat calling the script until you get nothing mandatory missing. How you then run setuptools depends on whether you want to install it to user's directory or system. -PyBitmessage can be run in either one of two ways: - -- straight from source - - or -- from an installed -package. - -## Dependencies +### If checkdeps fails, then verify manually which dependencies are missing from below Before running PyBitmessage, make sure you have all the necessary dependencies installed on your system. -Here's a list of dependencies needed for PyBitmessage -- python2.7 -- python2-qt4 (python-qt4 on Debian/Ubuntu) -- openssl -- (Fedora & Redhat only) openssl-compat-bitcoin-libs +These dependencies may not be available on a recent OS and PyBitmessage may not build on such systems. +Here's a list of dependencies needed for PyBitmessage based on operating system -## Running PyBitmessage -PyBitmessage can be run in two ways: -- straight from source - - or -- via a package which is installed on your system. Since PyBitmessage is Beta, it is best to run -PyBitmessage from source, so that you may update as needed. - -#### Updating -To update PyBitmessage from source (Linux/OS X), you can do these easy steps: +For Debian-based (Ubuntu, Raspbian, PiBang, others) ``` -cd PyBitmessage/src/ -git fetch --all -git reset --hard origin/master -python bitmessagemain.py +python2.7 openssl libssl-dev git python-msgpack python-qt4 python-six +``` +For Arch Linux +``` +python2 openssl git python2-pyqt4 python-six +``` +For Fedora +``` +python python-qt4 git openssl-compat-bitcoin-libs python-six +``` +For Red Hat Enterprise Linux (RHEL) +``` +python python-qt4 git openssl-compat-bitcoin-libs python-six +``` +For GNU Guix +``` +python2-msgpack python2-pyqt@4.11.4 python2-sip openssl python-six ``` -VoilĂ ! Bitmessage is updated! -#### Linux -To run PyBitmessage from the command-line, you must download the source, then +## setuptools +This is now the recommended and in most cases the easiest procedure for installing PyBitmessage. + +There are 3 options for running setuptools: root, user, venv + +### as root: +``` +python setup.py install +pybitmessage +``` + +### as user: +``` +python setup.py install --user +~/.local/bin/pybitmessage +``` + +### as venv: +Create virtualenv with Python 2.x version +``` +virtualenv -p python2 env +``` + +Activate env +``` +source env/bin/activate +``` + +Install requirements.txt +``` +pip install -r requirements.txt +``` + +Build & run pybitmessage +``` +python setup.py install +pybitmessage +``` + +## Alternative way to run PyBitmessage, without setuptools (this isn't recommended) run `src/bitmessagemain.py`. ``` -git clone git://github.com/Bitmessage/PyBitmessage.git cd PyBitmessage/ && python src/bitmessagemain.py ``` - -That's it! *Honestly*! - -#### Windows -On Windows you can download an executable for Bitmessage -[here](https://github.com/Bitmessage/PyBitmessage/releases/download/0.6.3.2/Bitmessage_x86_0.6.3.2.exe). - -However, if you would like to run PyBitmessage via Python in Windows, you can -go [here](https://bitmessage.org/wiki/Compiling_instructions#Windows) for -information on how to do so. - -#### OS X -First off, install Homebrew. -``` -ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" -``` - -Now, install the required dependencies -``` -brew install git python openssl cartr/qt4/pyqt@4 -``` - -Download and run PyBitmessage: -``` -git clone git://github.com/Bitmessage/PyBitmessage.git -cd PyBitmessage && python src/bitmessagemain.py -``` - -## Creating a package for installation -If you really want, you can make a package for PyBitmessage, which you may -install yourself or distribute to friends. This isn't recommended, since -PyBitmessage is in Beta, and subject to frequent change. - -#### Linux -First off, since PyBitmessage uses something nifty called -[packagemonkey](https://github.com/fuzzgun/packagemonkey), go ahead and get -that installed. You may have to build it from source. - -Next, edit the generate.sh script to your liking. - -Now, run the appropriate script for the type of package you'd like to make -``` -arch.sh - create a package for Arch Linux -debian.sh - create a package for Debian/Ubuntu -ebuild.sh - create a package for Gentoo -osx.sh - create a package for OS X -puppy.sh - create a package for Puppy Linux -rpm.sh - create a RPM package -slack.sh - create a package for Slackware -``` - -#### OS X -Please refer to -[this page](https://bitmessage.org/forum/index.php/topic,2761.0.html) on the -forums for instructions on how to create a package on OS X. - -Please note that some versions of OS X don't work. - -#### Windows -## TODO: Create Windows package creation instructions diff --git a/checkdeps.py b/checkdeps.py index 66ce1a8f..0a28a6d2 100755 --- a/checkdeps.py +++ b/checkdeps.py @@ -47,6 +47,7 @@ EXTRAS_REQUIRE_DEPS = { "Debian": ["libcap-dev python-prctl"], "Ubuntu": ["libcap-dev python-prctl"], "Ubuntu 12": ["libcap-dev python-prctl"], + "Ubuntu 20": [""], "openSUSE": [""], "Fedora": ["prctl"], "Guix": [""], @@ -162,6 +163,10 @@ for lhs, rhs in EXTRAS_REQUIRE.items(): "Optional dependency `pip install .[{}]` would require `{}`" " to be run as root".format(lhs, rhs_cmd)) +if detectOS.result == "Ubuntu 20": + print( + "Qt interface isn't supported in %s" % detectOS.result) + if (not compiler or prereqs) and OPSYS in PACKAGE_MANAGER: print("You can install the missing dependencies by running, as root:") if not compiler: diff --git a/src/depends.py b/src/depends.py index 268137ec..212c3143 100755 --- a/src/depends.py +++ b/src/depends.py @@ -45,6 +45,7 @@ PACKAGE_MANAGER = { "Debian": "apt-get install", "Ubuntu": "apt-get install", "Ubuntu 12": "apt-get install", + "Ubuntu 20": "apt-get install", "openSUSE": "zypper install", "Fedora": "dnf install", "Guix": "guix package -i", @@ -58,6 +59,7 @@ PACKAGES = { "Debian": "python-qt4", "Ubuntu": "python-qt4", "Ubuntu 12": "python-qt4", + "Ubuntu 20": "", "openSUSE": "python-qt", "Fedora": "PyQt4", "Guix": "python2-pyqt@4.11.4", @@ -75,6 +77,7 @@ PACKAGES = { "Debian": "python-msgpack", "Ubuntu": "python-msgpack", "Ubuntu 12": "msgpack-python", + "Ubuntu 20": "", "openSUSE": "python-msgpack-python", "Fedora": "python2-msgpack", "Guix": "python2-msgpack", @@ -89,6 +92,7 @@ PACKAGES = { "Debian": "python-pyopencl", "Ubuntu": "python-pyopencl", "Ubuntu 12": "python-pyopencl", + "Ubuntu 20": "", "Fedora": "python2-pyopencl", "openSUSE": "", "OpenBSD": "", @@ -106,11 +110,25 @@ PACKAGES = { "Debian": "python-setuptools", "Ubuntu": "python-setuptools", "Ubuntu 12": "python-setuptools", + "Ubuntu 20": "python-setuptools", "Fedora": "python2-setuptools", "openSUSE": "python-setuptools", "Guix": "python2-setuptools", "Gentoo": "dev-python/setuptools", "optional": False, + }, + "six": { + "OpenBSD": "py-six", + "FreeBSD": "py27-six", + "Debian": "python-six", + "Ubuntu": "python-six", + "Ubuntu 12": "python-six", + "Ubuntu 20": "python-six", + "Fedora": "python-six", + "openSUSE": "python-six", + "Guix": "python-six", + "Gentoo": "dev-python/six", + "optional": False, } } @@ -150,6 +168,8 @@ def detectOSRelease(): pass if detectOS.result == "Ubuntu" and version < 14: detectOS.result = "Ubuntu 12" + elif detectOS.result == "Ubuntu" and version >= 20: + detectOS.result = "Ubuntu 20" def try_import(module, log_extra=False):