diff --git a/docs/install.rst b/docs/install.rst index aacad2f..6cde5b5 100644 --- a/docs/install.rst +++ b/docs/install.rst @@ -14,7 +14,9 @@ platform-specific instructions to build the library in the libgit2 website: Also, make sure you have Python 2.6+ installed together with the Python development headers. -When those are installed, you can install pygit2:: +When those are installed, you can install pygit2: + +.. code-block:: sh $ git clone git://github.com/libgit2/pygit2.git $ cd pygit2 @@ -36,7 +38,9 @@ using the default installation procedure (e.g. without specifying ``CMAKE_INSTALL_PREFIX``), you probably installed it under ``/usr/local/lib``. On some distributions (e.g. Ubuntu), ``/usr/local/lib`` is not in the linker's default search path (see the -`ld man page`_ for details), and you will get errors like:: +`ld man page`_ for details), and you will get errors like: + +.. code-block:: sh $ python -c 'import pygit2' Traceback (most recent call last): @@ -47,7 +51,9 @@ using the default installation procedure (e.g. without specifying The following recipe shows how to install libgit2 and pygit2 on these systems. First, download and install libgit2 (following the -instructions in the libgit2 ``README.md``):: +instructions in the libgit2 ``README.md``): + +.. code-block:: sh $ git clone git://github.com/libgit2/libgit2.git $ mkdir libgit2/build @@ -59,7 +65,9 @@ instructions in the libgit2 ``README.md``):: Now, download and install pygit2. You will probably have to set the ``LIBGIT2`` environment variable so the compiler can find the libgit2 -headers and libraries:: +headers and libraries: + +.. code-block:: sh $ git clone git://github.com/libgit2/pygit2.git $ cd pygit2 @@ -72,7 +80,9 @@ This compiles the pygit2 libraries with a ``RUNPATH``, which bakes extra library search paths directly into the binaries (see the `ld man page`_ for details). With ``RUNPATH`` compiled in, you won't have to use ``LD_LIBRARY_PATH``. You can check to ensure ``RUNPATH`` was set -with readelf_:: +with readelf_: + +.. code-block:: sh $ readelf --dynamic build/lib.linux-x86_64-3.2/_pygit2.cpython-32.so | grep PATH 0x000000000000000f (RPATH) Library rpath: [/usr/local/lib] @@ -90,7 +100,9 @@ in the ``LIBGIT2`` environment variable. In addition, make sure that libgit2 is build in "__cdecl" mode. The following recipe shows you how to do it, assuming you're working -from a bash shell:: +from a bash shell: + +.. code-block:: sh $ export LIBGIT2=C:/Dev/libgit2 $ git clone git://github.com/libgit2/libgit2.git