Changeset 0dd2bc6


Ignore:
Timestamp:
06/19/2015 07:25:49 PM (9 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.8, 7.9, 8.0, 8.1, 8.2, 8.3, 8.4, 9.0, 9.1, basic, bdubbs/svn, elogind, kea, ken/TL2024, ken/inkscape-core-mods, ken/tuningfonts, lazarus, lxqt, nosym, perl-modules, plabs/newcss, plabs/python-mods, python3.11, qt5new, rahul/power-profiles-daemon, renodr/vulkan-addition, trunk, upgradedb, xry111/intltool, xry111/llvm18, xry111/soup3, xry111/test-20220226, xry111/xf86-video-removal
Children:
06da9a6
Parents:
a5a776af
Message:

Simplify qt4 and qt5 install instructions.

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

Files:
4 edited

Legend:

Unmodified
Added
Removed
  • introduction/welcome/changelog.xml

    ra5a776af r0dd2bc6  
    4848      <para>June 19th, 2015</para>
    4949      <itemizedlist>
     50        <listitem>
     51          <para>[bdubbs] - Simplify qt4 and qt5 install instructions.</para>
     52        </listitem>
    5053        <listitem>
    5154          <para>[fernando] - Update to mariadb-10.0.20.  Fixes
  • x/lib/qt4.xml

    ra5a776af r0dd2bc6  
    117117  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="../../xincludes/qt-alternatives.xml"/>
    118118
     119  <sect2 role="qt4-prefix">
     120    <title>Setting the installation prefix</title>
     121
     122    <bridgehead renderas="sect3">Installing in /usr</bridgehead>
     123
     124    <para>
     125      If you want to install <application>Qt4</application>
     126      in <filename class="directory">/usr</filename>, set the
     127      following environment variable:
     128    </para>
     129
     130<screen><userinput>export QT4PREFIX=/usr</userinput></screen>
     131
     132    <bridgehead renderas="sect3">Installing in /opt/qt4</bridgehead>
     133
     134    <para>
     135      If you want to install <application>Qt4</application>
     136      in a directory other than <filename
     137      class="directory">/usr</filename>, ie
     138      <filename class="directory">/opt/qt4</filename>, set
     139      the following environment variable:
     140    </para>
     141
     142<screen><userinput>export QT4PREFIX=/opt/qt4</userinput></screen>
     143
     144    <tip>
     145      <para>
     146        Sometimes, the installation paths are hardcoded into installed files.
     147        This is the reason why <filename class="directory">/opt/qt4</filename>
     148        is used as installation prefix instead of <filename
     149        class="directory">/opt/qt-&qt4-version;</filename>. To create a
     150        versioned  <application>Qt4</application> directory, you may rename
     151        the directory and create a symlink:
     152      </para>
     153
     154<screen role="root"><userinput>mkdir /opt/qt-&qt4-version;
     155ln -sfnv qt-&qt4-version; /opt/qt4</userinput></screen>
     156
     157      <para>
     158        Later on, you may want to install other versions of
     159        <application>Qt4</application>. To do that, just remove the symlink
     160        and use <filename class="directory">/opt/qt4</filename> as the
     161        prefix again. Which version of <application>Qt4</application> you
     162        use depends only on where the symlink points.
     163      </para>
     164    </tip>
     165
     166  </sect2>
     167
    119168  <sect2 role="installation">
    120169    <title>Installation of Qt</title>
     
    148197    </note>
    149198
    150 <!-- ==== Method 1 ====== -->
    151     <bridgehead renderas="sect3">Method 1: Installing in /usr</bridgehead>
    152 
    153199    <para>
    154200      Install <application>Qt4</application> into the <filename
     
    157203    </para>
    158204
    159 <screen><userinput>export QT4LINK=/usr
    160 
    161 ./configure -prefix         /usr                 \
    162             -bindir         /usr/bin             \
    163             -plugindir      /usr/lib/qt4/plugins \
    164             -importdir      /usr/lib/qt4/imports \
    165             -headerdir      /usr/include/qt4     \
    166             -datadir        /usr/share/qt4       \
    167             -sysconfdir     /etc/xdg             \
    168             -docdir         /usr/share/doc/qt4   \
    169             -demosdir       /usr/share/doc/qt4/demos    \
    170             -examplesdir    /usr/share/doc/qt4/examples \
    171             -translationdir /usr/share/qt4/translations \
     205<screen><userinput>./configure -prefix         $QT4PREFIX                        \
     206            -sysconfdir     /etc/xdg                          \
     207            -bindir         $QT4BINDIR                        \
     208            -plugindir      $QT4PREFIX/lib/qt4/plugins        \
     209            -importdir      $QT4PREFIX/lib/qt4/imports        \
     210            -headerdir      $QT4PREFIX/include/qt4            \
     211            -datadir        $QT4PREFIX/share/qt4              \
     212            -docdir         $QT4PREFIX/share/doc/qt4          \
     213            -translationdir $QT4PREFIX/share/qt4/translations \
     214            -demosdir       $QT4PREFIX/share/doc/qt4/demos    \
     215            -examplesdir    $QT4PREFIX/share/doc/qt4/examples \
    172216            -confirm-license   \
    173217            -opensource        \
     
    178222            -no-phonon         \
    179223            -no-phonon-backend \
    180             -no-nis            \
    181224            -no-openvg         \
    182225            -nomake demos      \
     
    219262unset file</userinput></screen>
    220263
    221 <!-- ==== Method 2 ====== -->
    222     <bridgehead renderas="sect3">Method 2: Installing in /opt/qt-&qt4-version;</bridgehead>
    223 
    224     <para>
    225       This section provides for installing Qt4 almost all of the files in the
    226       <filename class="directory">/opt</filename> directory.
    227     </para>
    228 
    229 <screen><userinput>export QT4DIR=/opt/qt-&qt4-version; &amp;&amp;
    230 export QT4LINK=/opt/qt4 &amp;&amp;
    231 
    232 ./configure -prefix     $QT4DIR  \
    233             -sysconfdir /etc/xdg \
    234             -confirm-license     \
    235             -opensource          \
    236             -release             \
    237             -dbus-linked         \
    238             -openssl-linked      \
    239             -system-sqlite       \
    240             -plugin-sql-sqlite   \
    241             -no-phonon           \
    242             -no-phonon-backend   \
    243             -no-nis              \
    244             -no-openvg           \
    245             -nomake demos        \
    246             -nomake examples     \
    247             -optimized-qmake     &amp;&amp;
    248 
    249 make</userinput></screen>
    250 
    251     <para>
    252       Now, as the <systemitem class="username">root</systemitem> user:
    253     </para>
    254 
    255 <screen role="root"><userinput>make install
    256 ln -svfn $QT4DIR /opt/qt4</userinput></screen>
    257 
    258     <para>
    259       Remove references to the build directory from installed files by
    260       running the following command as the
    261       <systemitem class="username">root</systemitem> user:
    262     </para>
    263 
    264 <screen role="root"><userinput>for file in `basename -a -s .prl $QT4DIR/lib/lib*.prl`; do
    265        sed -r -e '/^QMAKE_PRL_BUILD_DIR/d'    \
    266               -e 's/(QMAKE_PRL_LIBS =).*/\1/' \
    267               -i $QT4DIR/lib/${file}.prl
    268 
    269    perl -pi -e "s, -L$PWD/?\S+,,g" $QT4DIR/lib/pkgconfig/${file##lib}.pc
    270 done
    271 
    272 unset file</userinput></screen>
    273 
    274 <!-- ==== Common  ====== -->
    275     <bridgehead renderas="sect3">Continuing for Both Methods</bridgehead>
    276 
    277       <para>
    278         For all methods, install images and create the menu entries
    279         for installed applications.  Be sure that the <envar>QT4LINK</envar>
    280         variable is defined in root's environment and
    281         as the <systemitem class="username">root</systemitem> user:
    282       </para>
     264    <para>
     265      Install images and create the menu entries
     266      for installed applications.  Be sure that the <envar>QT4PREFIX</envar>
     267      variable is defined in root's environment and
     268      as the <systemitem class="username">root</systemitem> user:
     269    </para>
    283270
    284271<screen role="root"><userinput>install -v -Dm644 src/gui/dialogs/images/qtlogo-64.png \
     
    303290Name=Qt4 Assistant
    304291Comment=Shows Qt4 documentation and examples
    305 Exec=$QT4LINK/bin/assistant
     292Exec=$QT4PREFIX/bin/assistant
    306293Icon=assistant-qt4.png
    307294Terminal=false
     
    315302Name=Qt4 Designer
    316303Comment=Design GUIs for Qt4 applications
    317 Exec=$QT4LINK/bin/designer
     304Exec=$QT4PREFIX/bin/designer
    318305Icon=designer-qt4.png
    319306MimeType=application/x-designer;
     
    328315Name=Qt4 Linguist
    329316Comment=Add translations to Qt4 applications
    330 Exec=$QT4LINK/bin/linguist
     317Exec=$QT4PREFIX/bin/linguist
    331318Icon=linguist-qt4.png
    332319MimeType=text/vnd.trolltech.linguist;application/x-linguist;
     
    342329GenericName=D-Bus Debugger
    343330Comment=Debug D-Bus applications
    344 Exec=$QT4LINK/bin/qdbusviewer
     331Exec=$QT4PREFIX/bin/qdbusviewer
    345332Icon=qdbusviewer-qt4.png
    346333Terminal=false
     
    354341Name=Qt4 Config
    355342Comment=Configure Qt4 behavior, styles, fonts
    356 Exec=$QT4LINK/bin/qtconfig
     343Exec=$QT4PREFIX/bin/qtconfig
    357344Icon=qt4logo.png
    358345Terminal=false
  • x/lib/qt5.xml

    ra5a776af r0dd2bc6  
    136136               href="../../xincludes/qt-alternatives.xml"/>
    137137
     138  <sect2 role="qt5-prefix">
     139    <title>Setting the installation prefix</title>
     140
     141    <bridgehead renderas="sect3">Installing in /usr</bridgehead>
     142
     143    <para>
     144      If you want to install <application>Qt5</application>
     145      in <filename class="directory">/usr</filename>, set the
     146      following environment variable:
     147    </para>
     148
     149<screen><userinput>export QT5PREFIX=/usr</userinput></screen>
     150
     151    <bridgehead renderas="sect3">Installing in /opt/qt5</bridgehead>
     152
     153    <para>
     154      If you want to install <application>Qt5</application> in a directory
     155      other than <filename class="directory">/usr</filename>, ie <filename
     156      class="directory">/opt/qt4</filename>, set the following environment
     157      variable:
     158    </para>
     159
     160<screen><userinput>export QT5PREFIX=/opt/qt5</userinput></screen>
     161
     162    <tip>
     163      <para>
     164        Sometimes, the installation paths are hardcoded into installed files.
     165        This is the reason why <filename class="directory">/opt/qt5</filename>
     166        is used as installation prefix instead of <filename
     167        class="directory">/opt/qt-&qt5-version;</filename>. To create a
     168        versioned  <application>Qt5</application> directory, you may rename
     169        the directory and create a symlink:
     170      </para>
     171
     172<screen role="root"><userinput>mkdir /opt/qt-&qt5-version;
     173ln -sfnv qt-&qt5-version; /opt/qt5</userinput></screen>
     174
     175      <para>
     176        Later on, you may want to install other versions of
     177        <application>Qt4</application>. To do that, just remove the symlink
     178        and use <filename class="directory">/opt/qt5</filename> as the
     179        prefix again. Which version of <application>Qt5</application> you
     180        use depends only on where the symlink points.
     181      </para>
     182    </tip>
     183
     184  </sect2>
     185
    138186  <sect2 role="installation">
    139187    <title>Installation of Qt5</title>
     
    158206    </warning>
    159207
    160 <!-- ==== Method 1 ====== -->
    161     <bridgehead renderas="sect3">Method 1: Installing in /usr</bridgehead>
    162 
    163208    <para>
    164209      Install <application>Qt5</application> by running the
     
    166211    </para>
    167212
    168     <!-- This is rather a bad idea. Most apps that I've seen using Qt5 look for
    169          -qt5 suffixed programs.  On the other hand, the developer is used to
    170          running qmake, linguist, etc from the command line.
    171 
    172     <note>
    173       <para>
    174         If <emphasis>not</emphasis> also installing <application>Qt4</application>
    175         into the /usr directory, change the entry for -bindir below to /usr/bin.
    176       </para>
    177     </note> -->
    178 
    179 <screen><userinput>export QT5LINK=/usr
    180 
    181 ./configure -prefix         /usr               \
    182             -sysconfdir     /etc/xdg           \
    183             -bindir         /usr/bin           \
    184             -headerdir      /usr/include/qt5   \
    185             -archdatadir    /usr/lib/qt5       \
    186             -datadir        /usr/share/qt5     \
    187             -docdir         /usr/share/doc/qt5 \
    188             -translationdir /usr/share/qt5/translations \
    189             -examplesdir    /usr/share/doc/qt5/examples \
    190             -confirm-license   \
    191             -opensource        \
    192             -dbus-linked       \
    193             -openssl-linked    \<!--
    194             -system-harfbuzz   \-->
    195             -system-sqlite     \
    196             -no-nis            \
    197             -skip qtwebengine  \
    198             -nomake examples   \
    199             -nomake tests      \
    200             -optimized-qmake   &amp;&amp;
     213<screen><userinput>./configure -prefix         $QT5PREFIX                        \
     214            -sysconfdir     /etc/xdg                          \
     215            -bindir         $QT5BINDIR                        \
     216            -headerdir      $QT5PREFIX/include/qt5            \
     217            -archdatadir    $QT5PREFIX/lib/qt5                \
     218            -datadir        $QT5PREFIX/share/qt5              \
     219            -docdir         $QT5PREFIX/share/doc/qt5          \
     220            -translationdir $QT5PREFIX/share/qt5/translations \
     221            -examplesdir    $QT5PREFIX/share/doc/qt5/examples \
     222            -confirm-license  \
     223            -opensource       \
     224            -dbus-linked      \
     225            -openssl-linked   \
     226            -journald         \
     227            -system-harfbuzz  \
     228            -system-sqlite    \
     229            -nomake examples  \
     230            -no-rpath         \
     231            -optimized-qmake  \
     232            -skip qtwebengine &amp;&amp;
     233
    201234make</userinput></screen>
    202235
     
    231264     '/^QMAKE_PRL_BUILD_DIR/d;s/(QMAKE_PRL_LIBS =).*/\1/' {} \;</userinput></screen>
    232265
    233 <!-- ==== Method 2 ====== -->
    234 
    235   <bridgehead renderas="sect3">Method 2: Installing in /opt/qt-&qt5-version;</bridgehead>
    236 
    237   <para>
    238         This section provides instructions for installing Qt5 in the
    239         <filename class="directory">/opt</filename> directory.
    240    </para>
    241 
    242 <screen><userinput>export QT5DIR=/opt/qt-&qt5-version; &amp;&amp;
    243 export QT5LINK=/opt/qt5 &amp;&amp;
    244 
    245 ./configure -prefix     $QT5DIR  \
    246             -sysconfdir /etc/xdg \
    247             -confirm-license     \
    248             -opensource          \
    249             -dbus-linked         \
    250             -openssl-linked      \<!--
    251             -system-harfbuzz     \-->
    252             -system-sqlite       \
    253             -no-nis              \
    254             -nomake examples     \
    255             -nomake tests        \
    256             -skip qtwebengine    \
    257             -optimized-qmake     &amp;&amp;
    258 make</userinput></screen>
    259 
    260     <para>
    261       Now, as the <systemitem class="username">root</systemitem> user:
    262     </para>
    263 
    264 <screen role="root"><userinput>make install &amp;&amp;
    265 ln -svfn $QT5DIR /opt/qt5</userinput></screen>
    266 
    267     <para>
    268       Remove references to the build directory from installed files by
    269       running the following commands as the
    270       <systemitem class="username">root</systemitem> user:
    271     </para>
    272 
    273 <screen role="root"><userinput>find $QT5DIR -name qt_lib_bootstrap_private.pri \
    274    -exec sed -i -e "s:$PWD/qtbase:/$QT5DIR/lib/:g" {} \; &amp;&amp;
    275 
    276 find $QT5DIR -name \*.prl \
    277    -exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d' {} \;</userinput></screen>
    278 
    279 <!-- This is useful for packages looking explicitly for Qt apps with -qt5 suffix.
    280 
    281     <para>
    282       Symlink the <application>Qt5</application> executables into
    283       <filename class="directory">/usr/bin</filename> by running the
    284       following commands as the
    285       <systemitem class="username">root</systemitem> user:
    286     </para>
    287 
    288 <screen role="root"><userinput>ln -svf $QT5DIR /opt/qt5 &amp;&amp;
    289 
    290 for file in /opt/qt5/bin/*; do
    291   ln -sfv $file /usr/bin/$(basename $file)-qt5
    292 done</userinput></screen> -->
    293 
    294 <!-- ==== Common  ====== -->
    295     <bridgehead renderas="sect3">Continuing for Both Methods</bridgehead>
    296 
    297     <para>
    298       For all methods, install images and create the menu entries
    299       for installed applications.  Be sure that the <envar>QT5LINK</envar>
     266    <para>
     267      Install images and create the menu entries
     268      for installed applications.  Be sure that the <envar>QT5PREFIX</envar>
    300269      variable is defined in root's environment and
    301270      as the <systemitem class="username">root</systemitem> user:
     
    322291Name=Qt5 Assistant
    323292Comment=Shows Qt5 documentation and examples
    324 Exec=$QT5LINK/bin/assistant
     293Exec=$QT5PREFIX/bin/assistant
    325294Icon=assistant-qt5.png
    326295Terminal=false
     
    335304GenericName=Interface Designer
    336305Comment=Design GUIs for Qt5 applications
    337 Exec=$QT5LINK/bin/designer
     306Exec=$QT5PREFIX/bin/designer
    338307Icon=designer-qt5.png
    339308MimeType=application/x-designer;
     
    348317Name=Qt5 Linguist
    349318Comment=Add translations to Qt5 applications
    350 Exec=$QT5LINK/bin/linguist
     319Exec=$QT5PREFIX/bin/linguist
    351320Icon=linguist-qt5.png
    352321MimeType=text/vnd.trolltech.linguist;application/x-linguist;
     
    362331GenericName=D-Bus Debugger
    363332Comment=Debug D-Bus applications
    364 Exec=$QT5LINK/bin/qdbusviewer
     333Exec=$QT5PREFIX/bin/qdbusviewer
    365334Icon=qdbusviewer-qt5.png
    366335Terminal=false
  • xincludes/qt-alternatives.xml

    ra5a776af r0dd2bc6  
    2727    install the components in the several directories of the <filename
    2828    class='directory'>/usr</filename> hierarchy or install the
    29     entire package in a separate directory of your choice. We
     29    entire package in a separate directory of your choice. <!-- We
    3030    refer to these options below as "Method 1: Installing in /usr"
    31     and "Method 2: Installing in /opt".</para>
     31    and "Method 2: Installing in /opt". --></para>
    3232
    3333    <para>If both versions of Qt are to be installed, one or both versions need
     
    5151
    5252    <para> The advantage of installing <application>Qt</application> in a
    53     custom directory such as
    54     <filename class='directory'>/opt/qt-&qt4-version;</filename> or
    55     <filename class='directory'>/opt/qt-&qt5-version;</filename> or
    56     is that it keeps all the
    57     package files consolidated in a dedicated directory hierarchy. By using
     53    custom directory such as <filename
     54    class='directory'>/opt/qt-&qt4-version;</filename> or <filename
     55    class='directory'>/opt/qt-&qt5-version;</filename> is that it keeps all
     56    the package files consolidated in a dedicated directory hierarchy. By using
    5857    this method, an update can be made without overwriting a previous
    5958    installation and users can easily revert to a previous version by changing
Note: See TracChangeset for help on using the changeset viewer.