Changeset 5c7d5b25


Ignore:
Timestamp:
07/24/2014 01:27:37 PM (10 years ago)
Author:
Krejzi <krejzi@…>
Branches:
7.6-blfs, 7.6-systemd, kde5-14269, kde5-14686, systemd-13485
Children:
11d8b85
Parents:
359dc25
Message:

Rewrite Qt5 instructions to once again use qtchooser.

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

Location:
x/lib
Files:
1 edited
1 moved

Legend:

Unmodified
Added
Removed
  • x/lib/lib.xml

    r359dc25 r5c7d5b25  
    5656  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="pangomm.xml"/>
    5757  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="qt4.xml"/>
    58   <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="qt5-systemd.xml"/>
    5959  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="startup-notification.xml"/>
    6060  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="webkitgtk.xml"/>
  • x/lib/qt5-systemd.xml

    r359dc25 r5c7d5b25  
    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. -->
     98      <xref linkend="gst-plugins-base"/>,
     99      <xref linkend="harfbuzz"/>,
    100100      <xref linkend="icu"/> (required for QtWebKit),
    101101      <xref linkend="libjpeg"/>,
     
    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="qtprefix">
     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>Qt</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  </sect2>
     186
     187  <sect2 role="multi-install">
     188    <title>Dealing with multiple Qt versions</title>
     189
     190    <para>
     191      Both <application>Qt4</application> and
     192      <application>Qt5</application> executables have
     193      the same names and will override each other if
     194      they are installed in the same prefix. To overcome
     195      such problem, BLFS offers <xref linkend="qtchooser"/>,
     196      an utility used to switch between different
     197      <application>Qt</application> versions.
     198    </para>
     199
     200    <para>
     201      If <xref linkend="qtchooser"/> is to be used or
     202      if installing both <application>Qt4</application>
     203      and <application>Qt5</application> in
     204      <filename class="directory">/usr</filename>, the
     205      executables need to be installed to a non-standard
     206      location in order to avoid the conflict with
     207      <application>Qt4</application> ones. To accomplish
     208      that, set the following environment variable:
     209    </para>
     210
     211<screen><userinput>export QT5BINDIR=$QT5PREFIX/lib/qt5/bin</userinput></screen>
     212
     213    <para>
     214      If you choose not to install <xref linkend="qtchooser"/>
     215      or if you are not going to install
     216      <application>Qt4</application>, simply set the bindir to
     217      a <filename class="directory">bin</filename> subdir of the
     218      default prefix by setting the following environment variable:
     219    </para>
     220
     221<screen><userinput>export QT5BINDIR=$QT5PREFIX/bin</userinput></screen>
     222
     223  </sect2>
    132224
    133225  <sect2 role="installation">
     
    153245    </warning>
    154246
    155 <!-- ==== Method 1 ====== -->
    156     <bridgehead renderas="sect3">Method 1: Installing in /usr</bridgehead>
    157 
    158247    <para>
    159248      Install <application>Qt5</application> by running the
     
    161250    </para>
    162251
    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;
     252<screen><userinput>./configure -prefix         $QT5PREFIX                        \
     253            -sysconfdir     /etc/xdg                          \
     254            -bindir         $QT5BINDIR                        \
     255            -headerdir      $QT5PREFIX/include/qt5            \
     256            -archdatadir    $QT5PREFIX/lib/qt5                \
     257            -datadir        $QT5PREFIX/share/qt5              \
     258            -docdir         $QT5PREFIX/share/doc/qt5          \
     259            -translationdir $QT5PREFIX/share/qt5/translations \
     260            -examplesdir    $QT5PREFIX/share/doc/qt5/examples \
     261            -confirm-license \
     262            -opensource      \
     263            -dbus-linked     \
     264            -openssl-linked  \
     265            -system-harfbuzz \
     266            -system-sqlite   \
     267            -nomake examples \
     268            -optimized-qmake &amp;&amp;
    194269make</userinput></screen>
    195270
     
    206281<screen><userinput>find . -name "*.pc" -exec perl -pi -e "s, -L$PWD/?\S+,,g" {} \;</userinput></screen>
    207282
     283    <warning>
     284      <para>
     285        Make sure that <envar>QT5PREFIX</envar> and <envar>QT5BINDIR</envar>
     286        environment variables are set for the
     287        <systemitem class="username">root</systemitem> user too.
     288      </para>
     289    </warning>
     290
    208291    <para>
    209292      Now, as the <systemitem class="username">root</systemitem> user:
     
    218301    </para>
    219302
    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 \
     303<screen role="root"><userinput>sed -e "s:$PWD/qtbase:$QT5PREFIX/lib/qt5:g" \
     304    -i $QT5PREFIX/lib/qt5/mkspecs/modules/qt_lib_bootstrap_private.pri &amp;&amp;
     305
     306find $QT5PREFIX/lib/lib{qgsttools_p,Qt5*}.prl -exec sed -i -r \
    224307     '/^QMAKE_PRL_BUILD_DIR/d;s/(QMAKE_PRL_LIBS =).*/\1/' {} \;</userinput></screen>
    225308
    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
     309    <para>
     310      Install images and create the menu entries for installed
     311      applications by running the following commands
    292312      as the <systemitem class="username">root</systemitem> user:
    293313    </para>
    294314
    295 <screen role="root"><userinput>install -v -dm755 /usr/share/pixmaps/                  &amp;&amp;
     315<screen role="root"><userinput>install -v -dm755 /usr/share/pixmaps &amp;&amp;
    296316
    297317install -v -Dm644 qttools/src/assistant/assistant/images/assistant-128.png \
     
    299319
    300320install -v -Dm644 qttools/src/designer/src/designer/images/designer.png \
    301                   /usr/share/pixmaps/designer-qt5.png  &amp;&amp;
     321                  /usr/share/pixmaps/designer-qt5.png &amp;&amp;
    302322
    303323install -v -Dm644 qttools/src/linguist/linguist/images/icons/linguist-128-32.png \
    304                   /usr/share/pixmaps/linguist-qt5.png  &amp;&amp;
     324                  /usr/share/pixmaps/linguist-qt5.png &amp;&amp;
    305325
    306326install -v -Dm644 qttools/src/qdbus/qdbusviewer/images/qdbusviewer-128.png \
    307327                  /usr/share/pixmaps/qdbusviewer-qt5.png &amp;&amp;
    308328
    309 install -dm755 /usr/share/applications &amp;&amp;
     329install -v -dm755 /usr/share/applications &amp;&amp;
    310330
    311331cat &gt; /usr/share/applications/assistant-qt5.desktop &lt;&lt; EOF
     
    313333Name=Qt5 Assistant
    314334Comment=Shows Qt5 documentation and examples
    315 Exec=$QT5LINK/bin/assistant
     335Exec=$QT5BINDIR/assistant
    316336Icon=assistant-qt5.png
    317337Terminal=false
     
    326346GenericName=Interface Designer
    327347Comment=Design GUIs for Qt5 applications
    328 Exec=$QT5LINK/bin/designer
     348Exec=$QT5BINDIR/designer
    329349Icon=designer-qt5.png
    330350MimeType=application/x-designer;
     
    339359Name=Qt5 Linguist
    340360Comment=Add translations to Qt5 applications
    341 Exec=$QT5LINK/bin/linguist
     361Exec=$QT5BINDIR/linguist
    342362Icon=linguist-qt5.png
    343363MimeType=text/vnd.trolltech.linguist;application/x-linguist;
     
    353373GenericName=D-Bus Debugger
    354374Comment=Debug D-Bus applications
    355 Exec=$QT5LINK/bin/qdbusviewer
     375Exec=$QT5BINDIR/qdbusviewer
    356376Icon=qdbusviewer-qt5.png
    357377Terminal=false
     
    361381EOF</userinput></screen>
    362382
     383    <para>
     384      Some packages look for <application>Qt5</application> executables
     385      with <filename>-qt5</filename> suffix.
     386      If <application>Qt5</application> executables weren't installed in
     387      <filename class="directory">/usr/bin</filename>, run the following
     388      commands as the <systemitem class="username">root</systemitem> user:
     389    </para>
     390
     391<screen role="root"><userinput>for file in $QT5BINDIR/*; do
     392  ln -sfv $file /usr/bin/$(basename $file)-qt5
     393done</userinput></screen>
     394
    363395  </sect2>
    364396
    365397  <sect2 role="commands">
    366398    <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>
    373399
    374400    <para>
     
    404430      <parameter>-system-sqlite</parameter>: This switch enables use
    405431      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>.
    412432    </para>
    413433
     
    434454      <title>Configuration Information</title>
    435455
    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>
     456      <note>
     457        <para>
     458          If you have installed <application>Qt5</application>
     459          in <filename class="directory">/usr</filename> you
     460          can skip this section.
     461        </para>
     462      </note>
    457463
    458464      <para>
     
    470476
    471477<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>
     478<literal># Begin Qt5 addition
     479
     480$QT5PREFIX/lib
     481
     482# End Qt5 addition</literal>
    477483EOF
    478484
     
    484490
    485491      <para>
    486         As the <systemitem class="username">root</systemitem> user, create
    487         the <filename>/etc/profile.d/qt5.sh</filename> file:
     492        If you have installed <xref linkend="qtchooser"/>, create
     493        the <filename>/etc/profile.d/qt5.sh</filename> file by
     494        running the following command as the
     495        <systemitem class="username">root</systemitem> user:
    488496      </para>
    489497
     
    491499<literal># Begin /etc/profile.d/qt5.sh
    492500
    493 QT5DIR=/opt/qt5
    494 
    495 pathappend /opt/qt5/bin           PATH
    496 pathappend /opt/qt5/lib/pkgconfig PKG_CONFIG_PATH
    497 
    498 export QT5DIR
     501pathappend $QT5PREFIX/lib/pkgconfig PKG_CONFIG_PATH
    499502
    500503# End /etc/profile.d/qt5.sh</literal>
    501504EOF</userinput></screen>
    502505
     506      <para>
     507        If you have not installed <xref linkend="qtchooser"/>,
     508        create the <filename>/etc/profile.d/qt5.sh</filename>
     509        file by running the following command as the
     510        <systemitem class="username">root</systemitem> user:
     511      </para>
     512
     513<screen role="root"><userinput>cat &gt; /etc/profile.d/qt5.sh &lt;&lt; EOF
     514<literal># Begin /etc/profile.d/qt5.sh
     515
     516pathappend $QT5BINDIR               PATH
     517pathappend $QT5PREFIX/lib/pkgconfig PKG_CONFIG_PATH
     518
     519# End /etc/profile.d/qt5.sh</literal>
     520EOF</userinput></screen>
     521
     522      <note>
     523        <para>
     524          If you also have <application>Qt4</application> installed,
     525          you will need to manually adjust the <envar>PATH</envar>
     526          variable depending on which <application>Qt</application>
     527          version is needed.
     528        </para>
     529      </note>
     530
    503531    </sect3>
    504532
    505    <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
    506                href="../../xincludes/setqt.xml"/>
    507533  </sect2>
    508534
     
    543569        </seg>
    544570        <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;
     571          $QT5PREFIX/include/qt5,
     572          $QT5PREFIX/lib/qt5,
     573          $QT5PREFIX/share/doc/qt5, and
     574          $QT5PREFIX/share/qt5
    552575        </seg>
    553576      </seglistitem>
Note: See TracChangeset for help on using the changeset viewer.