Changeset 779ed51


Ignore:
Timestamp:
08/23/2013 10:54:33 PM (11 years ago)
Author:
Bruce Dubbs <bdubbs@…>
Branches:
10.0, 10.1, 11.0, 11.1, 11.2, 11.3, 12.0, 12.1, 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
Children:
a7eaa89
Parents:
7bb72e0
Message:

Restore alternate install method for Qt4

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • x/lib/qt4.xml

    r7bb72e0 r779ed51  
    4040    </para>
    4141
    42     &lfs73_checked;
     42    &lfs74_checked;
    4343
    4444    <bridgehead renderas="sect3">Package Information</bridgehead>
     
    8080    <bridgehead renderas="sect4">Required</bridgehead>
    8181    <para role="required">
    82       <xref linkend="alsa-lib"/>,
    83       <xref linkend="mesalib"/> and
    84       <xref linkend="qtchooser"/>
     82      <xref linkend="alsa-lib"/> and
     83      <xref linkend="mesalib"/>
    8584    </para>
    8685
     
    9594      <xref linkend="libpng"/>,
    9695      <xref linkend="libtiff"/>,
    97       <xref linkend="openssl"/> and
     96      <xref linkend="openssl"/>, and
    9897      <xref linkend="sqlite"/>
    9998    </para>
     
    106105      <xref linkend="mysql"/>,
    107106      <xref linkend="postgresql"/>,
    108       <xref linkend="pulseaudio"/> and
     107      <xref linkend="pulseaudio"/>,
     108      <xref linkend="qtchooser"/> (if also installing Qt5), and
    109109      <xref linkend="unixodbc"/>
    110110    </para>
     
    118118    <title>Installation of Qt</title>
    119119
    120    <warning>
     120    <para>
     121
     122       There are several ways to install a complicated package such as
     123       <application>Qt</application>. The files are not completely position
     124       independent. Installation procedures execute the program
     125       <command>pkg-config</command> to determine the location of package
     126       executables, libraries, headers, and other files. For
     127       <application>Qt</application>, <command>pkg-config</command> will look
     128       for the appropriate <filename>lib/pkgconfig/Qt*.pc</filename> files
     129       which must be modified if relocating the package. These files are set up
     130       correctly by the build process.
     131    </para>
     132   
     133    <para>
     134       The default installation places the files in <filename
     135       class='directory'>/usr/local/qt/</filename>. Many commercial
     136       distributions place the files in the system's <filename
     137       class='directory'>/usr</filename> hierarchy. The package can also be
     138       installed in an arbitrary directory.
     139    </para>
     140   
     141    <para>
     142       The advantage of installing in <filename
     143       class='directory'>/usr</filename> is that no updates to the
     144       <filename>/etc/ld.so.conf</filename> or
     145       <filename>/etc/man_db.conf</filename> files are required. The package
     146       files are distributed within several subdirectories of the <filename
     147       class='directory'>/usr</filename> hierarchy.  This is the method that
     148       most commercial distributions use.  It is also supported by the
     149       optional <application>qtchooser</application> application.
     150    </para>
     151
     152    <para>
     153       The advantage of installing <application>Qt4</application> in a custom
     154       directory such as <filename
     155       class='directory'>/opt/qt-&qt4-version;</filename> is that it keeps all
     156       the package files consolidated in a dedicated directory hierarchy. By
     157       using this method, an update can be made without overwriting a previous
     158       installation and users can easily revert to a previous version by
     159       changing one symbolic link or merely changing the PATH variable.  It
     160       also allows a developer to maintain multiple versions of
     161       <application>Qt4</application> for testing.
     162    </para>
     163
     164    <warning>
    121165      <para>
    122166        If you did not install some of the recommended dependencies, examine
     
    128172    <caution>
    129173      <para>
    130         If <application>Qt</application> is being reinstalled, run the
     174        If <application>Qt</application> is being reinstalled into the
     175        same directory as an existing instance, run the
    131176        following commands from a console or non-Qt based window manager.
    132177        It overwrites <application>Qt</application> libraries that should
     
    144189    </note>
    145190
     191    <bridgehead renderas="sect3">Method 1: Installing in /usr</bridgehead>
     192
    146193    <para>
    147194      Install <application>Qt</application> by running the
     
    152199     config.tests/unix/libmng/libmng.cpp &amp;&amp;
    153200
    154 ./configure -confirm-license \
    155             -opensource \
    156             -release \
    157             -prefix /usr \
    158             -bindir /usr/lib/qt4/bin \
    159             -headerdir /usr/include/qt4 \
    160             -datadir /usr/share/qt4 \
    161             -plugindir /usr/lib/qt4/plugins \
    162             -importdir /usr/lib/qt4/imports \
     201./configure -prefix         /usr                 \
     202            -bindir         /usr/lib/qt4/bin     \
     203            -plugindir      /usr/lib/qt4/plugins \
     204            -importdir      /usr/lib/qt4/imports \
     205            -headerdir      /usr/include/qt4     \
     206            -datadir        /usr/share/qt4       \
     207            -sysconfdir     /etc/xdg             \
     208            -docdir         /usr/share/doc/qt4   \
     209            -demosdir       /usr/share/doc/qt4/demos    \
     210            -examplesdir    /usr/share/doc/qt4/examples \
    163211            -translationdir /usr/share/qt4/translations \
    164             -sysconfdir /etc/xdg \
    165             -docdir /usr/share/doc/qt4 \
    166             -demosdir /usr/share/doc/qt4/demos \
    167             -examplesdir /usr/share/doc/qt4/examples \
    168             -dbus-linked \
    169             -openssl-linked \
    170             -system-sqlite \
    171             -no-phonon \
     212            -confirm-license   \
     213            -opensource        \
     214            -release           \
     215            -dbus-linked       \
     216            -openssl-linked    \
     217            -system-sqlite     \
     218            -no-phonon         \
    172219            -no-phonon-backend \
    173             -no-nis \
    174             -no-openvg \
    175             -nomake demos \
    176             -nomake examples \
    177             -optimized-qmake &amp;&amp;
     220            -no-nis            \
     221            -no-openvg         \
     222            -nomake demos      \
     223            -nomake examples   \
     224            -optimized-qmake   &amp;&amp;
     225
    178226make</userinput></screen>
    179227
     
    189237rm -rf /usr/tests &amp;&amp;
    190238install -v -Dm644 src/gui/dialogs/images/qtlogo-64.png \
    191                   /usr/share/pixmaps/qt4logo.png &amp;&amp;
     239                  /usr/share/pixmaps/qt4logo.png       &amp;&amp;
    192240install -v -Dm644 tools/assistant/tools/assistant/images/assistant-128.png \
    193241                  /usr/share/pixmaps/assistant-qt4.png &amp;&amp;
    194242install -v -Dm644 tools/designer/src/designer/images/designer.png \
    195                   /usr/share/pixmaps/designer-qt4.png &amp;&amp;
     243                  /usr/share/pixmaps/designer-qt4.png  &amp;&amp;
    196244install -v -Dm644 tools/linguist/linguist/images/icons/linguist-128-32.png \
    197                   /usr/share/pixmaps/linguist-qt4.png &amp;&amp;
     245                  /usr/share/pixmaps/linguist-qt4.png  &amp;&amp;
    198246install -v -Dm644 tools/qdbus/qdbusviewer/images/qdbusviewer-128.png \
    199247                  /usr/share/pixmaps/qdbusviewer-qt4.png</userinput></screen>
     
    227275done</userinput></screen>
    228276
     277    <bridgehead renderas="sect3">Method 2: Installing in /opt/qt-&qt4-version;</bridgehead>
     278
     279    <para>
     280      Install <application>Qt</application> in  /opt/qt-&qt4-version;
     281      by running the following commands:
     282    </para>
     283
     284<screen><userinput>sed -i -e "/#if/d" -e "/#error/d" -e "/#endif/d" \
     285     config.tests/unix/libmng/libmng.cpp &amp;&amp;
     286
     287export QTDIR=/opt/qt-&qt4-version;
     288
     289./configure -prefix $QTDIR       \
     290            -sysconfdir /etc/xdg \
     291            -confirm-license     \
     292            -opensource          \
     293            -release             \
     294            -dbus-linked         \
     295            -openssl-linked      \
     296            -system-sqlite       \
     297            -plugin-sql-sqlite   \
     298            -no-phonon           \
     299            -no-phonon-backend   \
     300            -no-nis              \
     301            -no-openvg           \
     302            -nomake demos        \
     303            -nomake examples     \
     304            -optimized-qmake     &amp;&amp;
     305
     306make</userinput></screen>
     307
     308    <para>
     309      Now, as the <systemitem class="username">root</systemitem> user:
     310    </para>
     311
     312<screen role="root"><userinput>make install                 &amp;&amp;
     313ln -svfn qt-$VERSION /opt/qt &amp;&amp;
     314
     315install -v -Dm644 src/gui/dialogs/images/qtlogo-64.png \
     316                  /usr/share/pixmaps/qt4logo.png       &amp;&amp;
     317install -v -Dm644 tools/assistant/tools/assistant/images/assistant-128.png \
     318                  /usr/share/pixmaps/assistant-qt4.png &amp;&amp;
     319install -v -Dm644 tools/designer/src/designer/images/designer.png \
     320                  /usr/share/pixmaps/designer-qt4.png  &amp;&amp;
     321install -v -Dm644 tools/linguist/linguist/images/icons/linguist-128-32.png \
     322                  /usr/share/pixmaps/linguist-qt4.png  &amp;&amp;
     323install -v -Dm644 tools/qdbus/qdbusviewer/images/qdbusviewer-128.png \
     324                  /usr/share/pixmaps/qdbusviewer-qt4.png</userinput></screen>
     325
     326    <para>
     327      Remove references to the build directory from installed files by
     328      running the following command as the
     329      <systemitem class="username">root</systemitem> user:
     330    </para>
     331
     332<screen role="root"><userinput>for file in 3Support CLucene Core DBus Declarative DesignerComponents \
     333            Designer Gui Help Multimedia Network OpenGL Script \
     334            ScriptTools Sql Svg Test UiTools WebKit XmlPatterns Xml; do
     335  sed -i -e '/^QMAKE_PRL_BUILD_DIR/d;s/\(QMAKE_PRL_LIBS =\).*/\1/' \
     336       $QTDIR/lib/libQt${file}.prl
     337  perl -pi -e "s, -L$PWD/?\S+,,g" $QTDIR/lib/pkgconfig/Qt${file}.pc
     338done
     339
     340unset file</userinput></screen>
     341
    229342  </sect2>
    230343
     
    305418
    306419      <para>
    307         Create an environment variable needed by certain packages.
     420        If you installed <application>Qt</application> in /usr,
     421        create an environment variable needed by certain packages.
    308422        As the <systemitem class="username">root</systemitem> user:
    309423      </para>
     
    319433EOF</userinput></screen>
    320434
     435   <para>
     436      If you installed <application>Qt</application> in a location other
     437      than /usr, you need to update the following configuration files so
     438      that <application>Qt</application> is correctly found by other packages
     439      and system processes.</para>
     440   
     441      <para>As the <systemitem class="username">root</systemitem> user, update
     442      the <filename>/etc/ld.so.conf</filename> file and the dynamic linker's
     443      run-time cache file:
     444   </para>
     445   
     446<screen role="root"><userinput>cat &gt;&gt; /etc/ld.so.conf &lt;&lt; EOF
     447   <literal># Begin Qt addition
     448   
     449/opt/qt/lib
     450   
     451# End Qt addition</literal>
     452EOF
     453
     454ldconfig</userinput></screen>
     455   
     456   <indexterm zone="qt4 qtconfig-qt4">
     457      <primary sortas="e-etc-ld.so.conf">/etc/ld.so.conf</primary>
     458   </indexterm>
     459   
     460   <para>
     461      As the <systemitem class="username">root</systemitem> user, create
     462      the <filename>/etc/profile.d/qt.sh</filename> file:
     463   </para>
     464   
     465<screen role="root"><userinput>cat &gt; /etc/profile.d/qt.sh &lt;&lt; EOF
     466   <literal># Begin /etc/profile.d/qt.sh
     467   
     468QTDIR=/opt/qt
     469   
     470pathappend /opt/qt/bin           PATH
     471pathappend /opt/qt/lib/pkgconfig PKG_CONFIG_PATH
     472   
     473export QTDIR
     474   
     475# End /etc/profile.d/qt.sh</literal>
     476EOF</userinput></screen>
     477
    321478      <para>
    322         Create the menu entries for installed applications.
     479        For all methods, Create the menu entries for installed applications.
    323480        As the <systemitem class="username">root</systemitem> user:
    324481      </para>
    325482
    326483<screen role="root"><userinput>install -dm755 /usr/share/applications
     484
    327485cat &gt; /usr/share/applications/qtconfig-qt4.desktop &lt;&lt; "EOF"
    328486<literal>[Desktop Entry]
     
    336494Categories=Qt;Settings;</literal>
    337495EOF
     496
    338497cat &gt; /usr/share/applications/assistant-qt4.desktop &lt;&lt; "EOF"
    339498<literal>[Desktop Entry]
     
    347506Categories=Qt;Development;Documentation;</literal>
    348507EOF
     508
    349509cat &gt; /usr/share/applications/designer-qt4.desktop &lt;&lt; "EOF"
    350510<literal>[Desktop Entry]
     
    359519Categories=Qt;Development;</literal>
    360520EOF
     521
    361522cat &gt; /usr/share/applications/linguist-qt4.desktop &lt;&lt; "EOF"
    362523<literal>[Desktop Entry]
     
    371532Categories=Qt;Development;</literal>
    372533EOF
     534
    373535cat &gt; /usr/share/applications/qdbusviewer-qt4.desktop &lt;&lt; "EOF"
    374536<literal>[Desktop Entry]
     
    417579          /usr/include/qt4,
    418580          /usr/lib/qt4,
    419           /usr/share/doc/qt4 and
    420           /usr/share/qt4
     581          /usr/share/doc/qt4, and
     582          /usr/share/qt4 (OR $QTDIR)
    421583        </seg>
    422584      </seglistitem>
Note: See TracChangeset for help on using the changeset viewer.