Wednesday, November 14, 2007

Installing Pate for Kate

UPDATE

Like an idiot, I lost the patches that I made (the links below are broken). Thanks to Dennis in the comments for making new patches. As far as I can tell, they only work with pate-0.5, not pate-0.5.1. Download the patch here. To apply the patch, run the following command from inside the pate source directory:

patch -p1 < pate-0.5-ubuntu.diff

Intro

You need to do some hacking to get Pate installed on a (K)ubuntu 7.10 system.

Background


Pate is a really cool plugin for Kate (which is a text editor for my favorite desktop environment). It is a Kate plugin that allows you to write other Kate plugins in Python (instead of C++). It also comes with a few Python-written plugins, mainly to demonstrate what you can do with it.

I had a very hard time installing Pate. The reason being that the author is a Suse user and his configure script only works? is tailored for Suse. I'm an Ubuntu user; specifically Kubuntu 7.10 Gutsy Gibbon.

Installation Process


You need to install development headers/libraries for Kate, Sip, KDE Python bindings, QT Python bindings, etc.

sudo aptitude install cmake sip4 python-sip4-dev python-kde3-dev \
python-qt-dev kate-plugins kdelibs-dev kdebase-dev
If I'm missing anything, please let me know and I'll update this.

Pate-0.5
cd PATE_SRC
wget http://www.stochasticbytes.com/pate/pate-0.5-ubuntu-patches.tar.gz
tar xzf pate-0.5-ubuntu-patches.tar.gz

Now configure && cd build && make && sudo make install should work as expected.

Here is a link to my Pate-0.5 patches.

Pate-0.5.1

This version isn't available (yet) via the main Pate webpage, but here's a link for you.

cd PATE_SRC
wget www.stochasticbytes.com/pate/pate-0.5.1-ubuntu-patches.tar.gz
tar xzf pate-0.5.1-ubuntu-patches.tar.gz

Now configure && cd build && make && sudo make install should work as expected.

Here is a link to my Pate-0.5.1 patches.

Why?


Why did I go through the trouble of making a blog post about this rather than submit my changes back to the author? Two reasons:

  1. It's an excuse to make a blog post!
  2. The author and the kwrite-devel mailing list didn't seem too interested in my plight.

29 comments:

Jan-Klaas Kollhof said...

After installing 'kdebase-dev' in addition to the packages you listed, it build and installed and Pate is now running in Kate.

Thanks!

Christopher J. Bottaro said...

Ahh... post updated, thank you.

vince said...

I'm getting an error that says:

configure: CMake 2.4-7
configure: Kate plugin directory at /usr/share/apps/kate/plugins
configure: SIP not installed or not in the Python path (could not import sipconfig)

I do have sip4 installed via apt-get as per your post. Any ideas?

Christopher J. Bottaro said...

vince,

The 3 sip packages I have installed are:

sip4
python-sip4
python-sip4-dev

I'm not sure, but I think maybe a couple of them were installed by default on my system, hence why I didn't feel the need to list them in the original post.

'dpkg -L sip4-python' shows that it provides sipconfig.py, so I think that should do it for ya.

vince said...

Yup, that was the missing package. Now, however I get:

configure: PyKDE not installed or not in the Python path (could not import pykdeconfig).

I thought I'd install python-kde3 and python-kde3-dev but neither package helped me get past this one. Could I be missing something else?

vince said...

Actually, to edit my above post (sort of), the missing package was actually python-sip4-dev. python-sip4 had already been installed.

Christopher J. Bottaro said...

vince,

$ dpkg -L python-kde3 | grep pykdeconfig
/usr/share/pycentral/python-kde3/site-packages/pykdeconfig.py

Looks like dpkg says that pykdeconfig is provided by python-kde3, so I'm kind of at a loss.

How was Python installed? If it was installed by source or some other way besides apt and the official Ubuntu repositories, then you'll have to configure it to look in for pykde wherever apt installed it.

What happens if you start the Python interpreter on the command line and type 'import pykdeconfig'?

vince said...

Yeah, I'm kind of at a loss too.. here's the output of dpkg -L python-kde3-dev | grep pykdeconfig

