Author: bdubbs
Date: Fri Aug 23 15:54:33 2013
New Revision: 11681
Log:
Restore alternate install method for Qt4
Modified:
trunk/BOOK/x/lib/qt4.xml
Modified: trunk/BOOK/x/lib/qt4.xml
==============================================================================
--- trunk/BOOK/x/lib/qt4.xml Fri Aug 23 13:56:44 2013 (r11680)
+++ trunk/BOOK/x/lib/qt4.xml Fri Aug 23 15:54:33 2013 (r11681)
@@ -39,7 +39,7 @@
of <application>Qt</application> is <application>KDE</application>.
</para>
- &lfs73_checked;
+ &lfs74_checked;
<bridgehead renderas="sect3">Package Information</bridgehead>
<itemizedlist spacing="compact">
@@ -79,9 +79,8 @@
<bridgehead renderas="sect4">Required</bridgehead>
<para role="required">
- <xref linkend="alsa-lib"/>,
- <xref linkend="mesalib"/> and
- <xref linkend="qtchooser"/>
+ <xref linkend="alsa-lib"/> and
+ <xref linkend="mesalib"/>
</para>
<bridgehead renderas="sect4">Recommended</bridgehead>
@@ -94,7 +93,7 @@
<xref linkend="libmng"/>,
<xref linkend="libpng"/>,
<xref linkend="libtiff"/>,
- <xref linkend="openssl"/> and
+ <xref linkend="openssl"/>, and
<xref linkend="sqlite"/>
</para>
@@ -105,7 +104,8 @@
<xref linkend="gst-plugins-base"/> (For QtWebKit HTML5 Video),
<xref linkend="mysql"/>,
<xref linkend="postgresql"/>,
- <xref linkend="pulseaudio"/> and
+ <xref linkend="pulseaudio"/>,
+ <xref linkend="qtchooser"/> (if also installing Qt5), and
<xref linkend="unixodbc"/>
</para>
@@ -117,7 +117,51 @@
<sect2 role="installation">
<title>Installation of Qt</title>
- <warning>
+ <para>
+
+ There are several ways to install a complicated package such as
+ <application>Qt</application>. The files are not completely position
+ independent. Installation procedures execute the program
+ <command>pkg-config</command> to determine the location of package
+ executables, libraries, headers, and other files. For
+ <application>Qt</application>, <command>pkg-config</command> will look
+ for the appropriate <filename>lib/pkgconfig/Qt*.pc</filename> files
+ which must be modified if relocating the package. These files are set up
+ correctly by the build process.
+ </para>
+
+ <para>
+ The default installation places the files in <filename
+ class='directory'>/usr/local/qt/</filename>. Many commercial
+ distributions place the files in the system's <filename
+ class='directory'>/usr</filename> hierarchy. The package can also be
+ installed in an arbitrary directory.
+ </para>
+
+ <para>
+ The advantage of installing in <filename
+ class='directory'>/usr</filename> is that no updates to the
+ <filename>/etc/ld.so.conf</filename> or
+ <filename>/etc/man_db.conf</filename> files are required. The package
+ files are distributed within several subdirectories of the <filename
+ class='directory'>/usr</filename> hierarchy. This is the method that
+ most commercial distributions use. It is also supported by the
+ optional <application>qtchooser</application> application.
+ </para>
+
+ <para>
+ The advantage of installing <application>Qt4</application> in a custom
+ directory such as <filename
+ class='directory'>/opt/qt-&qt4-version;</filename> is that it keeps all
+ the package files consolidated in a dedicated directory hierarchy. By
+ using this method, an update can be made without overwriting a previous
+ installation and users can easily revert to a previous version by
+ changing one symbolic link or merely changing the PATH variable. It
+ also allows a developer to maintain multiple versions of
+ <application>Qt4</application> for testing.
+ </para>
+
+ <warning>
<para>
If you did not install some of the recommended dependencies, examine
<command>./configure --help</command> output to check how to disable
@@ -127,7 +171,8 @@
<caution>
<para>
- If <application>Qt</application> is being reinstalled, run the
+ If <application>Qt</application> is being reinstalled into the
+ same directory as an existing instance, run the
following commands from a console or non-Qt based window manager.
It overwrites <application>Qt</application> libraries that should
not be in use during the install process.
@@ -143,6 +188,8 @@
</para>
</note>
+ <bridgehead renderas="sect3">Method 1: Installing in /usr</bridgehead>
+
<para>
Install <application>Qt</application> by running the
following commands:
@@ -151,30 +198,31 @@
<screen><userinput>sed -i -e "/#if/d" -e "/#error/d" -e "/#endif/d" \
config.tests/unix/libmng/libmng.cpp &&
-./configure -confirm-license \
- -opensource \
- -release \
- -prefix /usr \
- -bindir /usr/lib/qt4/bin \
- -headerdir /usr/include/qt4 \
- -datadir /usr/share/qt4 \
- -plugindir /usr/lib/qt4/plugins \
- -importdir /usr/lib/qt4/imports \
+./configure -prefix /usr \
+ -bindir /usr/lib/qt4/bin \
+ -plugindir /usr/lib/qt4/plugins \
+ -importdir /usr/lib/qt4/imports \
+ -headerdir /usr/include/qt4 \
+ -datadir /usr/share/qt4 \
+ -sysconfdir /etc/xdg \
+ -docdir /usr/share/doc/qt4 \
+ -demosdir /usr/share/doc/qt4/demos \
+ -examplesdir /usr/share/doc/qt4/examples \
-translationdir /usr/share/qt4/translations \
- -sysconfdir /etc/xdg \
- -docdir /usr/share/doc/qt4 \
- -demosdir /usr/share/doc/qt4/demos \
- -examplesdir /usr/share/doc/qt4/examples \
- -dbus-linked \
- -openssl-linked \
- -system-sqlite \
- -no-phonon \
+ -confirm-license \
+ -opensource \
+ -release \
+ -dbus-linked \
+ -openssl-linked \
+ -system-sqlite \
+ -no-phonon \
-no-phonon-backend \
- -no-nis \
- -no-openvg \
- -nomake demos \
- -nomake examples \
- -optimized-qmake &&
+ -no-nis \
+ -no-openvg \
+ -nomake demos \
+ -nomake examples \
+ -optimized-qmake &&
+
make</userinput></screen>
<para>
@@ -188,13 +236,13 @@
<screen role="root"><userinput>make install &&
rm -rf /usr/tests &&
install -v -Dm644 src/gui/dialogs/images/qtlogo-64.png \
- /usr/share/pixmaps/qt4logo.png &&
+ /usr/share/pixmaps/qt4logo.png &&
install -v -Dm644 tools/assistant/tools/assistant/images/assistant-128.png \
/usr/share/pixmaps/assistant-qt4.png &&
install -v -Dm644 tools/designer/src/designer/images/designer.png \
- /usr/share/pixmaps/designer-qt4.png &&
+ /usr/share/pixmaps/designer-qt4.png &&
install -v -Dm644 tools/linguist/linguist/images/icons/linguist-128-32.png \
- /usr/share/pixmaps/linguist-qt4.png &&
+ /usr/share/pixmaps/linguist-qt4.png &&
install -v -Dm644 tools/qdbus/qdbusviewer/images/qdbusviewer-128.png \
/usr/share/pixmaps/qdbusviewer-qt4.png</userinput></screen>
@@ -226,6 +274,71 @@
ln -sfv ../lib/qt4/bin/$(basename $file) /usr/bin/$(basename $file)-qt4
done</userinput></screen>
+ <bridgehead renderas="sect3">Method 2: Installing in
/opt/qt-&qt4-version;</bridgehead>
+
+ <para>
+ Install <application>Qt</application> in /opt/qt-&qt4-version;
+ by running the following commands:
+ </para>
+
+<screen><userinput>sed -i -e "/#if/d" -e "/#error/d" -e "/#endif/d" \
+ config.tests/unix/libmng/libmng.cpp &&
+
+export QTDIR=/opt/qt-&qt4-version;
+
+./configure -prefix $QTDIR \
+ -sysconfdir /etc/xdg \
+ -confirm-license \
+ -opensource \
+ -release \
+ -dbus-linked \
+ -openssl-linked \
+ -system-sqlite \
+ -plugin-sql-sqlite \
+ -no-phonon \
+ -no-phonon-backend \
+ -no-nis \
+ -no-openvg \
+ -nomake demos \
+ -nomake examples \
+ -optimized-qmake &&
+
+make</userinput></screen>
+
+ <para>
+ Now, as the <systemitem class="username">root</systemitem> user:
+ </para>
+
+<screen role="root"><userinput>make install &&
+ln -svfn qt-$VERSION /opt/qt &&
+
+install -v -Dm644 src/gui/dialogs/images/qtlogo-64.png \
+ /usr/share/pixmaps/qt4logo.png &&
+install -v -Dm644 tools/assistant/tools/assistant/images/assistant-128.png \
+ /usr/share/pixmaps/assistant-qt4.png &&
+install -v -Dm644 tools/designer/src/designer/images/designer.png \
+ /usr/share/pixmaps/designer-qt4.png &&
+install -v -Dm644 tools/linguist/linguist/images/icons/linguist-128-32.png \
+ /usr/share/pixmaps/linguist-qt4.png &&
+install -v -Dm644 tools/qdbus/qdbusviewer/images/qdbusviewer-128.png \
+ /usr/share/pixmaps/qdbusviewer-qt4.png</userinput></screen>
+
+ <para>
+ Remove references to the build directory from installed files by
+ running the following command as the
+ <systemitem class="username">root</systemitem> user:
+ </para>
+
+<screen role="root"><userinput>for file in 3Support CLucene Core DBus
Declarative DesignerComponents \
+ Designer Gui Help Multimedia Network OpenGL Script \
+ ScriptTools Sql Svg Test UiTools WebKit XmlPatterns Xml; do
+ sed -i -e '/^QMAKE_PRL_BUILD_DIR/d;s/\(QMAKE_PRL_LIBS =\).*/\1/' \
+ $QTDIR/lib/libQt${file}.prl
+ perl -pi -e "s, -L$PWD/?\S+,,g" $QTDIR/lib/pkgconfig/Qt${file}.pc
+done
+
+unset file</userinput></screen>
+
</sect2>
<sect2 role="commands">
@@ -304,7 +417,8 @@
<title>Configuration Information</title>
<para>
- Create an environment variable needed by certain packages.
+ If you installed <application>Qt</application> in /usr,
+ create an environment variable needed by certain packages.
As the <systemitem class="username">root</systemitem> user:
</para>
@@ -318,12 +432,56 @@
# End /etc/profile.d/qt.sh</literal>
EOF</userinput></screen>
+ <para>
+ If you installed <application>Qt</application> in a location other
+ than /usr, you need to update the following configuration files so
+ that <application>Qt</application> is correctly found by other packages
+ and system processes.</para>
+
+ <para>As the <systemitem class="username">root</systemitem> user, update
+ the <filename>/etc/ld.so.conf</filename> file and the dynamic linker's
+ run-time cache file:
+ </para>
+
+<screen role="root"><userinput>cat >> /etc/ld.so.conf << EOF
+ <literal># Begin Qt addition
+
+/opt/qt/lib
+
+# End Qt addition</literal>
+EOF
+
+ldconfig</userinput></screen>
+
+ <indexterm zone="qt4 qtconfig-qt4">
+ <primary sortas="e-etc-ld.so.conf">/etc/ld.so.conf</primary>
+ </indexterm>
+
+ <para>
+ As the <systemitem class="username">root</systemitem> user, create
+ the <filename>/etc/profile.d/qt.sh</filename> file:
+ </para>
+
+<screen role="root"><userinput>cat > /etc/profile.d/qt.sh << EOF
+ <literal># Begin /etc/profile.d/qt.sh
+
+QTDIR=/opt/qt
+
+pathappend /opt/qt/bin PATH
+pathappend /opt/qt/lib/pkgconfig PKG_CONFIG_PATH
+
+export QTDIR
+
+# End /etc/profile.d/qt.sh</literal>
+EOF</userinput></screen>
+
<para>
- Create the menu entries for installed applications.
+ For all methods, Create the menu entries for installed applications.
As the <systemitem class="username">root</systemitem> user:
</para>
<screen role="root"><userinput>install -dm755 /usr/share/applications
+
cat > /usr/share/applications/qtconfig-qt4.desktop << "EOF"
<literal>[Desktop Entry]
Name=Qt4 Config
@@ -335,6 +493,7 @@
Type=Application
Categories=Qt;Settings;</literal>
EOF
+
cat > /usr/share/applications/assistant-qt4.desktop << "EOF"
<literal>[Desktop Entry]
Name=Qt4 Assistant
@@ -346,6 +505,7 @@
Type=Application
Categories=Qt;Development;Documentation;</literal>
EOF
+
cat > /usr/share/applications/designer-qt4.desktop << "EOF"
<literal>[Desktop Entry]
Name=Qt4 Designer
@@ -358,6 +518,7 @@
Type=Application
Categories=Qt;Development;</literal>
EOF
+
cat > /usr/share/applications/linguist-qt4.desktop << "EOF"
<literal>[Desktop Entry]
Name=Qt4 Linguist
@@ -370,6 +531,7 @@
Type=Application
Categories=Qt;Development;</literal>
EOF
+
cat > /usr/share/applications/qdbusviewer-qt4.desktop << "EOF"
<literal>[Desktop Entry]
Name=Qt4 QDbusViewer
@@ -416,8 +578,8 @@
<seg>
/usr/include/qt4,
/usr/lib/qt4,
- /usr/share/doc/qt4 and
- /usr/share/qt4
+ /usr/share/doc/qt4, and
+ /usr/share/qt4 (OR $QTDIR)
</seg>
</seglistitem>
</segmentedlist>
--
http://linuxfromscratch.org/mailman/listinfo/blfs-book
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page