Changeset 7aff5814


Ignore:
Timestamp:
10/27/2014 07:14:26 PM (10 years ago)
Author:
Krejzi <krejzi@…>
Branches:
krejzi/svn
Children:
fe7679cd
Parents:
d72fae5a
Message:

Qt instructions rewrite merge.

git-svn-id: svn://svn.linuxfromscratch.org/BLFS/branches/krejzi@14766 af4574ff-66df-0310-9fd7-8a98e5e911e0

Files:
2 edited
2 moved

Legend:

Unmodified
Added
Removed
  • introduction/welcome/changelog.xml

    rd72fae5a r7aff5814  
    5151        </listitem>
    5252        <listitem>
     53          <para>[krejzi] - Rewrote Qt4 and Qt5 instructions to use qtchooser.</para>
     54        </listitem>
     55        <listitem>
    5356          <para>[krejzi] - Added colord-gtk-0.2.25 and gtk-vnc-0.5.3.</para>
    5457        </listitem>
  • x/lib/lib.xml

    rd72fae5a r7aff5814  
    5656  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="pango.xml"/>
    5757  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="pangomm.xml"/>
    58   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="qt4.xml"/>
    59   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="qt5.xml"/>
     58  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="qt4-systemd.xml"/>
     59  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="qt5-systemd.xml"/>
    6060  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="startup-notification.xml"/>
    6161  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="webkitgtk2.xml"/>
  • x/lib/qt4-systemd.xml

    rd72fae5a r7aff5814  
    2929
    3030  <sect2 role="package">
    31     <title>Introduction to Qt</title>
    32 
    33     <para>
    34       <application>Qt</application> is a cross-platform application
     31    <title>Introduction to Qt4</title>
     32
     33    <para>
     34      <application>Qt4</application> is a cross-platform application
    3535      framework that is widely used for developing application software
    36       with a graphical user interface (GUI) (in which cases Qt is classified
    37       as a widget toolkit), and also used for developing non-GUI programs such
    38       as command-line tools and consoles for servers. One of the major users
    39       of <application>Qt</application> is <application>KDE</application>.
     36      with a graphical user interface (GUI) (in which cases
     37      <application>Qt4</application> is classifiedas a widget toolkit), and
     38      also used for developing non-GUI programs such as command-line tools
     39      and consoles for servers. One of the major users
     40      of <application>Qt4</application> is <application>KDE</application>.
    4041    </para>
    4142
     
    7677    </itemizedlist>
    7778
    78     <bridgehead renderas="sect3">Qt Dependencies</bridgehead>
     79    <bridgehead renderas="sect3">Qt4 Dependencies</bridgehead>
    7980
    8081    <bridgehead renderas="sect4">Required</bridgehead>
     
    110111    </para>
    111112
     113    <bridgehead renderas="sect4">Runtime Dependency</bridgehead>
     114    <para role="optional">
     115      <xref linkend="qtchooser"/> (required if installing both
     116      Qt4 and Qt5)
     117    </para>
     118
    112119    <para condition="html" role="usernotes">User Notes:
    113120      <ulink url="&blfs-wiki;/qt4"/>
     
    115122  </sect2>
    116123
    117   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="../../xincludes/qt-alternatives.xml"/>
     124
     125  <sect2 role="qt4-prefix">
     126    <title>Setting the installation prefix</title>
     127
     128    <bridgehead renderas="sect3">Installing in /usr</bridgehead>
     129
     130    <para>
     131      If you want to install <application>Qt4</application>
     132      in <filename class="directory">/usr</filename>, set the
     133      following environment variable:
     134    </para>
     135
     136<screen><userinput>export QT4PREFIX=/usr</userinput></screen>
     137
     138    <para>
     139      The advantage of installing in
     140      <filename class="directory">/usr</filename> is that no additional
     141      configuration is required. The package files are distributed
     142      within several subdirectories of the
     143      <filename class="directory">/usr</filename> hierarchy. This is
     144      the method that most distributions use. The disadvantage for BLFS
     145      users is that this <application>Qt4</application> instance cannot
     146      be upgraded while it is in use. It also does not allow reverting
     147      to an existing, known working instance of
     148      <application>Qt4</application>.
     149    </para>
     150
     151    <bridgehead renderas="sect3">Installing in /opt/qt4</bridgehead>
     152
     153    <para>
     154      If you want to install <application>Qt4</application>
     155      in a directory other than <filename
     156      class="directory">/usr</filename>, ie
     157      <filename class="directory">/opt/qt4</filename>, set
     158      the following environment variable:
     159    </para>
     160
     161<screen><userinput>export QT4PREFIX=/opt/qt4</userinput></screen>
     162
     163    <para>
     164      The advantage of installing <application>Qt4</application> in a
     165      custom directory such as <filename
     166      class="directory">/opt/qt4</filename> is that it keeps all the
     167      package files consolidated in a dedicated directory hierarchy. By
     168      using this method, an update can be made without overwriting a
     169      previous installation and users can easily revert to a previous
     170      version by changing one symbolic link or merely changing the
     171      PATH variable.
     172    </para>
     173
     174    <tip>
     175      <para>
     176        Sometimes, the installation paths are hardcoded into installed files.
     177        This is the reason why <filename class="directory">/opt/qt4</filename>
     178        is used as installation prefix instead of <filename
     179        class="directory">/opt/qt-&qt4-version;</filename>. After installing
     180        <application>Qt4</application>, you may rename the directory and
     181        create a symlink:
     182      </para>
     183
     184<screen role="root"><userinput>mv /opt/qt{4,-&qt4-version;}
     185ln -sfv qt-&qt4-version; /opt/qt4</userinput></screen>
     186
     187      <para>
     188        Later on, you may want to install other versions of
     189        <application>Qt4</application>. To do that, just remove the symlink
     190        and use <filename class="directory">/opt/qt4</filename> as the
     191        prefix again. Which version of <application>Qt4</application> you
     192        use depends only on where the symlink points to.
     193      </para>
     194    </tip>
     195
     196    <bridgehead renderas="sect3">Setting the install location for executables</bridgehead>
     197
     198    <para>
     199      Both <application>Qt4</application> and
     200      <application>Qt5</application> executables have
     201      the same names and will overwrite each other if
     202      they are installed in the same prefix. To overcome
     203      such problem, BLFS offers <xref linkend="qtchooser"/>,
     204      an utility used to switch between different
     205      <application>Qt</application> versions.
     206    </para>
     207
     208    <para>
     209      If <xref linkend="qtchooser"/> is to be used or
     210      if installing both <application>Qt4</application>
     211      and <application>Qt5</application> in
     212      <filename class="directory">/usr</filename>, the
     213      executables need to be installed to a non-standard
     214      location in order to avoid the conflict with
     215      <application>Qt5</application> ones. To accomplish
     216      that, set the following environment variable:
     217    </para>
     218
     219<screen><userinput>export QT4BINDIR=$QT4PREFIX/lib/qt4/bin</userinput></screen>
     220
     221    <para>
     222      If you choose not to install <xref linkend="qtchooser"/>
     223      or if you are not going to install
     224      <application>Qt5</application>, simply set the bindir to
     225      a <filename class="directory">bin</filename> subdir of the
     226      default prefix by setting the following environment variable:
     227    </para>
     228
     229<screen><userinput>export QT4BINDIR=$QT4PREFIX/bin</userinput></screen>
     230
     231  </sect2>
    118232
    119233  <sect2 role="installation">
    120     <title>Installation of Qt</title>
     234    <title>Installation of Qt4</title>
    121235
    122236    <caution>
     
    155269    src/gui/image/qgifhandler.cpp</userinput></screen>
    156270
    157 <!-- ==== Method 1 ====== -->
    158     <bridgehead renderas="sect3">Method 1: Installing in /usr</bridgehead>
    159 
    160     <para>
    161       Install <application>Qt4</application> into the <filename
    162       class='directory'>/usr</filename> hierarchy by running the following
    163       commands:
    164     </para>
    165 
    166 <screen><userinput>export QT4LINK=/usr
    167 
    168 sed -i -e "/#if/d" -e "/#error/d" -e "/#endif/d" \
     271    <para>
     272      Install <application>Qt4</application> by running the
     273      following commands:
     274    </para>
     275
     276<screen><userinput>sed -i -e "/#if/d" -e "/#error/d" -e "/#endif/d" \
    169277     config.tests/unix/libmng/libmng.cpp &amp;&amp;
    170278
     
    172280     src/3rdparty/webkit/Source/WebKit2/DerivedSources.pro &amp;&amp;
    173281
    174 ./configure -prefix         /usr                 \
    175             -bindir         /usr/bin             \
    176             -plugindir      /usr/lib/qt4/plugins \
    177             -importdir      /usr/lib/qt4/imports \
    178             -headerdir      /usr/include/qt4     \
    179             -datadir        /usr/share/qt4       \
    180             -sysconfdir     /etc/xdg             \
    181             -docdir         /usr/share/doc/qt4   \
    182             -demosdir       /usr/share/doc/qt4/demos    \
    183             -examplesdir    /usr/share/doc/qt4/examples \
    184             -translationdir /usr/share/qt4/translations \
     282./configure -prefix         $QT4PREFIX                        \
     283            -sysconfdir     /etc/xdg                          \
     284            -bindir         $QT4BINDIR                        \
     285            -plugindir      $QT4PREFIX/lib/qt4/plugins        \
     286            -importdir      $QT4PREFIX/lib/qt4/imports        \
     287            -headerdir      $QT4PREFIX/include/qt4            \
     288            -datadir        $QT4PREFIX/share/qt4              \
     289            -docdir         $QT4PREFIX/share/doc/qt4          \
     290            -translationdir $QT4PREFIX/share/qt4/translations \
     291            -demosdir       $QT4PREFIX/share/doc/qt4/demos    \
     292            -examplesdir    $QT4PREFIX/share/doc/qt4/examples \
    185293            -confirm-license   \
    186294            -opensource        \
     
    191299            -no-phonon         \
    192300            -no-phonon-backend \
    193             -no-nis            \
    194301            -no-openvg         \
    195302            -nomake demos      \
     
    211318<screen><userinput>find . -name "*.pc" -exec perl -pi -e "s, -L$PWD/?\S+,,g" {} \;</userinput></screen>
    212319
    213     <para>Now as the <systemitem class="username">root</systemitem> user:</para>
     320    <warning>
     321      <para>
     322        Make sure that <envar>QT4PREFIX</envar> and <envar>QT4BINDIR</envar>
     323        environment variables are set for the
     324        <systemitem class="username">root</systemitem> user too.
     325      </para>
     326    </warning>
     327
     328    <para>
     329      Now, as the <systemitem class="username">root</systemitem> user:
     330    </para>
    214331
    215332<screen role="root"><userinput>make install &amp;&amp;
    216 rm -rf /usr/tests</userinput></screen>
     333rm -rf $QT4PREFIX/tests</userinput></screen>
    217334
    218335    <para>
     
    226343            ScriptTools Sql Svg Test UiTools WebKit XmlPatterns Xml phonon; do
    227344
    228      [ -e /usr/lib/libQt${file}.prl ] &amp;&amp;
     345     [ -e $QT4PREFIX/lib/libQt${file}.prl ] &amp;&amp;
    229346     sed -r '/^QMAKE_PRL_BUILD_DIR/d;s/(QMAKE_PRL_LIBS =).*/\1/' \
    230          -i /usr/lib/libQt${file}.prl
     347         -i $QT4PREFIX/lib/libQt${file}.prl
    231348done
    232349unset file</userinput></screen>
    233350
    234 <!-- ==== Method 2 ====== -->
    235     <bridgehead renderas="sect3">Method 2: Installing in /opt/qt-&qt4-version;</bridgehead>
    236 
    237     <para>
    238       This section provides for installing Qt4 almost all of the files in the
    239       <filename class="directory">/opt</filename> directory.
    240     </para>
    241 
    242 <screen><userinput>export QT4DIR=/opt/qt-&qt4-version; &amp;&amp;
    243 export QT4LINK=/opt/qt4 &amp;&amp;
    244 
    245 sed -i -e "/#if/d" -e "/#error/d" -e "/#endif/d" \
    246      config.tests/unix/libmng/libmng.cpp &amp;&amp;
    247 
    248 sed -i '/CONFIG -/ a\isEmpty(OUTPUT_DIR): OUTPUT_DIR = ../..' \
    249      src/3rdparty/webkit/Source/WebKit2/DerivedSources.pro &amp;&amp;
    250 
    251 ./configure -prefix     $QT4DIR  \
    252             -sysconfdir /etc/xdg \
    253             -confirm-license     \
    254             -opensource          \
    255             -release             \
    256             -dbus-linked         \
    257             -openssl-linked      \
    258             -system-sqlite       \
    259             -plugin-sql-sqlite   \
    260             -no-phonon           \
    261             -no-phonon-backend   \
    262             -no-nis              \
    263             -no-openvg           \
    264             -nomake demos        \
    265             -nomake examples     \
    266             -optimized-qmake     &amp;&amp;
    267 
    268 make</userinput></screen>
    269 
    270     <para>
    271       Now, as the <systemitem class="username">root</systemitem> user:
    272     </para>
    273 
    274 <screen role="root"><userinput>make install
    275 ln -svfn $QT4DIR /opt/qt4</userinput></screen>
    276 
    277     <para>
    278       Remove references to the build directory from installed files by
    279       running the following command as the
    280       <systemitem class="username">root</systemitem> user:
    281     </para>
    282 
    283 <screen role="root"><userinput>for file in `basename -a -s .prl $QT4DIR/lib/lib*.prl`; do
    284        sed -r -e '/^QMAKE_PRL_BUILD_DIR/d'    \
    285               -e 's/(QMAKE_PRL_LIBS =).*/\1/' \
    286               -i $QT4DIR/lib/${file}.prl
    287 
    288    perl -pi -e "s, -L$PWD/?\S+,,g" $QT4DIR/lib/pkgconfig/${file##lib}.pc
    289 done
    290 
    291 unset file</userinput></screen>
    292 
    293 <!-- ==== Common  ====== -->
    294     <bridgehead renderas="sect3">Continuing for Both Methods</bridgehead>
    295 
    296       <para>
    297         For all methods, install images and create the menu entries
    298         for installed applications.  Be sure that the <envar>QT4LINK</envar>
    299         variable is defined in root's environment and
    300         as the <systemitem class="username">root</systemitem> user:
    301       </para>
     351    <para>
     352      Install images and create the menu entries for installed
     353      applications by running the following commands
     354      as the <systemitem class="username">root</systemitem> user:
     355    </para>
    302356
    303357<screen role="root"><userinput>install -v -Dm644 src/gui/dialogs/images/qtlogo-64.png \
    304                   /usr/share/pixmaps/qt4logo.png       &amp;&amp;
     358                  /usr/share/pixmaps/qt4logo.png &amp;&amp;
    305359
    306360install -v -Dm644 tools/assistant/tools/assistant/images/assistant-128.png \
     
    308362
    309363install -v -Dm644 tools/designer/src/designer/images/designer.png \
    310                   /usr/share/pixmaps/designer-qt4.png  &amp;&amp;
     364                  /usr/share/pixmaps/designer-qt4.png &amp;&amp;
    311365
    312366install -v -Dm644 tools/linguist/linguist/images/icons/linguist-128-32.png \
    313                   /usr/share/pixmaps/linguist-qt4.png  &amp;&amp;
     367                  /usr/share/pixmaps/linguist-qt4.png &amp;&amp;
    314368
    315369install -v -Dm644 tools/qdbus/qdbusviewer/images/qdbusviewer-128.png \
    316370                  /usr/share/pixmaps/qdbusviewer-qt4.png &amp;&amp;
    317371
    318 install -dm755 /usr/share/applications &amp;&amp;
     372install -v -dm755 /usr/share/applications &amp;&amp;
    319373
    320374cat &gt; /usr/share/applications/assistant-qt4.desktop &lt;&lt; EOF
     
    322376Name=Qt4 Assistant
    323377Comment=Shows Qt4 documentation and examples
    324 Exec=$QT4LINK/bin/assistant
     378Exec=$QT4BINDIR/assistant
    325379Icon=assistant-qt4.png
    326380Terminal=false
     
    334388Name=Qt4 Designer
    335389Comment=Design GUIs for Qt4 applications
    336 Exec=$QT4LINK/bin/designer
     390Exec=$QT4BINDIR/designer
    337391Icon=designer-qt4.png
    338392MimeType=application/x-designer;
     
    347401Name=Qt4 Linguist
    348402Comment=Add translations to Qt4 applications
    349 Exec=$QT4LINK/bin/linguist
     403Exec=$QT4BINDIR/linguist
    350404Icon=linguist-qt4.png
    351405MimeType=text/vnd.trolltech.linguist;application/x-linguist;
     
    361415GenericName=D-Bus Debugger
    362416Comment=Debug D-Bus applications
    363 Exec=$QT4LINK/bin/qdbusviewer
     417Exec=$QT4BINDIR/qdbusviewer
    364418Icon=qdbusviewer-qt4.png
    365419Terminal=false
     
    373427Name=Qt4 Config
    374428Comment=Configure Qt4 behavior, styles, fonts
    375 Exec=$QT4LINK/bin/qtconfig
     429Exec=$QT4BINDIR/qtconfig
    376430Icon=qt4logo.png
    377431Terminal=false
     
    381435EOF</userinput></screen>
    382436
     437    <para>
     438      Some packages look for <application>Qt4</application> executables
     439      with <filename>-qt4</filename> suffix. Run the following command
     440      as the <systemitem class="username">root</systemitem> user to
     441      create the necessary symlinks:
     442    </para>
     443
     444<screen role="root"><userinput>for file in assistant designer lconvert linguist lrelease lupdate \
     445            moc pixeltool qcollectiongenerator qdbus qdbuscpp2xml \
     446            qdbusviewer qdbusxml2cpp qdoc3 qhelpconverter         \
     447            qhelpgenerator qmake qmlplugindump qmlviewer qt3to4   \
     448            qtconfig qttracereplay rcc uic uic3 xmlpatterns       \
     449            xmlpatternsvalidator
     450do
     451  ln -sfrv $QT4BINDIR/$file /usr/bin/$file-qt4
     452done
     453unset file</userinput></screen>
     454
    383455  </sect2>
    384456
     
    416488      <parameter>-system-sqlite</parameter>: This switch enables use
    417489      the system version of <application>SQLite</application>.
    418     </para>
    419 
    420     <para>
    421       <parameter>-no-nis</parameter>: This switch disables support
    422       for Network Information Service (NIS) which has been
    423       deprecated in recent versions of <application>Glibc</application>.
    424490    </para>
    425491
     
    451517    </para>
    452518
    453     <para>
    454       <option>-no-dbus</option>: Use this switch if you don't have
    455       <application>D-Bus</application> installed.
    456     </para>
    457 
    458519  </sect2>
    459520
    460521  <sect2 role="configuration">
    461     <title>Configuring Qt</title>
     522    <title>Configuring Qt4</title>
    462523
    463524    <sect3 id="qt4-config">
    464525      <title>Configuration Information</title>
    465526
    466       <para>
    467         If you installed <application>Qt</application> in /usr,
    468         create an environment variable needed by certain packages.
    469         As the <systemitem class="username">root</systemitem> user:
     527      <note>
     528        <para>
     529          If you have installed <application>Qt4</application>
     530          in <filename class="directory">/usr</filename> you
     531          can skip this section.
     532        </para>
     533      </note>
     534
     535      <para>
     536        If you installed <application>Qt4</application> in a location other
     537        than <filename class="directory">/usr</filename>, you need to update the
     538        following configuration files so that <application>Qt4</application> is
     539        correctly found by other packages and system processes.
     540      </para>
     541
     542      <para>
     543        As the <systemitem class="username">root</systemitem> user, update
     544        the <filename>/etc/ld.so.conf</filename> file and the dynamic linker's
     545        run-time cache file:
     546      </para>
     547
     548<screen role="root"><userinput>cat &gt;&gt; /etc/ld.so.conf &lt;&lt; EOF
     549<literal># Begin Qt4 addition
     550
     551$QT4PREFIX/lib
     552
     553# End Qt4 addition</literal>
     554EOF
     555
     556ldconfig</userinput></screen>
     557
     558      <indexterm zone="qt4 qt4-config">
     559        <primary sortas="e-etc-ld.so.conf">/etc/ld.so.conf</primary>
     560      </indexterm>
     561
     562      <para>
     563        If you have installed <xref linkend="qtchooser"/>, create
     564        the <filename>/etc/profile.d/qt4.sh</filename> file by
     565        running the following command as the
     566        <systemitem class="username">root</systemitem> user:
    470567      </para>
    471568
     
    473570<literal># Begin /etc/profile.d/qt4.sh
    474571
    475 QT4DIR=/usr
    476 export QT4DIR
     572pathappend $QT4PREFIX/lib/pkgconfig PKG_CONFIG_PATH
    477573
    478574# End /etc/profile.d/qt4.sh</literal>
    479575EOF</userinput></screen>
    480576
    481    <para>
    482       If you installed <application>Qt</application> in a location other
    483       than /usr, you need to update the following configuration files so
    484       that <application>Qt</application> is correctly found by other packages
    485       and system processes.</para>
    486    
    487       <para>As the <systemitem class="username">root</systemitem> user, update
    488       the <filename>/etc/ld.so.conf</filename> file and the dynamic linker's
    489       run-time cache file:
    490    </para>
    491    
    492 <screen role="root"><userinput>cat &gt;&gt; /etc/ld.so.conf &lt;&lt; EOF
    493 <literal># Begin Qt addition
    494    
    495 /opt/qt4/lib
    496    
    497 # End Qt addition</literal>
    498 EOF
    499 
    500 ldconfig</userinput></screen>
    501    
    502    <indexterm zone="qt4 qt4-config">
    503       <primary sortas="e-etc-ld.so.conf">/etc/ld.so.conf</primary>
    504    </indexterm>
    505    
    506    <para>
    507       As the <systemitem class="username">root</systemitem> user, create
    508       the <filename>/etc/profile.d/qt4.sh</filename> file:
    509    </para>
    510    
     577      <para>
     578        If you have not installed <xref linkend="qtchooser"/>,
     579        create the <filename>/etc/profile.d/qt4.sh</filename>
     580        file by running the following command as the
     581        <systemitem class="username">root</systemitem> user:
     582      </para>
     583
    511584<screen role="root"><userinput>cat &gt; /etc/profile.d/qt4.sh &lt;&lt; EOF
    512585<literal># Begin /etc/profile.d/qt4.sh
    513    
    514 QT4DIR=/opt/qt4
    515    
    516 pathappend /opt/qt4/bin           PATH
    517 pathappend /opt/qt4/lib/pkgconfig PKG_CONFIG_PATH
    518    
    519 export QT4DIR
    520    
     586
     587pathappend $QT4BINDIR               PATH
     588pathappend $QT4PREFIX/lib/pkgconfig PKG_CONFIG_PATH
     589
    521590# End /etc/profile.d/qt4.sh</literal>
    522591EOF</userinput></screen>
    523592
     593      <note>
     594        <para>
     595          If <xref linkend="qtchooser"/> is not installed and you
     596          also have <application>Qt5</application> installed,
     597          you will need to manually adjust the <envar>PATH</envar>
     598          variable depending on which <application>Qt</application>
     599          version is needed.
     600        </para>
     601      </note>
    524602
    525603    </sect3>
    526    
    527     <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
    528                 href="../../xincludes/setqt.xml"/>
     604
    529605  </sect2>
    530606
     
    557633        </seg>
    558634        <seg>
    559           /usr/include/qt4,
    560           /usr/lib/qt4,
    561           /usr/share/doc/qt4, and
    562           /usr/share/qt4
    563           OR
    564           /opt/qt4 and
    565           /opt/qt-&qt4-version;
     635          $QT4PREFIX/include/qt4,
     636          $QT4PREFIX/lib/qt4,
     637          $QT4PREFIX/share/doc/qt4, and
     638          $QT4PREFIX/share/qt4
    566639        </seg>
    567640      </seglistitem>
  • x/lib/qt5-systemd.xml

    rd72fae5a r7aff5814  
    9696      <xref linkend="dbus"/>,
    9797      <xref linkend="glib2"/>,
    98       <xref linkend="gst-plugins-base"/>,<!--
    99       <xref linkend="harfbuzz"/>, Doesn't have all the features that the included one has. -->
    100       <xref linkend="icu"/> (required for QtWebKit),
     98      <xref linkend="gst-plugins-base"/>,
     99      <xref linkend="harfbuzz"/>,
     100      <xref linkend="icu"/> (unicode support, also required for QtWebKit),
    101101      <xref linkend="libjpeg"/>,
    102102      <xref linkend="libmng"/>,
    103103      <xref linkend="libpng"/>,
    104104      <xref linkend="libtiff"/>,
     105      <xref linkend="libxkbcommon"/>,
    105106      <xref linkend="mtdev"/>,
    106107      <xref linkend="openssl"/>,
    107108      <xref linkend="pcre"/>,
    108       <xref linkend="sqlite"/> and
    109       <xref linkend="ruby"/> (required for QtWebKit)
     109      <xref linkend="ruby"/> (required for QtWebKit), and
     110      <xref linkend="sqlite"/>
    110111    </para>
    111112
     
    115116      <xref linkend="gst10-plugins-base"/> (QtWebKit HTML5 Video Support),
    116117      <xref linkend="gtk2"/> (GTK+ Theme Support),
    117       <ulink url="https://code.google.com/p/ibus/">IBus</ulink>,
    118       <ulink url="http://xkbcommon.org/">libxkbcommon</ulink>,
    119       <xref linkend="mariadb"/> or <ulink url="http://www.mysql.com/">MySQL</ulink>,
     118      <xref linkend="ibus"/>,
     119      <xref linkend="mariadb"/>,
    120120      <xref linkend="postgresql"/>,
    121121      <xref linkend="pulseaudio"/>, and
     
    123123    </para>
    124124
     125    <bridgehead renderas="sect4">Runtime Dependency</bridgehead>
     126    <para role="optional">
     127      <xref linkend="qtchooser"/> (required if installing both
     128      Qt4 and Qt5)
     129    </para>
     130
    125131    <para condition="html" role="usernotes">User Notes:
    126132      <ulink url="&blfs-wiki;/qt5"/>
     
    128134  </sect2>
    129135
    130    <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
    131                href="../../xincludes/qt-alternatives.xml"/>
     136  <sect2 role="qt5-prefix">
     137    <title>Setting the installation prefix</title>
     138
     139    <bridgehead renderas="sect3">Installing in /usr</bridgehead>
     140
     141    <para>
     142      If you want to install <application>Qt5</application>
     143      in <filename class="directory">/usr</filename>, set the
     144      following environment variable:
     145    </para>
     146
     147<screen><userinput>export QT5PREFIX=/usr</userinput></screen>
     148
     149    <para>
     150      The advantage of installing in
     151      <filename class="directory">/usr</filename> is that no additional
     152      configuration is required. The package files are distributed
     153      within several subdirectories of the
     154      <filename class="directory">/usr</filename> hierarchy. This is
     155      the method that most distributions use. The disadvantage for BLFS
     156      users is that this <application>Qt5</application> instance cannot
     157      be upgraded while it is in use. It also does not allow reverting
     158      to an existing, known working instance of
     159      <application>Qt5</application>.
     160    </para>
     161
     162    <bridgehead renderas="sect3">Installing in /opt/qt5</bridgehead>
     163
     164    <para>
     165      If you want to install <application>Qt5</application>
     166      in a directory other than <filename
     167      class="directory">/usr</filename>, ie
     168      <filename class="directory">/opt/qt5</filename>, set
     169      the following environment variable:
     170    </para>
     171
     172<screen><userinput>export QT5PREFIX=/opt/qt5</userinput></screen>
     173
     174    <para>
     175      The advantage of installing <application>Qt5</application> in a
     176      custom directory such as <filename
     177      class="directory">/opt/qt5</filename> is that it keeps all the
     178      package files consolidated in a dedicated directory hierarchy. By
     179      using this method, an update can be made without overwriting a
     180      previous installation and users can easily revert to a previous
     181      version by changing one symbolic link or merely changing the
     182      PATH variable.
     183    </para>
     184
     185    <tip>
     186      <para>
     187        Sometimes, the installation paths are hardcoded into installed files.
     188        This is the reason why <filename class="directory">/opt/qt5</filename>
     189        is used as installation prefix instead of <filename
     190        class="directory">/opt/qt-&qt5-version;</filename>. After installing
     191        <application>Qt5</application>, you may rename the directory and
     192        create a symlink:
     193      </para>
     194
     195<screen role="root"><userinput>mv /opt/qt{5,-&qt5-version;}
     196ln -sfv qt-&qt5-version; /opt/qt5</userinput></screen>
     197
     198      <para>
     199        Later on, you may want to install other versions of
     200        <application>Qt5</application>. To do that, just remove the symlink
     201        and use <filename class="directory">/opt/qt5</filename> as the
     202        prefix again. Which version of <application>Qt5</application> you
     203        use depends only on where the symlink points to.
     204      </para>
     205    </tip>
     206
     207    <bridgehead renderas="sect3">Setting the install location for executables</bridgehead>
     208
     209    <para>
     210      Both <application>Qt4</application> and
     211      <application>Qt5</application> executables have
     212      the same names and will overwrite each other if
     213      they are installed in the same prefix. To overcome
     214      such problem, BLFS offers <xref linkend="qtchooser"/>,
     215      an utility used to switch between different
     216      <application>Qt</application> versions.
     217    </para>
     218
     219    <para>
     220      If <xref linkend="qtchooser"/> is to be used or
     221      if installing both <application>Qt4</application>
     222      and <application>Qt5</application> in
     223      <filename class="directory">/usr</filename>, the
     224      executables need to be installed to a non-standard
     225      location in order to avoid the conflict with
     226      <application>Qt4</application> ones. To accomplish
     227      that, set the following environment variable:
     228    </para>
     229
     230<screen><userinput>export QT5BINDIR=$QT5PREFIX/lib/qt5/bin</userinput></screen>
     231
     232    <para>
     233      If you choose not to install <xref linkend="qtchooser"/>
     234      or if you are not going to install
     235      <application>Qt4</application>, simply set the bindir to
     236      a <filename class="directory">bin</filename> subdir of the
     237      default prefix by setting the following environment variable:
     238    </para>
     239
     240<screen><userinput>export QT5BINDIR=$QT5PREFIX/bin</userinput></screen>
     241
     242  </sect2>
    132243
    133244  <sect2 role="installation">
     
    153264    </warning>
    154265
    155 <!-- ==== Method 1 ====== -->
    156     <bridgehead renderas="sect3">Method 1: Installing in /usr</bridgehead>
    157 
    158266    <para>
    159267      Install <application>Qt5</application> by running the
     
    161269    </para>
    162270
    163     <!-- This is rather a bad idea. Most apps that I've seen using Qt5 look for -qt5
    164          suffixed programs.  On the other hand, the developer is used to running
    165          qmake, linguist, etc from the command line. 
    166 
    167     <note>
    168       <para>
    169         If <emphasis>not</emphasis> also installing <application>Qt4</application>
    170         into the /usr directory, change the entry for -bindir below to /usr/bin.
    171       </para>
    172     </note> -->
    173 
    174 <screen><userinput>export QT5LINK=/usr
    175 
    176 ./configure -prefix         /usr               \
    177             -sysconfdir     /etc/xdg           \
    178             -bindir         /usr/bin           \
    179             -headerdir      /usr/include/qt5   \
    180             -archdatadir    /usr/lib/qt5       \
    181             -datadir        /usr/share/qt5     \
    182             -docdir         /usr/share/doc/qt5 \
    183             -translationdir /usr/share/qt5/translations \
    184             -examplesdir    /usr/share/doc/qt5/examples \
    185             -confirm-license   \
    186             -opensource        \
    187             -dbus-linked       \
    188             -openssl-linked    \<!--
    189             -system-harfbuzz   \-->
    190             -system-sqlite     \
    191             -no-nis            \
    192             -nomake examples   \
    193             -optimized-qmake   &amp;&amp;
     271<screen><userinput>./configure -prefix         $QT5PREFIX                        \
     272            -sysconfdir     /etc/xdg                          \
     273            -bindir         $QT5BINDIR                        \
     274            -headerdir      $QT5PREFIX/include/qt5            \
     275            -archdatadir    $QT5PREFIX/lib/qt5                \
     276            -datadir        $QT5PREFIX/share/qt5              \
     277            -docdir         $QT5PREFIX/share/doc/qt5          \
     278            -translationdir $QT5PREFIX/share/qt5/translations \
     279            -examplesdir    $QT5PREFIX/share/doc/qt5/examples \
     280            -confirm-license \
     281            -opensource      \
     282            -dbus-linked     \
     283            -openssl-linked  \
     284            -system-harfbuzz \
     285            -system-sqlite   \
     286            -nomake examples \
     287            -optimized-qmake &amp;&amp;
    194288make</userinput></screen>
    195289
     
    206300<screen><userinput>find . -name "*.pc" -exec perl -pi -e "s, -L$PWD/?\S+,,g" {} \;</userinput></screen>
    207301
     302    <warning>
     303      <para>
     304        Make sure that <envar>QT5PREFIX</envar> and <envar>QT5BINDIR</envar>
     305        environment variables are set for the
     306        <systemitem class="username">root</systemitem> user too.
     307      </para>
     308    </warning>
     309
    208310    <para>
    209311      Now, as the <systemitem class="username">root</systemitem> user:
     
    218320    </para>
    219321
    220 <screen role="root"><userinput>sed -e "s:$PWD/qtbase:/usr/lib/qt5:g" \
    221     -i /usr/lib/qt5/mkspecs/modules/qt_lib_bootstrap_private.pri &amp;&amp;
    222 
    223 find /usr/lib/lib{qgsttools_p,Qt5*}.prl -exec sed -i -r \
     322<screen role="root"><userinput>sed -e "s:$PWD/qtbase:$QT5PREFIX/lib/qt5:g" \
     323    -i $QT5PREFIX/lib/qt5/mkspecs/modules/qt_lib_bootstrap_private.pri &amp;&amp;
     324
     325find $QT5PREFIX/lib/lib{Enginio,qgsttools_p,Qt5*}.prl -exec sed -i -r \
    224326     '/^QMAKE_PRL_BUILD_DIR/d;s/(QMAKE_PRL_LIBS =).*/\1/' {} \;</userinput></screen>
    225327
    226 <!-- ==== Method 2 ====== -->
    227 
    228   <bridgehead renderas="sect3">Method 2: Installing in /opt/qt-&qt5-version;</bridgehead>
    229 
    230   <para>
    231         This section provides instructions for installing Qt5 in the
    232         <filename class="directory">/opt</filename> directory.
    233    </para>
    234 
    235 <screen><userinput>export QT5DIR=/opt/qt-&qt5-version; &amp;&amp;
    236 export QT5LINK=/opt/qt5 &amp;&amp;
    237 
    238 ./configure -prefix     $QT5DIR  \
    239             -sysconfdir /etc/xdg \
    240             -confirm-license     \
    241             -opensource          \
    242             -dbus-linked         \
    243             -openssl-linked      \<!--
    244             -system-harfbuzz     \-->
    245             -system-sqlite       \
    246             -no-nis              \
    247             -nomake examples     \
    248             -optimized-qmake     &amp;&amp;
    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 &amp;&amp;
    256 ln -svfn $QT5DIR /opt/qt5</userinput></screen>
    257 
    258     <para>
    259       Remove references to the build directory from installed files by
    260       running the following commands as the
    261       <systemitem class="username">root</systemitem> user:
    262     </para>
    263 
    264 <screen role="root"><userinput>find $QT5DIR -name qt_lib_bootstrap_private.pri \
    265    -exec sed -i -e "s:$PWD/qtbase:/$QT5DIR/lib/:g" {} \; &amp;&amp;
    266 
    267 find $QT5DIR -name \*.prl \
    268    -exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d' {} \;</userinput></screen>
    269 
    270 <!-- This is useful for packages looking explicitly for Qt apps with -qt5 suffix.
    271 
    272     <para>
    273       Symlink the <application>Qt5</application> executables into
    274       <filename class="directory">/usr/bin</filename> by running the
    275       following commands as the
    276       <systemitem class="username">root</systemitem> user:
    277     </para>
    278 
    279 <screen role="root"><userinput>ln -svf $QT5DIR /opt/qt5 &amp;&amp;
    280 
    281 for file in /opt/qt5/bin/*; do
    282   ln -sfv $file /usr/bin/$(basename $file)-qt5
    283 done</userinput></screen> -->
    284 
    285 <!-- ==== Common  ====== -->
    286     <bridgehead renderas="sect3">Continuing for Both Methods</bridgehead>
    287 
    288     <para>
    289       For all methods, install images and create the menu entries
    290       for installed applications.  Be sure that the <envar>QT5LINK</envar>
    291       variable is defined in root's environment and
     328    <para>
     329      Install images and create the menu entries for installed
     330      applications by running the following commands
    292331      as the <systemitem class="username">root</systemitem> user:
    293332    </para>
    294333
    295 <screen role="root"><userinput>install -v -dm755 /usr/share/pixmaps/                  &amp;&amp;
    296 
    297 install -v -Dm644 qttools/src/assistant/assistant/images/assistant-128.png \
     334<screen role="root"><userinput>install -v -Dm644 qttools/src/assistant/assistant/images/assistant-128.png \
    298335                  /usr/share/pixmaps/assistant-qt5.png &amp;&amp;
    299336
    300337install -v -Dm644 qttools/src/designer/src/designer/images/designer.png \
    301                   /usr/share/pixmaps/designer-qt5.png  &amp;&amp;
     338                  /usr/share/pixmaps/designer-qt5.png &amp;&amp;
    302339
    303340install -v -Dm644 qttools/src/linguist/linguist/images/icons/linguist-128-32.png \
    304                   /usr/share/pixmaps/linguist-qt5.png  &amp;&amp;
     341                  /usr/share/pixmaps/linguist-qt5.png &amp;&amp;
    305342
    306343install -v -Dm644 qttools/src/qdbus/qdbusviewer/images/qdbusviewer-128.png \
    307344                  /usr/share/pixmaps/qdbusviewer-qt5.png &amp;&amp;
    308345
    309 install -dm755 /usr/share/applications &amp;&amp;
     346install -v -dm755 /usr/share/applications &amp;&amp;
    310347
    311348cat &gt; /usr/share/applications/assistant-qt5.desktop &lt;&lt; EOF
     
    313350Name=Qt5 Assistant
    314351Comment=Shows Qt5 documentation and examples
    315 Exec=$QT5LINK/bin/assistant
     352Exec=$QT5BINDIR/assistant
    316353Icon=assistant-qt5.png
    317354Terminal=false
     
    326363GenericName=Interface Designer
    327364Comment=Design GUIs for Qt5 applications
    328 Exec=$QT5LINK/bin/designer
     365Exec=$QT5BINDIR/designer
    329366Icon=designer-qt5.png
    330367MimeType=application/x-designer;
     
    339376Name=Qt5 Linguist
    340377Comment=Add translations to Qt5 applications
    341 Exec=$QT5LINK/bin/linguist
     378Exec=$QT5BINDIR/linguist
    342379Icon=linguist-qt5.png
    343380MimeType=text/vnd.trolltech.linguist;application/x-linguist;
     
    353390GenericName=D-Bus Debugger
    354391Comment=Debug D-Bus applications
    355 Exec=$QT5LINK/bin/qdbusviewer
     392Exec=$QT5BINDIR/qdbusviewer
    356393Icon=qdbusviewer-qt5.png
    357394Terminal=false
     
    361398EOF</userinput></screen>
    362399
     400    <para>
     401      Some packages look for <application>Qt5</application> executables
     402      with <filename>-qt5</filename> suffix. Run the following command
     403      as the <systemitem class="username">root</systemitem> user to
     404      create the necessary symlinks:
     405    </para>
     406
     407<screen role="root"><userinput>for file in assistant designer lconvert linguist lrelease lupdate   \
     408            moc pixeltool qcollectiongenerator qdbus qdbuscpp2xml   \
     409            qdbusviewer qdbusxml2cpp qdoc qhelpconverter            \
     410            qhelpgenerator qlalr qmake qml qml1plugindump qmlbundle \
     411            qmlimportscanner qmlmin qmlplugindump qmlprofiler       \
     412            qmlscene qmltestrunner qmlviewer qtdiag qtpaths         \
     413            rcc syncqt.pl uic xmlpatterns xmlpatternsvalidator
     414do
     415  ln -sfrv $QT5BINDIR/$file /usr/bin/$file-qt5
     416done
     417unset file</userinput></screen>
     418
    363419  </sect2>
    364420
    365421  <sect2 role="commands">
    366422    <title>Command Explanations</title>
    367 
    368     <para>
    369       <command>sed -e "..." -e "..." -i ...</command>: This
    370       command fixes detection of
    371       <application>libmng</application> 2.0.
    372     </para>
    373423
    374424    <para>
     
    404454      <parameter>-system-sqlite</parameter>: This switch enables use
    405455      of the system version of <application>SQLite</application>.
    406     </para>
    407 
    408     <para>
    409       <parameter>-no-nis</parameter>: This switch disables support
    410       for Network Information Service (NIS) which has been
    411       removed from recent versions of <application>Glibc</application>.
    412456    </para>
    413457
     
    434478      <title>Configuration Information</title>
    435479
    436       <para>
    437         Create the menu entries for installed applications by running the
    438         following commands <systemitem class="username">root</systemitem>
    439         user:
    440       </para>
    441 
    442       <para>
    443         If you installed <application>Qt5</application> in
    444         <filename class="directory">/usr</filename>, create an
    445         environment variable needed by certain packages.
    446         As the <systemitem class="username">root</systemitem> user:
    447       </para>
    448 
    449 <screen role="root"><userinput>cat &gt; /etc/profile.d/qt5.sh &lt;&lt; EOF
    450 <literal># Begin /etc/profile.d/qt5.sh
    451 
    452 QT5DIR=/usr
    453 export QT5DIR
    454 
    455 # End /etc/profile.d/qt5.sh</literal>
    456 EOF</userinput></screen>
     480      <note>
     481        <para>
     482          If you have installed <application>Qt5</application>
     483          in <filename class="directory">/usr</filename> you
     484          can skip this section.
     485        </para>
     486      </note>
    457487
    458488      <para>
     
    470500
    471501<screen role="root"><userinput>cat &gt;&gt; /etc/ld.so.conf &lt;&lt; EOF
    472 <literal># Begin Qt addition
    473 
    474 /opt/qt5/lib
    475 
    476 # End Qt addition</literal>
     502<literal># Begin Qt5 addition
     503
     504$QT5PREFIX/lib
     505
     506# End Qt5 addition</literal>
    477507EOF
    478508
     
    484514
    485515      <para>
    486         As the <systemitem class="username">root</systemitem> user, create
    487         the <filename>/etc/profile.d/qt5.sh</filename> file:
     516        If you have installed <xref linkend="qtchooser"/>, create
     517        the <filename>/etc/profile.d/qt5.sh</filename> file by
     518        running the following command as the
     519        <systemitem class="username">root</systemitem> user:
    488520      </para>
    489521
     
    491523<literal># Begin /etc/profile.d/qt5.sh
    492524
    493 QT5DIR=/opt/qt5
    494 
    495 pathappend /opt/qt5/bin           PATH
    496 pathappend /opt/qt5/lib/pkgconfig PKG_CONFIG_PATH
    497 
    498 export QT5DIR
     525pathappend $QT5PREFIX/lib/pkgconfig PKG_CONFIG_PATH
    499526
    500527# End /etc/profile.d/qt5.sh</literal>
    501528EOF</userinput></screen>
    502529
     530      <para>
     531        If you have not installed <xref linkend="qtchooser"/>,
     532        create the <filename>/etc/profile.d/qt5.sh</filename>
     533        file by running the following command as the
     534        <systemitem class="username">root</systemitem> user:
     535      </para>
     536
     537<screen role="root"><userinput>cat &gt; /etc/profile.d/qt5.sh &lt;&lt; EOF
     538<literal># Begin /etc/profile.d/qt5.sh
     539
     540pathappend $QT5BINDIR               PATH
     541pathappend $QT5PREFIX/lib/pkgconfig PKG_CONFIG_PATH
     542
     543# End /etc/profile.d/qt5.sh</literal>
     544EOF</userinput></screen>
     545
     546      <note>
     547        <para>
     548          If <xref linkend="qtchooser"/> is not installed and you
     549          also have <application>Qt4</application> installed,
     550          you will need to manually adjust the <envar>PATH</envar>
     551          variable depending on which <application>Qt</application>
     552          version is needed.
     553        </para>
     554      </note>
     555
    503556    </sect3>
    504557
    505    <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
    506                href="../../xincludes/setqt.xml"/>
    507558  </sect2>
    508559
     
    543594        </seg>
    544595        <seg>
    545           /usr/include/qt5,
    546           /usr/lib/qt5,
    547           /usr/share/doc/qt5, and
    548           /usr/share/qt5
    549           OR
    550           /opt/qt5 and
    551           /opt/qt-&qt5-version;
     596          $QT5PREFIX/include/qt5,
     597          $QT5PREFIX/lib/qt5,
     598          $QT5PREFIX/share/doc/qt5, and
     599          $QT5PREFIX/share/qt5
    552600        </seg>
    553601      </seglistitem>
Note: See TracChangeset for help on using the changeset viewer.