/usr/lib/python-2.4/site-packages/pykdeconfig_d.py
/usr/lib/python-2.4/site-packages/pykdeconfig_nd.py
/usr/lib/python-2.4/site-packages/pykdeconfig.py
/usr/lib/python-2.5/site-packages/pykdeconfig_nd.py
/usr/lib/python-2.5/site-packages/pykdeconfig.py

I'm not a python developer so I'm not sure how to start the python command interpreter. Can you email me at vince71 at gmail dot com? I'd really love to get your plugin working as I'm recently moved over from TextMate/Rails to Linux/Rails

felix said...

Thanks!

Chris Lee said...

i'm in the same situation as vince. i'm suffering the same issue with PyKDE.
it would be great if you post how you solved it.

big up
chris

jan said...

well ... a dirty hack would be this ...

~# sudo apt-get source python-kde3-dev
...
~# cd cd python-kde3-*
~/python-kde3-*# sudo cp pykdeconfig.py /usr/lib/python2.5/site-packages/

kr,

Christopher J. Bottaro said...

Sorry, I don't have an answer. I have never used a straight up Debian system, just (K)ubuntu. Also, I don't even have a Linux machine anymore.

Chris Lee said...

Hi Jan,

the mentioned file is in this folder yet.
i recognized there are 2 python versions?
python-2.4 & python-2.5. though in both site-packages/ is a file named pykdeconfig.py.
mmh. so that seems to be not the problem.
i'd really like to this plugin working. so if there is any other idea, i'd try it.

greetings
Chris

olivier said...

There's an error in the python-kde3-dev package. The files in /usr/lib/python-2.4/ and /usr/lib/python-2.5/ should be in /usr/lib/python2.4/ and /usr/lib/python2.5/ so you need to copy or symlink them.

Jethro said...

Oliver, this works perfectly! Thx!

rdoursenaud said...

Hi,

i'm very interrested in your patches but the link seems broken...

Christopher J. Bottaro said...

Dammit!! I cancelled the virtual server that those files were hosted on... :( I don't know if they are backed up anywhere...

denis said...

Hi Christopher,

I would also appreciate it if you could locate your Pate patches. I'm trying to install Pate on Kubuntu 8.04, unsuccessfully so far. Apparently, the configure script fails to locate ktexteditor/*.h files when it attempts to compile ktexteditor bindings.

denis said...

Upd: I succeeded in installing Pate. I uploaded my patch to Pastebin: http://pastebin.com/f9701101. In short: sip/ktexteditor/configure.py, sip/kateinterface/configure.py and sip/kateinterface/kateinterface.sip had to be modified to include some folders/headers.

Christopher J. Bottaro said...

Awesome, thank you for that!

denis said...

Christopher,

I would've gotten nowhere without your post :) I think I screwed up the patch a little while uploading it to Pastebin because of their @@ highlighting. Do you think you could host the patch somewhere? I could also add some instructions for people who have never used patch.

Denis said...

Thanks, Christopher!

You're right, it doesn't work with 0.5.1. I was surprised at this at first, but then I remembered that I checked out the latest version from bzr instead of downloading 0.5.1.
And 0.5.1 requires no patches on my machine, as it turns out. It already includes all the stuff that I've created a patch for. I thought that the source from the repository would have the latest fixes... Oh, the irony.

Anonymous said...

After solving the pykdeconfig problem under kubuntu 8.04 with olivers post (thanks oliver) I need to install 'build-essential' in addition to the packages you listed. Sure, people used to compiling would known this.

Thanks and regards!

Celia said...

Good for people to know.

Anonymous said...

i am using an eee with xandros. does anyone have a compiled version of pate i can use? (sorry if i am asking the wrong question - am new to this...)

Anonymous said...

Hello.

I installed Pate and checked the box for Pate in Settings->Configure Kate->Application->Plugins. But no effect.

Anonymous said...

UPD: I successfully installed Pate.

Anonymous said...

That’s Too nice, when it comes in india hope it can make a Rocking place for youngster.. hope that come true.

rH3uYcBX

Anonymous said...

Thank you for your help!

rH3uYcBX