En/TDE sip4-tqt

From Studiosg
Revision as of 12:28, 17 April 2014 by Wikiuser (talk | contribs)
Jump to navigationJump to search

Welcome to Simone Giustetti's wiki pages.


Languages: English - Italiano


SIP4-TQT

En/trinity_desktop_environment#Base_Packages

SIP is a tool written to ease the creation of bindings between the Python language and libraries written in the C or C++ programming languages. SIP was originally meant to create PyQt, Python bindings for the QT toolkit, but can be used with every library written in C or C++. Slackware contains an official SIP package which lacks compatibility with the TQT libraries needed by the Trinity Desktop Environment to properly work. All TDE related Python packages require SIP to build and run once installed. As a consequence a custom TDE version of SIP is needed to replace the Slackware included one.

Sip4-tqt and Slackware

Source code for the custom SIP version: sip4-tqt, is not released as a tgz archive along the other desktop environment packages. The code can be retrieved from the project GIT repository only. Two ways exist to download it:

  • Connect to the repository through a web browser and download a compressed archive of the last available version of the master branch. sip4-tqt-master.tar.gz
  • Install GIT on your machine and use the following commands:
  1. Move in the directory You wish to download the files to
  2. Run command git clone http://anonymous@scm.trinitydesktop.org/scm/git/sip4-tqt
  3. Rename the root source code directory: mv sip4-tqt sip4-tqt-master (This is only needed to copy with the naming convention of the file downloaded with the previously described method)
  4. Build an archive of the source code files: tar -zcf sip4-tqt-master.tar.gz sip4-tqt-master

Whatever the method, we will use the resulting sip4-tqt-master.tar.gz file to build a working SIP package as described further below.

Being an official package, a SlaclBuild script exists and can be used as a reference for the packaging procedure. The customized package will replace the standard one and as such /opt/trinity cannot be used as root directory. We will instead use /usr, the predefined SIP installation directory. The official package does not use autotools nor cmake for configuring, only a Phyton script: configure.py, which can be executed running: python configure.py <options> . Once configured the package can be built running make followed by make install.

My first attempts at compiling SIP failed due to some missing include files issues resulting in compiler errors. From reading the TDE documentation I learned the command line was in need of some additional paths were to search for include files. Adding those paths only resolved one of the three errors the make command returned. The remaining two errors were solved by adding some links to directories. In short:

Run command:

  export SLKCFLAGS="-O2 -march=i486 -mtune=i686 -I/usr/include/tqt"
  export PYTHONVER=$(python -V 2>&1 | cut -f 2 -d' ' | cut -f 1-2 -d.)
  export PYTHONLIB=$( python -c 'from distutils.sysconfig import get_python_lib; print get_python_lib()' )
  
  python configure.py \
     -b "/usr/bin" \
     -d "$PYTHONLIB" \
     -e "/usr/include/python$PYTHONVER" \
     CFLAGS="$SLKCFLAGS" \
     CXXFLAGS="$SLKCFLAGS"

to configure sip-tqt for a 32 bit environment.

Passing option -I/usr/include/tqt to the configuration script is mandatory to solve the following error:

  bash-4.2# make
  make[1]: Entering directory `/usr/src/tde/3.5.13.2/sip4-tqt/sip4-tqt-3.5.13.2/sipgen'
  gcc -c -O2 -march=i486 -mtune=i686 -O2 -w -DNDEBUG -I. -o main.o main.c
  In file included from main.c:26:0:
  sip.h:26:17: fatal error: tqt.h: No such file or directory
  compilation terminated.
  make[1]: *** [main.o] Error 1
  make[1]: Leaving directory `/usr/src/tde/3.5.13.2/sip4-tqt/sip4-tqt-3.5.13.2/sipgen'
  make: *** [all] Error 2

Create link:

  ln -s /usr/include/tqt /usr/include/tqt4

To solve another compiler error:

  bash-4.2# make
  make[1]: Entering directory `/usr/src/tde/3.5.13.2/sip4-tqt/sip4-tqt-3.5.13.2/sipgen'
  gcc -c -O2 -march=i486 -mtune=i686 -I/usr/include/tqt -O2 -w -DNDEBUG -I. -o main.o main.c
  In file included from sip.h:26:0,
                 from main.c:26:
  /usr/include/tqt/tqt.h:51:21: fatal error: qglobal.h: No such file or directory
  compilation terminated.
  make[1]: *** [main.o] Error 1
  make[1]: Leaving directory `/usr/src/tde/3.5.13.2/sip4-tqt/sip4-tqt-3.5.13.2/sipgen'
  make: *** [all] Error 2

At last create link:

  ln -s /opt/trinity/include /usr/include/tqt/QtCore

To solve error:

  bash-4.2# make
  make[1]: Entering directory `/usr/src/tde/3.5.13.2/sip4-tqt/sip4-tqt-3.5.13.2/sipgen'
  gcc -c -O2 -march=i486 -mtune=i686 -I/usr/include/tqt -O2 -w -DNDEBUG -I. -o main.o main.c
  In file included from /usr/include/tqt/tqt.h:51:0,
                 from sip.h:26,
                 from main.c:26:
  /usr/include/tqt/qglobal.h:62:28: fatal error: QtCore/qconfig.h: No such file or directory
  compilation terminated.
  make[1]: *** [main.o] Error 1
  make[1]: Leaving directory `/usr/src/tde/3.5.13.2/sip4-tqt/sip4-tqt-3.5.13.2/sipgen'
  make: *** [all] Error 2

Adding include files to the configure.py command line was not enough to solve all three errors, therefore the need for links.

A SlackBuild script including all of the instructions and hacks needed to build can be downloaded from the following link. The tde suffix was added to the package name in order to differentiate it from the standard one.

After packaging SIP, before installing it please remember to remove the Slackware package running command:

  removepkg sip-4.13.2-i486-2

Then command:

  installpkg sip-tde-i486-1sg.txz

Otherwise You can replace the two command sequence with a single upgradepkg:

  upgradepkg sip-4.13.2-i486-2%sip-tde-i486-1sg.txz

After installing sip-tqt You can go on with building the other TDE Python packages.


For any feedback, questions, errors and such, please e-mail me at studiosg [at] giustetti [dot] net


External Links



Languages: English - Italiano