Skip to content

Commit

Permalink
Added set-up instructions for developement with protobuf
Browse files Browse the repository at this point in the history
  • Loading branch information
qstokkink committed Jul 20, 2016
1 parent cf0ed91 commit e896577
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 2 deletions.
2 changes: 1 addition & 1 deletion doc/development/development_on_linux.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Execute the following command in your terminal:

.. code-block:: none
sudo apt-get install libav-tools libjs-excanvas libjs-mootools libsodium13 libx11-6 python-apsw python-cherrypy3 python-crypto python-cryptography python-feedparser python-leveldb python-libtorrent python-m2crypto python-netifaces python-pil python-pyasn1 python-requests python-twisted python-wxgtk2.8 python2.7 vlc python-pip
sudo apt-get install libav-tools libjs-excanvas libjs-mootools libsodium13 libx11-6 python-apsw python-cherrypy3 python-crypto python-cryptography python-feedparser python-leveldb python-libtorrent python-m2crypto python-netifaces python-pil python-pyasn1 python-requests python-twisted python-wxgtk2.8 python2.7 vlc python-pip python-protobuf
sudo pip install decorator libnacl
Experimental support for Ubuntu 16.04
Expand Down
2 changes: 1 addition & 1 deletion doc/development/development_on_osx.rst
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ There are a bunch of other packages that can easily be installed using pip and b

.. code-block:: none
brew install homebrew/python/pillow gmp mpfr libmpc libsodium
brew install homebrew/python/pillow gmp mpfr libmpc libsodium protobuf
pip install --user cherrypy pillow cffi cryptography decorator feedparser gmpy2 idna leveldb netifaces numpy pyasn1 pycparser requests twisted service_identity
If you encounter any error during the installation of Pillow, make sure that libjpeg and zlib are installed. They can be installed using:
Expand Down
67 changes: 67 additions & 0 deletions doc/development/development_on_windows.rst
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,73 @@ VLC

To install VLC, you can download the official installer from the `VideoLAN website <http://www.videolan.org/vlc/download-windows.html>`_. Make sure to install the 64-bit version of VLC.

Protocol Buffers
----------------
To build the Protocol Buffers library for Windows you will first need to download and install Microsoft Visual C++ Compiler for Python 2.7. You can get it at http://aka.ms/vcpython27 .

You then need to download the Protocol Buffers 2.6.1 full source from https://developers.google.com/protocol-buffers/docs/downloads . Extract the contents to some folder. The rest of this section will refer to this folder as :code:`%FULLSOURCELOCATION%`.

From https://developers.google.com/protocol-buffers/docs/downloads again, now download the Protocol Compiler 2.6.1 binary for windows. Place its contents (a single file :code:`protoc.exe`) in :code:`%FULLSOURCELOCATION%\src` .

Now create a new file :code:`CoreWin.vsprops` in :code:`%FULLSOURCELOCATION%\vsprojects`, with the following contents:

.. code-block:: none
<?xml version="1.0"?>
<VisualStudioPropertySheet
ProjectType="Visual C++"
Version="8.00"
Name="Core Windows Libraries">
<Tool
Name="VCLinkerTool"
AdditionalDependencies="kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib"/>
</VisualStudioPropertySheet>
Now open a Command Prompt (:code:`cmd`) set the Current Directory (:code:`cd`) to :code:`%FULLSOURCELOCATION%\vsprojects`.
Then execute the following commands in order (for either a **64** or **32** bit build):

------------

**FOR A 64 BIT BUILD**

------------

.. code-block:: none
SETLOCAL
SET PATH=%PATH%;%LOCALAPPDATA%\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\bin\amd64
"%LOCALAPPDATA%\Programs\Common\Microsoft\Visual C++ for Python\9.0\vcvarsall.bat" amd64
"%LOCALAPPDATA%\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\bin\amd64\vcbuild.exe" /upgrade libprotobuf.vcproj
"%LOCALAPPDATA%\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\bin\amd64\vcbuild.exe" /useenv libprotobuf.vcproj "Release|Win32"
------------

------------

**FOR A 32 BIT BUILD**

------------

.. code-block:: none
SETLOCAL
SET PATH=%PATH%;%LOCALAPPDATA%\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\bin\x86
"%LOCALAPPDATA%\Programs\Common\Microsoft\Visual C++ for Python\9.0\vcvarsall.bat" x86
"%LOCALAPPDATA%\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\bin\amd64\vcbuild.exe" /upgrade libprotobuf.vcproj
"%LOCALAPPDATA%\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\bin\amd64\vcbuild.exe" /useenv libprotobuf.vcproj "Release|Win32"
------------

For all other builds (cross compile, ARM, etc.) see https://msdn.microsoft.com/en-us/library/f2ccy3wt.aspx#Anchor_1.

If everything completed correctly this should have created the file:
:code:`%FULLSOURCELOCATION%\vsprojects\Release\libprotobuf.lib`
Copy **and rename** this file to:
:code:`%FULLSOURCELOCATION%\python\protobuf.lib`

Now create the directory :code:`%FULLSOURCELOCATION%\python\google\protobuf\compiler`.

Finally run :code:`python %FULLSOURCELOCATION%\python\setup.py install --cpp_implementation`.

Additional Packages
-------------------

Expand Down

0 comments on commit e896577

Please sign in to comment.