Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

pyjamasubuntuwebkitgtk

earney edited this page · 5 revisions

Installing Pyjamas and Pyjamas Desktop on Ubuntu 11.10

Introduction

This page explains how to install and run Pyjamas and Pyjamas Desktop with WebKitGTK on Ubuntu.

Getting And Building Pyjamas

$ git clone https://github.com/pyjs/pyjs.git

This should create a directory pyjamas/ containing the current development source code.

Run bootstrap.py to create the bin/ directory, containing wrapper programs necessary to compile Pyjamas applications, and also to create the file pyjd/__init__.py for pyjamas-desktop integration:

$ cd pyjamas
pyjamas$ python bootstrap.py

It is useful to add the bin/ directory to your PATH variable (and/or to ~/.bashrc), for example:

pyjamas$ export PATH=`pwd`/bin:$PATH

Testing Pyjamas

A first test can be done now:

pyjamas$ cd examples/helloworld/
pyjamas/examples/helloworld$ ./build.sh Hello.py

This generates a directory output/ containing Hello.html and a lot of other files and directories.

Now you can open output/Hello.html in firefox:

pyjamas/examples/helloworld$ firefox output/Hello.html

Now go back to the pyjamas/ root directory for the next step:

pyjamas/examples/helloworld$ cd ../..

Setting Up Pyjamas-Desktop: Webkit

Note

pythonwebkit doesn't support Canvas applications. If you intend to run an app that uses Canvas, instead try xulrunner.

Detailed instructions are available at http://www.gnu.org/software/pythonwebkit/

Install libwebkit for it's dependencies, and then remove it:

sudo apt-get build-dep libwebkit-dev
sudo apt-get install libwebkit-dev
sudo apt-get remove libwebkit-dev

Other required packages:

sudo apt-get install build-essential
sudo apt-get install python-dev python-ply python-gtk2-dev
sudo apt-get install gnome-common gtk-doc-tools libxml2-dev

Get the pythonwebkit code:

git clone --depth 1 git://git.savannah.gnu.org/pythonwebkit.git
cd pythonwebkit
git checkout python_codegen

Compile the sources:

mkdir build
cd build
../autogen.sh
../configure

make
sudo make install
cd ../..

Update the shared libraries:

sudo ldconfig

Quick sanity check that python can import pywebkitgkt:

python
>>> import pywebkitgtk
>>>

If there is a problem here it may be helpful to check /etc/ld.so.conf to ensure it contains /usr/local/lib, and also to run ldconfig -p to double-check that the python webkit library is listed. Also consider doing ldd /usr/local/lib/libwebkitgtk-python-1.0.so.0 and double-check that the library can find all its runtime libs.

Create the pyjdrc file:

mkdir ~/.pyjd
vi ~/.pyjd/pyjdrc

Save the following 2 lines in ~/.pyjd/pyjdrc:

[gui]
engine:pywebkitgtk

Setup Pyjamas:

cd pyjamas
python run_bootstrap_first_then_setup.py build
sudo python run_bootstrap_first_then_setup.py install

Finally, test the Mail application using Pyjamas Desktop:

cd examples/mail
../../bin/pyjd Mail.py

Running The Test Suite

In pyjamas/examples/libtest, follow the README.

See also

Something went wrong with that request. Please try again.