Preparing to compile: all Puppy versions
Download the source code file qt-x11-free-3.3.8.tar.bz2 from ftp://ftp.trolltech.com/qt/source/.
Decide where you are going to install QT3 on your system. Unpack the tarball to this location. If it's for your Puppy installation only, you can unpack to a folder outside of the pup_save file and symlink to the installation location.
The package contains an excellent set of documents. There is a text file of the installation instructions in the root directory, which you may like to read. The instructions that follow are extracted from it.
Applying the patch
Download the patch file qt-x11-immodule-unified-qt3.3.8-20071116.diff. It's available here. Unpack it and place it in the QT directory.
cd to the qt directory and run the command:
patch -p1 -i qt-x11-immodule-unified-qt3.3.8-20071116.diff
The README.immodule file, which you can't read until you've run the patch anyway :), says to use patch -p0. This throws up errors, whereas -p1 runs flawlessly.
One of the files that's created by the patch is make-symlinks.sh. Make this executable and run it, either by clicking on it or by typing
./make-symlinks.sh in a terminal.
If you miss this step, compilation will fail with a "can't find" error.
Before you run ./configure, you need to set up some environment variables.
QTDIR - the directory where you are installing qt3
LD_LIBRARY_PATH - $QTDIR/lib (unless you are doing something fancy, in which case refer to the official docs for help).
PATH - $QTDIR/bin
PKG_CONFIG_PATH - $QTDIR/lib This is necessary for later on when you are compiling things against qt3
You can either put these in your /etc/profile file now and restart the X server, or you can type "export" commands in a terminal and adjust your /etc/profile later. If you are just doing a one-off compile that's going to be removed once it's packaged up, then you may prefer to just do the terminal commands and leave your /etc/profile alone.
Now you can begin compiling.
Use the configure command:
./configure --prefix=$QTDIR --thread -inputmethod
$QTDIR is shorthand for where you've decided to install QT3. The default is /usr/local/qt
If you want to compile extra plugins, such as SQL drivers, you can add those to the command line e.g. -plugin-sql-sqlite
However, you can come back and compile them separately without having to recompile QT3 all over again.
You'll be told which "make" command to use. It seems to be "gmake" on Puppy systems.
Start the compiling and go away and do one of those jobs you've been putting off for ages. It takes about 40 minutes on a 3.06GHz processor, and it doesn't go any faster if you sit there staring at it.
Because you've just built QT3 in the directory where it's going to remain, you don't do "make install".
If you have any QT3 programs, they should run now. If you don't have any, you'll find a number of widgets and test programs in the "examples" directory which you can use to test your QT3 installation. Some of them are also useful for testing scim later on.
QT3 compiled on Puppy 2 should run with no trouble in Puppy 3.01 and Puppy 4.00 if set up correctly (see "Important" note at the bottom of this page).
QT3 is very difficult to compile in Puppy 3.01. (Puppy 3.01 seems to be an awkward beast when it comes to compiling in general.) Several people have tried and can't get it to work! Fortunately, a package compiled on another distro will often work, and it can even be used to compile the immodule if you need to. (But see "Important" note at the bottom of this page.)
If you do manage to do it, please post letting us know how.
The same instructions apply to compiling on Puppy 4.00 as for 2.17. The only difference is that you'll need to symlink /usr/X11R7/include/fontconfig to /usr/include/fontconfig
QT4 is actually easier to compile than QT3. It doesn't need the PATH and so on set up until afterwards, and immodule support is already built in. No patches are needed.
Download qt-x11-opensource-src-4.3.4.tar.gz or later version from ftp://ftp.trolltech.com/qt/source/.
Unpack the tarball somewhere convenient.
Decide where you are going to install QT4. The default is /usr/local/Trolltech/Qt-4.3.4 (or other version).
You might want to symlink this directory to somewhere outside of the pup_save file before you start. A full install of QT4 is around 500 MB.
The configure command is:
./configure --prefix=(your qt4 directory)
You can add other plugins if you wish e.g. -plugin-sql-sqlite Type ./configure --help for a big list of options. You will be told which "make" command to use.
QT4 takes even longer to compile - about 1hr 15 mins on a 3.06GHz processor, so you can find a larger job to do this time. :)
Compiling on 3.01 needs /usr/X11R7/include/X11/extensions/XI.h. If you have another distro, you can copy or symlink it from there.
The command is:
./configure --prefix=(your QT4 directory) --release --sql-sqlite -plugin-sql-sqlite
Not necessary for Puppy 4 unless you need a version later than 4.3.2 Use the official .pet file.
But if you do need it, it's very straightforward.
./configure --prefix=(your QT4 directory)
You can add -plugin-sql-sqlite if you want to.
Install scim and QT first. They are dependencies.
./configure --prefix=/usr --enable-qt3-immodule --enable-qt4-immodule
You may --disable one or other immodule if you don't have QT3 or QT4 installed.
If it can't find qt even though it's installed, check your PKG_CONFIG_PATH.
Yes, it can be done - just!
You need to do this:
libiconv (not sure if this is needed)
and for the QT3 immodule:
from /usr/lib to /usr/X11R7/lib
and for the QT3 immodule:
from /usr/X11R7/lib to /usr/lib
libstdc++.la from /usr/lib to /usr/lib/gcc/i486-t2-linux-gnu/3.4.4
(You'll have to create the directory.)
Then it will work.
Same as for Puppy 2.17
QT plugins cannot be "mixed and matched". You can't take a plugin from another compilation, even if it's the same version number, and expect it to work. The safest thing is to make sure that they've been compiled against the specific version of QT that you are going to use. Alternatively, compile the plugins yourself.
If you are installing QT3 or QT4 which has been compiled in another system, the installation location must match, symlinks and all. For example, if QT3 was compiled to /usr/lib/qt3, which was a symlink of /mnt/home/qt-x11-free-3.3.8, you need to set it up that way in the new system. Otherwise, it can't find header files and immodules won't work.