Difference between revisions of "Compiling instructions"
Jump to navigation
Jump to search
(→Linux) |
|||
Line 14: | Line 14: | ||
# Bitmessage has two dependencies. The first is PyQt. Download and install PyQt from [http://www.riverbankcomputing.com/software/pyqt/download here]. You will want the Binary Package since it is already compiled for you. Be sure to select the version for Python 2.7. It is labeled as Py2.7. | # Bitmessage has two dependencies. The first is PyQt. Download and install PyQt from [http://www.riverbankcomputing.com/software/pyqt/download here]. You will want the Binary Package since it is already compiled for you. Be sure to select the version for Python 2.7. It is labeled as Py2.7. | ||
# The second dependency is OpenSSL which you can download from [http://slproweb.com/products/Win32OpenSSL.html here]. There you will also notice the link to download the Visual C++ 2008 program in case you also find that you need that as well. (The OpenSSL installer will complain if you need to install the Visual C++ Redistributable.) | # The second dependency is OpenSSL which you can download from [http://slproweb.com/products/Win32OpenSSL.html here]. There you will also notice the link to download the Visual C++ 2008 program in case you also find that you need that as well. (The OpenSSL installer will complain if you need to install the Visual C++ Redistributable.) | ||
− | # Download the source code for PyBitmessage from GitHub. If it is in a zip file, you will need to extract it. There should be a | + | # Download the source code for PyBitmessage from GitHub. If it is in a zip file, you will need to extract it. There should be a few files and a few folders where one of the folders is 'src'. |
− | # To run Bitmessage, double click on the bitmessagemain.py file, or in a command prompt, change directories to the directory | + | # To run Bitmessage, navigate into the 'src' folder and then double click on the bitmessagemain.py file, or in a command prompt, change directories to the 'src' directory which holds bitmessagemain.py and type 'python bitmessagemain.py'. |
=== If you change user interface files === | === If you change user interface files === | ||
Line 27: | Line 27: | ||
=== Optional: Compile into a stand-alone EXE === | === Optional: Compile into a stand-alone EXE === | ||
# Download [http://www.pyinstaller.org/ PyInstaller]. | # Download [http://www.pyinstaller.org/ PyInstaller]. | ||
− | # Copy all of the source code files to the PyInstaller directory (which contains pyinstaller.py). | + | # Copy all of the source code files from the 'src' directory to the PyInstaller directory (which contains pyinstaller.py). |
# Run 'pyinstaller.py --onefile --noconsole --icon="images\can-icon.ico" bitmessagemain.py' | # Run 'pyinstaller.py --onefile --noconsole --icon="images\can-icon.ico" bitmessagemain.py' | ||
This won't include the OpenSSL DLL file in the EXE; if you send it to someone who doesn't have OpenSSL installed, it will not run. To include the DLL file in the EXE, you must follow these steps: | This won't include the OpenSSL DLL file in the EXE; if you send it to someone who doesn't have OpenSSL installed, it will not run. To include the DLL file in the EXE, you must follow these steps: |
Revision as of 19:42, 17 April 2013
This page should help novice users run Bitmessage from the source code files.
Contents
Windows
- Download and install the latest revision of Python 2.7 (currently Python 2.7.3 from here). The Windows x86 MSI Installer is the right choice for most people. (64-bit users may want the 64-bit version).
- Test that it installed:
- Open a command prompt by going to Start > Run. Type 'cmd' then press enter.
- type 'python'. If python is installed, you should see the python version and the prompt: '>>>'
- If you see a message such as: "'Python is not recognized as an internal or external command..." then you must add the python path to your path environmental variable:
- Find the location where Python was installed (in particular, the location where python.exe exists). It might simply be in c:\Python2.7
- Follow these directions to add the Python path to your path variable.
- Close the command prompt window and reopen it.
- Try running 'python' again.
- Press Ctrl-Z to exit Python.
- Bitmessage has two dependencies. The first is PyQt. Download and install PyQt from here. You will want the Binary Package since it is already compiled for you. Be sure to select the version for Python 2.7. It is labeled as Py2.7.
- The second dependency is OpenSSL which you can download from here. There you will also notice the link to download the Visual C++ 2008 program in case you also find that you need that as well. (The OpenSSL installer will complain if you need to install the Visual C++ Redistributable.)
- Download the source code for PyBitmessage from GitHub. If it is in a zip file, you will need to extract it. There should be a few files and a few folders where one of the folders is 'src'.
- To run Bitmessage, navigate into the 'src' folder and then double click on the bitmessagemain.py file, or in a command prompt, change directories to the 'src' directory which holds bitmessagemain.py and type 'python bitmessagemain.py'.
If you change user interface files
You can use Qt's Designer application to modify the user interface. After you do this, you will need to 'compile' .ui files into .py files.
- In a command prompt, change directories to the directory of your .ui file.
- Run 'pyuic4 example.ui > example.py' If you get a message similar to 'pyuic4 is not recognized as an internal or external command' then you must add the PyQt directory to your system's path variable. This directory should hold pyuic4.bat. It might be in C:\Python27\Lib\site-packages\PyQt4. Remember to close the command window and reopen it after you change your path variable.
If you add icons to bitmessage_icons.qrc, then you must run this command: pyrcc4 bitmessage_icons.qrc -o bitmessage_icons_rc.py
Optional: Compile into a stand-alone EXE
- Download PyInstaller.
- Copy all of the source code files from the 'src' directory to the PyInstaller directory (which contains pyinstaller.py).
- Run 'pyinstaller.py --onefile --noconsole --icon="images\can-icon.ico" bitmessagemain.py'
This won't include the OpenSSL DLL file in the EXE; if you send it to someone who doesn't have OpenSSL installed, it will not run. To include the DLL file in the EXE, you must follow these steps:
- After following the steps above, you will see that pyinstaller created a folder called bitmessagemain. In that folder is a file: bitmessagemain.spec. Open it with a text editor.
- Below the line "a.datas," add this line:
a.binaries + [('libeay32.dll', 'c:\\windows\\system32\\libeay32.dll', 'BINARY')],
- Save and close
- Run this command: pyinstaller.py bitmessagemain/bitmessagemain.spec
Linux
Note: Fedora does not currently compile EC into OpenSSL and thus will not work. A workaround is needed to either recompile OpenSSL, or locate/install a OpenSSL package that supports EC extensions.
- Open a terminal and test that you have python, OpenSSL and git installed by entering python --version and openssl version and git --version
- If one or more of the items are not installed, install them
- On APT systems (Debian/ubuntu based systems) use sudo apt-get install python — sudo apt-get install openssl — sudo apt-get install git respectively
- On RPM systems (Fedora/red hat based systems) use sudo yum install python — sudo apt-get install openssl — sudo yum install git respectively
- If you need to install PyQt, install it. Use sudo apt-get install python-qt4 on APT systems.
- If one or more of the items are not installed, install them
- In the terminal, change to the directory you want the Bitmessage folder in (but don't create the bitmessage folder yet!)
- Clone the git repository by entering git clone https://github.com/Bitmessage/PyBitmessage
- Change to the PyBitmessage directory by entering cd PyBitmessage
- Start PyBitmessage by entering python bitmessagemain.py
- Optionally create a startup script that runs python PyBitmessage/bitmessagemain.py