source: x/lib/qt.xml@ 39373956

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 6.0 6.1 6.2 6.2.0 6.2.0-rc1 6.2.0-rc2 6.3 6.3-rc1 6.3-rc2 6.3-rc3 7.10 7.4 7.5 7.6 7.6-blfs 7.6-systemd 7.7 7.8 7.9 8.0 8.1 8.2 8.3 8.4 9.0 9.1 basic bdubbs/svn elogind gnome kde5-13430 kde5-14269 kde5-14686 kea ken/TL2024 ken/inkscape-core-mods ken/tuningfonts krejzi/svn lazarus lxqt nosym perl-modules plabs/newcss plabs/python-mods python3.11 qt5new rahul/power-profiles-daemon renodr/vulkan-addition systemd-11177 systemd-13485 trunk upgradedb xry111/intltool xry111/llvm18 xry111/soup3 xry111/test-20220226 xry111/xf86-video-removal
Last change on this file since 39373956 was 39373956, checked in by Randy McMurchy <randy@…>, 20 years ago

replaced non-breaking spaces with regular spaces

git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@2338 af4574ff-66df-0310-9fd7-8a98e5e911e0

  • Property mode set to 100644
File size: 10.3 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
3 "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
4 <!ENTITY % general-entities SYSTEM "../../general.ent">
5 %general-entities;
6
7 <!ENTITY qt-download-http "http://sunsite.rediris.es/mirror/Qt/source/qt-x11-free-&qt-version;.tar.bz2">
8 <!ENTITY qt-download-ftp "ftp://ftp.trolltech.com/qt/source/qt-x11-free-&qt-version;.tar.bz2">
9 <!ENTITY qt-md5sum "903cad618274ad84d7d13fd0027a6c3c">
10 <!ENTITY qt-size "14 MB">
11 <!ENTITY qt-buildsize "165 MB">
12 <!ENTITY qt-time "21.2 SBU (full), 13.4 SBU (sub-tools)">
13]>
14
15<sect1 id="qt" xreflabel="Qt-&qt-version;">
16<?dbhtml filename="qt.html" ?>
17<title>Qt-&qt-version;</title>
18
19<sect2>
20<title>Introduction to <application>Qt</application></title>
21
22<para>The <application>Qt</application> package contains a
23<application>C++</application> <acronym>GUI</acronym> library. This is useful
24for creating graphical applications or executing graphical applications that
25are dynamically linked to the <application>Qt</application> library. One of the
26major users of <application>Qt</application> is <application>KDE</application>.</para>
27
28<sect3><title>Package information</title>
29<itemizedlist spacing='compact'>
30<listitem><para>Download (HTTP): <ulink url="&qt-download-http;"/></para></listitem>
31<listitem><para>Download (FTP): <ulink url="&qt-download-ftp;"/></para></listitem>
32<listitem><para>MD5 Sum: &qt-md5sum;</para></listitem>
33<listitem><para>Download size: &qt-size;</para></listitem>
34<listitem><para>Estimated Disk space required: &qt-buildsize;</para></listitem>
35<listitem><para>Estimated build time: &qt-time;</para></listitem></itemizedlist>
36</sect3>
37
38<sect3><title><application>Qt</application> dependencies</title>
39<sect4><title>Required</title>
40<para><xref linkend="x-installing"/></para>
41</sect4>
42<sect4><title>Recommended</title>
43<para><xref linkend="libjpeg"/> and <xref linkend="libmng"/>.</para>
44</sect4>
45
46<sect4><title>Optional</title>
47<para><xref linkend="nas"/>, <xref linkend="cups"/>, <xref linkend="mysql"/>,
48<xref linkend="postgresql"/>, <ulink url="http://firebird.sourceforge.net/">Firebird</ulink>,
49and <ulink url="http://www.unixodbc.org/">unixODBC</ulink>.</para>
50</sect4>
51</sect3>
52</sect2>
53
54<sect2>
55<title>Installation of <application>Qt</application></title>
56
57<para>There are several ways to install a complicated package such as <application>Qt</application>.
58The files are not completely position independent. Installation procedures execute the
59program <filename>pkg-config</filename> to determine the location of package executables, libraries,
60headers, and other files. For <application>Qt</application>, <filename>pkg-config</filename> will
61look for the file <filename>lib/pkgconfig/qt-mt.pc</filename> which must be modified if relocating the
62package. This file is set up correctly by the build process.</para>
63
64<para>The default installation places the files in <filename class='directory'>/usr/local/qt/</filename>.
65Many commercial distributions place the files in the system's
66<filename class='directory'>/usr</filename> hierarchy. The package can also be installed
67in an arbitrary directory.</para>
68
69<para>This section will demonstrate two different methods.</para>
70
71
72<note><para>The build time for <application>Qt</application> is quite long. If you want to
73save some time and don't want the tutorials and examples, change the first make line to:</para>
74
75<para><userinput><command>make sub-tools</command></userinput></para>
76</note>
77
78<sect3>
79<title>Method 1 - Installing in the <filename class='directory'>/usr</filename> hierarchy</title>
80
81<para>The advantage of this method is that no updates to the <filename>/etc/ld.so.conf</filename>
82or <filename>/etc/man.conf</filename> files are required. The package files
83are distributed within several subdirectories of the <filename class='directory'>/usr</filename>
84hierarchy. This is the method that most commercial distributions use.</para>
85
86
87<screen><userinput><command>sed -i "s:cp -f:install:" mkspecs/linux-g++/qmake.conf &amp;&amp;
88bash
89export PATH=$PWD/bin:$PATH &amp;&amp;
90export LD_LIBRARY_PATH=$PWD/lib:$LD_LIBRARY_PATH &amp;&amp;
91./configure -prefix /usr -docdir /usr/share/doc/qt \
92 -headerdir /usr/include/qt -plugindir /usr/lib/qt/plugins \
93 -datadir /usr/share/qt -translationdir /usr/share/qt/translations \
94 -sysconfdir /etc/qt -qt-gif -system-zlib \
95 -no-exceptions -thread -plugin-imgfmt-png -system-libpng &amp;&amp;
96find -type f -name Makefile | xargs sed -i "s@-Wl,-rpath,/usr/lib@@g" &amp;&amp;
97make &amp;&amp;
98make install &amp;&amp;
99ln -sf libqt-mt.so /usr/lib/libqt.so &amp;&amp;
100cp -r doc/man /usr/share &amp;&amp;
101cp -r examples /usr/share/doc/qt &amp;&amp;
102exit</command></userinput></screen>
103
104</sect3>
105
106<sect3>
107<title>Method 2 - Installing in <filename class='directory'>/opt</filename></title>
108
109<para>This is the method recommended by the <application>Qt</application> developers. It
110has the advantage of keeping all the package files consolidated in a dedicated directory
111hierarchy. By using this method, an update can be made without overwriting a previous
112installation and users can easily revert to a previous version by changing one symbolic
113link.</para>
114
115<para>The <application>Qt</application> developers use a default location of
116<filename class='directory'>/usr/local/qt/</filename>, however this procedure puts the files
117in <filename class='directory'>/opt/qt-&qt-version;/</filename> and then creates a
118symbolic link to <filename>/opt/qt/</filename>.</para>
119
120
121<screen><userinput><command>bash
122export QTDIR=$PWD &amp;&amp;
123export LD_LIBRARY_PATH=$PWD/lib:$LD_LIBRARY_PATH &amp;&amp;
124export PATH=$PWD/bin:$PATH &amp;&amp;
125./configure -prefix /opt/qt-&qt-version; -qt-gif -system-libpng \
126 -system-libmng -system-zlib -system-libjpeg -no-exceptions \
127 -thread -plugin-imgfmt-png &amp;&amp;
128make &amp;&amp;
129make install &amp;&amp;
130ln -sfn qt-&qt-version; /opt/qt &amp;&amp;
131ln -s libqt-mt.so /opt/qt/lib/libqt.so &amp;&amp;
132cp -r doc/man /opt/qt/doc &amp;&amp;
133cp -r examples /opt/qt/doc
134exit</command></userinput></screen>
135
136<sect4>
137<title>Configuration</title>
138
139<para>For Method 2 only, update the <filename>/etc/ld.so.conf</filename> and
140<filename>/etc/man.conf</filename> files.</para>
141
142
143<screen><userinput><command>cat &gt;&gt; /etc/ld.so.conf &lt;&lt; "EOF"
144# Begin qt addition to /etc/ld.so.conf
145
146/opt/qt/lib
147
148# End qt addition
149EOF
150ldconfig
151
152cat &gt;&gt; /etc/man.conf &lt;&lt; "EOF"
153# Begin qt addition to man.conf
154
155MANPATH /opt/qt/doc/man
156
157# End qt addition to man.conf
158EOF</command></userinput></screen>
159
160<para>Also, the <envar>QTDIR</envar> environment variable needs to be set when
161building packages that depend on Qt. Add the following to the
162<filename>.bash_profile</filename> initialization script for each user that
163builds packages using the <application>Qt</application> libraries.
164Alternatively, the variable can be set in the system wide
165<filename>/etc/profile</filename> file.</para>
166
167<screen><userinput>export QTDIR=/opt/qt</userinput></screen>
168
169</sect4>
170</sect3>
171</sect2>
172
173<sect2>
174<title>Command explanations</title>
175
176<para><command>sed -i "s:cp -f:install:" mkspecs/linux-g++/qmake.conf</command>:
177<command>install</command> is safer than <command>cp</command> when
178libraries are in use.</para>
179
180<para><command>bash</command>: This command enters a sub-shell to isolate
181environment changes.</para>
182
183<para><command>export QTDIR=$PWD</command>: This command
184defines where the root of the Qt directory is located.</para>
185
186<para><command>export LD_LIBRARY_PATH=$PWD/lib:$LD_LIBRARY_PATH</command>: This command
187allows the not yet installed qt libraries to be used by the not yet installed qt programs.</para>
188
189<para><command>export PATH=$PWD/bin:$PATH</command>: This command
190allows the build process to find supporting executables.</para>
191
192<para><parameter>-qt-gif</parameter>: This switch adds support for gif
193files to the libraries.</para>
194
195<para><parameter>-system-zlib -system-libpng</parameter>: This switch
196forces the build instructions to use the shared libraries that are on your system
197instead of creating a custom set of support libraries for these
198functions.</para>
199
200<para><parameter>-no-exceptions</parameter>: This switch disables
201the exceptions coding generated by the <application>C++</application> compiler.</para>
202
203<para><parameter>-thread</parameter>: This switch adds
204support for multi-threading.</para>
205
206<para><command>find -type f -name Makefile | xargs sed -i
207"s@-Wl,-rpath,/usr/lib@@g"</command>: This command removes hardcoded run-time
208paths. Otherwise, <command>uic</command> always tries to run with Qt libraries
209in <filename>/usr/lib</filename>.</para>
210
211<para><command>ln -s libqt-mt.so /usr/lib/libqt.so</command>: This
212command allows configure scripts
213to find a working <application>Qt</application> installation.</para>
214
215<para><command>cp -r doc/man /usr/share (or /opt/qt/doc)</command>: This command
216installs the man pages which are missed by <command>make install</command>.</para>
217
218<para><command>cp -r examples /usr/share/doc/qt (or /opt/qt/doc)</command>: This command
219installs the examples which are missed by <command>make install</command>.</para>
220
221<para><command>exit</command>: This command returns to the parent shell
222and eliminates environment variables set earlier.</para>
223
224</sect2>
225<sect2>
226<title>Configuring <application>Qt</application></title>
227
228<sect3><title>Configuration Information</title>
229
230<para>As with most libraries, there is no explicit configuration to do. After
231updating <filename>/etc/ld.so.conf</filename> as explained above, run
232<command>/sbin/ldconfig</command> so that <command>ldd</command> can find the
233shared libraries.</para>
234
235</sect3>
236
237</sect2>
238<sect2>
239<title>Contents</title>
240
241<para>The <application>Qt</application>/<application>X11</application>
242library contains <acronym>API</acronym>s necessary to use
243programs based on the Qt <acronym>GUI</acronym> toolkit.</para>
244
245<para>The <application>Qt</application> package contains
246<command>assistant</command>,
247<command>designer</command>,
248<command>linguist</command>,
249<command>lrelease</command>,
250<command>lupdate</command>,
251<command>moc</command>,
252<command>qm2ts</command>,
253<command>qmake</command>,
254<command>qtconfig</command>,
255<command>uic</command>, and the
256<filename class="libraryfile">libqt-mt</filename> and
257<filename class="libraryfile">libqui</filename> libraries.</para>
258
259</sect2>
260</sect1>
Note: See TracBrowser for help on using the repository browser.