Wednesday, December 12, 2012

Installing XPaint on Mageia2

XPaint is a desktop image editing application with a long history. It is currently maintained by Jean-Pierre Demailly, who will shortly be releasing version 2.9.9.3.

There is no RPM package available for Magia2, so I thought I would compile it from the source code, but I ran into some problems. The first was that naming conventions between the source code and what Mageia provides differ.










The XPaint INSTALL file says the following libraries (plus their development libraries) are necessary to compile XPaint.

libX11
libXext
libXt
libXmu
libSM
libICE
libXp
libXpm
libz
libpng
libtiff
libjpeg
libopenjpeg


Naming conventions are always annoyingly problematic. Mageia provides:

libx11_6            libx11_6-devel
libxext6            libxext6-devel
libxt6              libxt-devel
libxmu6             libxmu6-devel
libsm6              libsm-devel
libice6             libice-devel
libxp6              libxp-devel
libxpm4             libxpm-devel
libzlib1            libzlib-devel
libpng12_0          libpng12-devel
libpng15_15         libpng-devel
libtiff5            libtiff-devel
libjpeg8            libjpeg-devel
libopenjpeg1        libopenjpeg-devel
libXaw3dXft         libXaw3dXft-devel

Plus, you'll need
libxft-devel

Since Mageia2 does not provide it, you will also need the libXaw3dXft-1.6.2b library provided by XPaint's Sourceforge page which you must compile first.

To install all the Mageia-provided dependencies,

$ sudo urpmi libx11_6 libx11_6-devel libxext6 libxext6-devel libxt6 libxt-devel libxmu6 libxmu6-devel libsm6 libsm-devel libice6 libice-devel libxp6 libxp-devel libxpm4 libxpm-devel libzlib1 libzlib-devel libpng12_0 libpng12-devel libpng15_15 libpng-devel libtiff5 libtiff-devel libjpeg8 libjpeg-devel libopenjpeg1 libopenjpeg-devel libxft-devel

This will install an additional 43 or so packages on a standard Mageia2 system.

Lets begin with libXaw3dXft. Unpack the sources, configure and compile.

NOTE: the default installation locations for both are in /usr/local; I prefer them in /usr.

In ~/libXaw3dXft/,

$ ./configure --prefix=/usr --enable-arrow-scrollbars
$ make
$ sudo make install

Now, we may compile the application in ~/xpaint-2.9.9.3/.

For me, there was a missing link to libXaw3dXft and Jean-Pierre kindly provided a fix (this may be fixed by the time you attempt this).

$ ln -s /usr/include/X11/Xaw3dxft ~/xpaint-2.9.9.3/xaw_incdir

Now we can compile XPaint in ~/xpaint-2.9.9.3/,

$ ./configure --prefix=/usr
$ make
$ sudo make install

Many thanks to Jean-Pierre Demailly for maintaining XPaint and for his generous assistance. If I can get motivated to learn a few new procedures, I might maintain an XPaint RPM for Mageia.




Jean-Pierre Demailly recently corresponded with this advice:

I forgot to mention (and that's probably hardly visible in the docs),
that it is advisable to compile libXaw3dxft with the options
  --prefix=/usr --enable-arrow-scrollbars
The instructions above have been modified to reflect this.- ed.
The second option provides arrow scrollbars that have a look and feel similar
to modern toolkits, and XPaint behaves better with them enabled.

(I'll make that option the default in the next release, but the libXaw3d
variant doesn't and I did not change that yet ...)

UPDATE July, 2013
Because of the problems with libraries, I have not been successful compiling XPaint for Mageia3.

However, Mageia3 does provide gpaint which is based on XPaint and functions much like it. I now use that.

No comments: