Skip to content

Commit 8d779f3

Browse files
committed
Added more instructions to INSTALL.md, rearranges the steps and added warning for ubuntu 20 & greater
1 parent 971c79b commit 8d779f3

File tree

3 files changed

+85
-81
lines changed

3 files changed

+85
-81
lines changed

INSTALL.md

Lines changed: 60 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -1,108 +1,87 @@
11
# PyBitmessage Installation Instructions
2+
- Binary (no separate installation of dependencies required)
3+
- windows (32bit only): https://download.bitmessage.org/snapshots/
4+
- linux (64bit): https://appimage.bitmessage.org/releases/
5+
- mac (64bit, not up to date): https://github.com/Bitmessage/PyBitmessage/releases/tag/v0.6.3
6+
- Source
7+
git clone git://github.com/Bitmessage/PyBitmessage.git
8+
9+
## Helper Script for building from source
10+
Go to the directory with PyBitmessage source code and run:
11+
```
12+
python checkdeps.py
13+
```
14+
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.
215

3-
For an up-to-date version of these instructions, please visit the
4-
[Bitmessage Wiki](https://bitmessage.org/wiki/Compiling_instructions).
5-
6-
PyBitmessage can be run in either one of two ways:
7-
8-
- straight from source
9-
10-
or
11-
- from an installed
12-
package.
13-
14-
## Dependencies
16+
### If checkdeps fails, then verify manually which dependencies are missing from below
1517
Before running PyBitmessage, make sure you have all the necessary dependencies
1618
installed on your system.
1719

18-
Here's a list of dependencies needed for PyBitmessage
19-
- python2.7
20-
- python2-qt4 (python-qt4 on Debian/Ubuntu)
21-
- openssl
22-
- (Fedora & Redhat only) openssl-compat-bitcoin-libs
23-
24-
## Running PyBitmessage
25-
PyBitmessage can be run in two ways:
26-
- straight from source
27-
28-
or
29-
- via a package which is installed on your system. Since PyBitmessage is Beta, it is best to run
30-
PyBitmessage from source, so that you may update as needed.
20+
These dependencies may not be available on a recent OS and PyBitmessage may not build on such systems.
21+
Here's a list of dependencies needed for PyBitmessage based on operating system
3122

32-
#### Updating
33-
To update PyBitmessage from source (Linux/OS X), you can do these easy steps:
23+
For Debian-based (Ubuntu, Raspbian, PiBang, others)
3424
```
35-
cd PyBitmessage/src/
36-
git fetch --all
37-
git reset --hard origin/master
38-
python bitmessagemain.py
25+
python2.7 openssl libssl-dev git python-msgpack python-qt4 python-six
3926
```
40-
Voilà! Bitmessage is updated!
41-
42-
#### Linux
43-
To run PyBitmessage from the command-line, you must download the source, then
44-
run `src/bitmessagemain.py`.
27+
For Arch Linux
4528
```
46-
git clone git://github.com/Bitmessage/PyBitmessage.git
47-
cd PyBitmessage/ && python src/bitmessagemain.py
29+
python2 openssl git python2-pyqt4 python-six
30+
```
31+
For Fedora
32+
```
33+
python python-qt4 git openssl-compat-bitcoin-libs python-six
34+
```
35+
For Red Hat Enterprise Linux (RHEL)
36+
```
37+
python python-qt4 git openssl-compat-bitcoin-libs python-six
38+
```
39+
For GNU Guix
40+
```
41+
python2-msgpack [email protected] python2-sip openssl python-six
4842
```
4943

50-
That's it! *Honestly*!
51-
52-
#### Windows
53-
On Windows you can download an executable for Bitmessage
54-
[here](https://github.com/Bitmessage/PyBitmessage/releases/download/0.6.3.2/Bitmessage_x86_0.6.3.2.exe).
44+
## setuptools
45+
This is now the recommended and in most cases the easiest procedure for installing PyBitmessage.
5546

56-
However, if you would like to run PyBitmessage via Python in Windows, you can
57-
go [here](https://bitmessage.org/wiki/Compiling_instructions#Windows) for
58-
information on how to do so.
47+
There are 3 options for running setuptools: root, user, venv
5948

60-
#### OS X
61-
First off, install Homebrew.
49+
### as root:
6250
```
63-
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
51+
python setup.py install
52+
pybitmessage
6453
```
6554

66-
Now, install the required dependencies
55+
### as user:
6756
```
68-
brew install git python openssl cartr/qt4/pyqt@4
57+
python setup.py install --user
58+
~/.local/bin/pybitmessage
6959
```
7060

71-
Download and run PyBitmessage:
61+
### as venv:
62+
Create virtualenv with Python 2.x version
7263
```
73-
git clone git://github.com/Bitmessage/PyBitmessage.git
74-
cd PyBitmessage && python src/bitmessagemain.py
64+
virtualenv -p python2 env
7565
```
7666

77-
## Creating a package for installation
78-
If you really want, you can make a package for PyBitmessage, which you may
79-
install yourself or distribute to friends. This isn't recommended, since
80-
PyBitmessage is in Beta, and subject to frequent change.
81-
82-
#### Linux
83-
First off, since PyBitmessage uses something nifty called
84-
[packagemonkey](https://github.com/fuzzgun/packagemonkey), go ahead and get
85-
that installed. You may have to build it from source.
86-
87-
Next, edit the generate.sh script to your liking.
88-
89-
Now, run the appropriate script for the type of package you'd like to make
67+
Activate env
9068
```
91-
arch.sh - create a package for Arch Linux
92-
debian.sh - create a package for Debian/Ubuntu
93-
ebuild.sh - create a package for Gentoo
94-
osx.sh - create a package for OS X
95-
puppy.sh - create a package for Puppy Linux
96-
rpm.sh - create a RPM package
97-
slack.sh - create a package for Slackware
69+
source env/bin/activate
9870
```
9971

100-
#### OS X
101-
Please refer to
102-
[this page](https://bitmessage.org/forum/index.php/topic,2761.0.html) on the
103-
forums for instructions on how to create a package on OS X.
72+
Install requirements.txt
73+
```
74+
pip install -r requirements.txt
75+
```
10476

105-
Please note that some versions of OS X don't work.
77+
Build & run pybitmessage
78+
```
79+
python setup.py install
80+
pybitmessage
81+
```
10682

107-
#### Windows
108-
## TODO: Create Windows package creation instructions
83+
## Alternative way to run PyBitmessage, without setuptools (this isn't recommended)
84+
run `src/bitmessagemain.py`.
85+
```
86+
cd PyBitmessage/ && python src/bitmessagemain.py
87+
```

checkdeps.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
"Debian": ["libcap-dev python-prctl"],
4848
"Ubuntu": ["libcap-dev python-prctl"],
4949
"Ubuntu 12": ["libcap-dev python-prctl"],
50+
"Ubuntu 20": [""],
5051
"openSUSE": [""],
5152
"Fedora": ["prctl"],
5253
"Guix": [""],
@@ -162,6 +163,10 @@ def testCompiler():
162163
"Optional dependency `pip install .[{}]` would require `{}`"
163164
" to be run as root".format(lhs, rhs_cmd))
164165

166+
if detectOS.result == "Ubuntu 20":
167+
print(
168+
"Qt interface isn't supported in %s" % detectOS.result)
169+
165170
if (not compiler or prereqs) and OPSYS in PACKAGE_MANAGER:
166171
print("You can install the missing dependencies by running, as root:")
167172
if not compiler:

src/depends.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
"Debian": "apt-get install",
4646
"Ubuntu": "apt-get install",
4747
"Ubuntu 12": "apt-get install",
48+
"Ubuntu 20": "apt-get install",
4849
"openSUSE": "zypper install",
4950
"Fedora": "dnf install",
5051
"Guix": "guix package -i",
@@ -58,6 +59,7 @@
5859
"Debian": "python-qt4",
5960
"Ubuntu": "python-qt4",
6061
"Ubuntu 12": "python-qt4",
62+
"Ubuntu 20": "",
6163
"openSUSE": "python-qt",
6264
"Fedora": "PyQt4",
6365
"Guix": "[email protected]",
@@ -75,6 +77,7 @@
7577
"Debian": "python-msgpack",
7678
"Ubuntu": "python-msgpack",
7779
"Ubuntu 12": "msgpack-python",
80+
"Ubuntu 20": "",
7881
"openSUSE": "python-msgpack-python",
7982
"Fedora": "python2-msgpack",
8083
"Guix": "python2-msgpack",
@@ -89,6 +92,7 @@
8992
"Debian": "python-pyopencl",
9093
"Ubuntu": "python-pyopencl",
9194
"Ubuntu 12": "python-pyopencl",
95+
"Ubuntu 20": "",
9296
"Fedora": "python2-pyopencl",
9397
"openSUSE": "",
9498
"OpenBSD": "",
@@ -106,11 +110,25 @@
106110
"Debian": "python-setuptools",
107111
"Ubuntu": "python-setuptools",
108112
"Ubuntu 12": "python-setuptools",
113+
"Ubuntu 20": "python-setuptools",
109114
"Fedora": "python2-setuptools",
110115
"openSUSE": "python-setuptools",
111116
"Guix": "python2-setuptools",
112117
"Gentoo": "dev-python/setuptools",
113118
"optional": False,
119+
},
120+
"six": {
121+
"OpenBSD": "py-six",
122+
"FreeBSD": "py27-six",
123+
"Debian": "python-six",
124+
"Ubuntu": "python-six",
125+
"Ubuntu 12": "python-six",
126+
"Ubuntu 20": "python-six",
127+
"Fedora": "python-six",
128+
"openSUSE": "python-six",
129+
"Guix": "python-six",
130+
"Gentoo": "dev-python/six",
131+
"optional": False,
114132
}
115133
}
116134

@@ -150,6 +168,8 @@ def detectOSRelease():
150168
pass
151169
if detectOS.result == "Ubuntu" and version < 14:
152170
detectOS.result = "Ubuntu 12"
171+
elif detectOS.result == "Ubuntu" and version >= 20:
172+
detectOS.result = "Ubuntu 20"
153173

154174

155175
def try_import(module, log_extra=False):

0 commit comments

Comments
 (0)