git.iko.soy/typeable/nixpkgs
on master help sign in
manual: document Qt packaging tools
commit79be4a769f2367b450eef88f064cbf6d36d0d9bd authorThomas Tuegel <ttuegel@gmail.com> dateSun 27 Sep 2015, 16:06 (11 years ago) parentc20b7ba
2 files changed+67−1
doc/language-support.xml+66 doc/stdenv.xml+1−1
doc/language-support.xml+66
@@ -981,6 +981,72 @@ stdenv.mkDerivation {
981981</programlisting>
982982</section>
983983
984+<section xml:id="sec-language-qt"><title>Qt</title>
985+
986+<para>The information in this section applies to Qt 5.5 and later.</para>
987+
988+<para>Qt is an application development toolkit for C++. Although it is
989+not a distinct programming language, there are special considerations
990+for packaging Qt-based programs and libraries. A small set of tools
991+and conventions has grown out of these considerations.</para>
992+
993+<section xml:id="ssec-qt-libraries"><title>Libraries</title>
994+
995+<para>Packages that provide libraries should be listed in
996+<varname>qt5LibsFun</varname> so that the library is built with each
997+Qt version. A set of packages is provided for each version of Qt; for
998+example, <varname>qt5Libs</varname> always provides libraries built
999+with the latest version, <varname>qt55Libs</varname> provides
1000+libraries built with Qt 5.5, and so on. To avoid version conflicts, no
1001+top-level attributes are created for these packages.</para>
1002+
1003+</section>
1004+
1005+<section xml:id="ssec-qt-programs"><title>Programs</title>
1006+
1007+<para>Application packages do not need to be built with every Qt
1008+version. To ensure consistency between the package's dependencies,
1009+call the package with <literal>qt5Libs.callPackage</literal> instead
1010+of the usual <literal>callPackage</literal>. An older version may be
1011+selected in case of incompatibility. For example, to build with Qt
1012+5.5, call the package with
1013+<literal>qt55Libs.callPackage</literal>.</para>
1014+
1015+<para>Several environment variables must be set at runtime for Qt
1016+applications to function correctly, including:</para>
1017+
1018+<itemizedlist>
1019+ <listitem><para><envar>QT_PLUGIN_PATH</envar></para></listitem>
1020+ <listitem><para><envar>QML_IMPORT_PATH</envar></para></listitem>
1021+ <listitem><para><envar>QML2_IMPORT_PATH</envar></para></listitem>
1022+ <listitem><para><envar>XDG_DATA_DIRS</envar></para></listitem>
1023+</itemizedlist>
1024+
1025+<para>To ensure that these are set correctly, the program must be wrapped by
1026+invoking <literal>wrapQtProgram <replaceable>program</replaceable></literal>
1027+during installation (for example, during
1028+<literal>fixupPhase</literal>). <literal>wrapQtProgram</literal>
1029+accepts the same options as <literal>makeWrapper</literal>.
1030+</para>
1031+
1032+</section>
1033+
1034+<section xml:id="ssec-qt-kde"><title>KDE</title>
1035+
1036+<para>Many of the considerations above also apply to KDE packages,
1037+especially the need to set the correct environment variables at
1038+runtime. To ensure that this is done, invoke <literal>wrapKDEProgram
1039+<replaceable>program</replaceable></literal> during
1040+installation. <literal>wrapKDEProgram</literal> also generates a
1041+<literal>ksycoca</literal> database so that required data and services
1042+can be found. Like its Qt counterpart,
1043+<literal>wrapKDEProgram</literal> accepts the same options as
1044+<literal>makeWrapper</literal>.</para>
1045+
1046+</section>
1047+
1048+</section>
1049+
9841050<!--
9851051<section><title>Haskell</title>
9861052
doc/stdenv.xml+1−1
@@ -1204,7 +1204,7 @@ echo @foo@
12041204 </varlistentry>
12051205
12061206 <varlistentry>
1207− <term>Qt</term>
1207+ <term>Qt 4</term>
12081208 <listitem><para>Sets the <envar>QTDIR</envar> environment variable
12091209 to Qt’s path.</para></listitem>
12101210 </varlistentry>