Marble/MarblePythonInstructions: Difference between revisions

From KDE TechBase
 
(10 intermediate revisions by 2 users not shown)
Line 4: Line 4:
=== Getting the Dependencies ===
=== Getting the Dependencies ===
*'''deb-based distributions (Debian, Ubuntu...):'''  
*'''deb-based distributions (Debian, Ubuntu...):'''  
  $ sudo apt-get install python-sip python-qt4
  $ sudo apt-get install python-sip-dev python-qt4 python-qt4-dev


*'''OpenSuSE:''' All the necessary dependencies:
*'''OpenSuSE:''' All the necessary dependencies:
  $ sudo zypper install python-sip python-qt4
  $ sudo zypper install python-sip python-sip-bin python-qt4


*'''Fedora/RHEL:''' All the dependencies used for building kdelibs can be installed by running:
*'''Fedora/RHEL:''' All the dependencies used for building kdelibs can be installed by running:
  $ sudo yum install python-sip python-qt4
  $ sudo yum install python-sip python-sip-bin python-qt4


*'''Arch Linux:''' All the dependencies used for building kdelibs can be installed by running:
*'''Arch Linux:''' All the dependencies used for building kdelibs can be installed by running:
Line 19: Line 19:
To install the Marble Python bindings we will need to compile Marble from source. The following commands will download and compile Marble:
To install the Marble Python bindings we will need to compile Marble from source. The following commands will download and compile Marble:


  $ git clone git://anongit.kde.org/marble.git ~/.marble -b KDE/4.11
  $ git clone git://anongit.kde.org/marble.git ~/marble/sources -b KDE/4.12
  $ cd ~/.marble
  $ mkdir -p ~/marble/build
$ mkdir -p build
  $ cd ~/marble/build
  $ cd build
  $ cmake ~/marble/sources -DCMAKE_BUILD_TYPE=Release -DEXPERIMENTAL_PYTHON_BINDINGS=TRUE -DCMAKE_INSTALL_PREFIX=/usr/local
  $ cmake ../ -DCMAKE_BUILD_TYPE=Release -DEXPERIMENTAL_PYTHON_BINDINGS=TRUE -DQTONLY=FALSE  -DCMAKE_INSTALL_PREFIX=/usr/local
  $ make
  $ make
  $ sudo make install
  $ sudo make install
Line 29: Line 28:
On Arch Linux you will have to add the following options to cmake so it looks like this:
On Arch Linux you will have to add the following options to cmake so it looks like this:


  $ cmake ../ -DQT_QMAKE_EXECUTABLE=qmake-qt4 -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr -DEXPERIMENTAL_PYTHON_BINDINGS=TRUE -DQTONLY=FALSE
  $ cmake ~/marble/sources -DQT_QMAKE_EXECUTABLE=qmake-qt4 -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr -DEXPERIMENTAL_PYTHON_BINDINGS=TRUE


For an example of build instructions visit [http://marble.kde.org/sources.php Marble's sources page]. Just make sure to add the <code>-DEXPERIMENTAL_PYTHON_BINDINGS=TRUE -DQTONLY=FALSE</code> flags to cmake
For an example of build instructions visit [http://marble.kde.org/sources.php Marble's sources page]. Just make sure to add the <code>-DEXPERIMENTAL_PYTHON_BINDINGS=TRUE</code> flags to cmake
 
=== Writing some Code ===
For tutorials on how to use Marble with Python, please see this [http://techbase.kde.org/Projects/Marble#With_Python techbase page]. For documentation of the Marble Python bindings, see [http://api.kde.org/pykde-4.7-api/marble/index.html api.kde.org].
 
For writing Python code we suggest you use an IDE such as [http://sourceforge.net/projects/qtcreator.mirror/ Qt Creator] that includes syntax highlighting and auto-indentation.

Latest revision as of 21:01, 10 March 2016

Installing Marble's Python Bindings

General requirements

Marble's Python Bindings only depend on PyQt and SIP and do not require the kdebindings-python package provided by some distributions (these are only for some other KDE Python bindings).

Getting the Dependencies

  • deb-based distributions (Debian, Ubuntu...):
$ sudo apt-get install python-sip-dev python-qt4 python-qt4-dev
  • OpenSuSE: All the necessary dependencies:
$ sudo zypper install python-sip python-sip-bin python-qt4
  • Fedora/RHEL: All the dependencies used for building kdelibs can be installed by running:
$ sudo yum install python-sip python-sip-bin python-qt4
  • Arch Linux: All the dependencies used for building kdelibs can be installed by running:
$ sudo pacman -Sy python-sip python-pyqt4

Installing the Marble Python bindings

To install the Marble Python bindings we will need to compile Marble from source. The following commands will download and compile Marble:

$ git clone git://anongit.kde.org/marble.git ~/marble/sources -b KDE/4.12
$ mkdir -p ~/marble/build
$ cd ~/marble/build
$ cmake ~/marble/sources -DCMAKE_BUILD_TYPE=Release -DEXPERIMENTAL_PYTHON_BINDINGS=TRUE -DCMAKE_INSTALL_PREFIX=/usr/local
$ make
$ sudo make install

On Arch Linux you will have to add the following options to cmake so it looks like this:

$ cmake ~/marble/sources -DQT_QMAKE_EXECUTABLE=qmake-qt4 -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr -DEXPERIMENTAL_PYTHON_BINDINGS=TRUE

For an example of build instructions visit Marble's sources page. Just make sure to add the -DEXPERIMENTAL_PYTHON_BINDINGS=TRUE flags to cmake

Writing some Code

For tutorials on how to use Marble with Python, please see this techbase page. For documentation of the Marble Python bindings, see api.kde.org.

For writing Python code we suggest you use an IDE such as Qt Creator that includes syntax highlighting and auto-indentation.