svn commit: r44435 - head/en_US.ISO8859-1/books/porters-handbook/special

Warren Block wblock at FreeBSD.org
Fri Apr 4 01:46:32 UTC 2014


Author: wblock
Date: Fri Apr  4 01:46:32 2014
New Revision: 44435
URL: http://svnweb.freebsd.org/changeset/doc/44435

Log:
  Update Qt and KDE sections.  Modified version of patch supplied with PR.
  
  PR:		docs/187473
  Submitted by:	Max Brazhnikov <makc at FreeBSD.org>

Modified:
  head/en_US.ISO8859-1/books/porters-handbook/special/chapter.xml

Modified: head/en_US.ISO8859-1/books/porters-handbook/special/chapter.xml
==============================================================================
--- head/en_US.ISO8859-1/books/porters-handbook/special/chapter.xml	Fri Apr  4 01:25:03 2014	(r44434)
+++ head/en_US.ISO8859-1/books/porters-handbook/special/chapter.xml	Fri Apr  4 01:46:32 2014	(r44435)
@@ -1281,137 +1281,102 @@ USE_XORG=	x11 xpm</programlisting>
     <sect2 xml:id="qt-common">
       <title>Ports That Require Qt</title>
 
+      <para>The Ports Collection provides support for Qt 4 and Qt 5
+	frameworks with the <varname>USE_QT<replaceable>x</replaceable></varname> variable,
+	where <replaceable>x</replaceable> is <literal>4</literal> or <literal>5</literal>. <varname>USE_QT<replaceable>x</replaceable></varname> should be
+	set to the list of required Qt components (libraries,
+	tools, plugins).  The Qt 4 and Qt 5 frameworks are quite similar.
+	The main difference is the set of supported components.</para>
+
+      <para>The Qt framework exports a number of variables which can be used
+	by ports, some of them listed below:</para>
+
       <table frame="none">
-	<title>Variables for Ports That Use Qt</title>
+	<title>Variables Provided to Ports That Use Qt</title>
 
 	<tgroup cols="2">
 	  <tbody>
 	    <row>
-	      <entry><varname>USE_QT4</varname></entry>
-	      <entry>Specify tool and library dependencies for ports
-		that use Qt 4.  See
-		  <link linkend="qt4-components">Qt 4 component
-		  selection</link> for more details.</entry>
-	    </row>
-
-	    <row>
 	      <entry><varname>QT_PREFIX</varname></entry>
-	      <entry>Set to the path where Qt installed to
-		(read-only variable).</entry>
+	      <entry>Set to the path where Qt was installed
+		(<literal>${LOCALBASE}</literal>).</entry>
 	    </row>
 
 	    <row>
-	      <entry><varname>MOC</varname></entry>
-	      <entry>Set to the path of <command>moc</command>
-		(read-only variable).  Default set according to
-		<varname>USE_QT_VER</varname> value.</entry>
+	      <entry><varname>QMAKE</varname></entry>
+	      <entry>Full path to <command>qmake</command> binary.</entry>
 	    </row>
 
 	    <row>
-	      <entry><varname>QTCPPFLAGS</varname></entry>
-	      <entry>Additional compiler flags passed via
-		<varname>CONFIGURE_ENV</varname> for Qt toolkit.
-		Default set according to
-		<varname>USE_QT_VER</varname>.</entry>
+	      <entry><varname>LRELEASE</varname></entry>
+	      <entry>Full path to <command>lrelease</command> utility.</entry>
 	    </row>
 
 	    <row>
-	      <entry><varname>QTCFGLIBS</varname></entry>
-	      <entry>Additional libraries for linking passed via
-		<varname>CONFIGURE_ENV</varname> for Qt toolkit.
-		Default set according to
-		<varname>USE_QT_VER</varname>.</entry>
+	      <entry><varname>MOC</varname></entry>
+	      <entry>Full path to <command>moc</command>.</entry>
 	    </row>
 
 	    <row>
-	      <entry><varname>QTNONSTANDARD</varname></entry>
-	      <entry>Suppress modification of
-		<varname>CONFIGURE_ENV</varname>,
-		<varname>CONFIGURE_ARGS</varname>,
-		<varname>CPPFLAGS</varname> and
-		<varname>MAKE_ENV</varname>.</entry>
+	      <entry><varname>RCC</varname></entry>
+	      <entry>Full path to <command>rcc</command>.</entry>
 	    </row>
-	  </tbody>
-	</tgroup>
-      </table>
-
-      <table frame="none">
-	<title>Additional Variables for Ports That Use Qt
-	  4.x</title>
 
-	<tgroup cols="2">
-	  <tbody>
 	    <row>
 	      <entry><varname>UIC</varname></entry>
-	      <entry>Set to the path of <command>uic</command>
-		(read-only variable).</entry>
-	    </row>
-
-	    <row>
-	      <entry><varname>QMAKE</varname></entry>
-	      <entry>Set to the path of <command>qmake</command>
-		(read-only variable).</entry>
-	    </row>
-
-	    <row>
-	      <entry><varname>QMAKESPEC</varname></entry>
-	      <entry>Set to the path of configuration file for
-		<command>qmake</command> (read-only
-		variable).</entry>
-	    </row>
-
-	    <row>
-	      <entry><varname>QMAKEFLAGS</varname></entry>
-	      <entry>Additional flags for
-		<command>qmake</command>.</entry>
+	      <entry>Full path to <command>uic</command>.</entry>
 	    </row>
 
 	    <row>
 	      <entry><varname>QT_INCDIR</varname></entry>
-	      <entry>Set to Qt 4 include directories (read-only
-		variable).</entry>
+	      <entry>Qt include directory.</entry>
 	    </row>
 
 	    <row>
 	      <entry><varname>QT_LIBDIR</varname></entry>
-	      <entry>Set to Qt 4 libraries path (read-only
-		variable).</entry>
+	      <entry>Qt libraries path.</entry>
 	    </row>
 
 	    <row>
 	      <entry><varname>QT_PLUGINDIR</varname></entry>
-	      <entry>Set to Qt 4 plugins path (read-only
-		variable).</entry>
+	      <entry>Qt plugins path.</entry>
 	    </row>
 	  </tbody>
 	</tgroup>
       </table>
 
-      <para>When <varname>USE_QT4</varname> is set, the following
+      <para>When using the Qt framework, these
 	settings are deployed:</para>
 
       <programlisting>CONFIGURE_ARGS+=	--with-qt-includes=${QT_INCDIR} \
 			--with-qt-libraries=${QT_LIBDIR} \
 			--with-extra-libs=${LOCALBASE}/lib \
 			--with-extra-includes=${LOCALBASE}/include
-CONFIGURE_ENV+=	MOC="${MOC}" UIC="${UIC}" LIBS="${QTCFGLIBS}" \
-		QMAKE="${QMAKE}" QMAKESPEC="${QMAKESPEC}" QTDIR="${QT_PREFIX}"
-MAKE_ENV+=	QMAKESPEC="${QMAKESPEC}"
 
-PLIST_SUB+=	QT_INCDIR_REL=${QT_INCDIR_REL} \
-		QT_LIBDIR_REL=${QT_LIBDIR_REL} \
-		QT_PLUGINDIR_REL=${QT_PLUGINDIR_REL}</programlisting>
+CONFIGURE_ENV+=	QTDIR="${QT_PREFIX}" QMAKE="${QMAKE}" \
+		MOC="${MOC}" RCC="${RCC}" UIC="${UIC}" \
+		QMAKESPEC="${QMAKESPEC}"
+
+PLIST_SUB+=	QT_INCDIR=${QT_INCDIR_REL} \
+		QT_LIBDIR=${QT_LIBDIR_REL} \
+		QT_PLUGINDIR=${QT_PLUGINDIR_REL}</programlisting>
+
+      <para>Some configure scripts do not support the arguments above.
+	To suppress modification of<varname>CONFIGURE_ENV</varname> and
+	<varname>CONFIGURE_ARGS</varname>, set the
+	<varname>QT_NONSTANDARD</varname> variable.</para>
+
     </sect2>
 
-    <sect2 xml:id="qt4-components">
+    <sect2 xml:id="qt-components">
       <title>Component Selection</title>
 
-      <para>Individual Qt 4 tool and library dependencies must be
-	specified in the <varname>USE_QT4</varname> variable.  Every
-	component can be suffixed by either
+      <para>Individual Qt tool and library dependencies must be
+	specified in the <varname>USE_QT<replaceable>x</replaceable></varname> variable.  Every
+	component can be suffixed with
 	<literal>_build</literal> or <literal>_run</literal>, the
 	suffix indicating whether the component should be depended
-	on at buildtime or runtime, respectively.  If unsuffixed,
+	on at buildtime or runtime.  If unsuffixed,
 	the component will be depended on at both build- and
 	runtime.  Usually, library components should be specified
 	unsuffixed, tool components should be specified with the
@@ -1419,11 +1384,12 @@ PLIST_SUB+=	QT_INCDIR_REL=${QT_INCDIR_RE
 	should be specified with the <literal>_run</literal> suffix.
 	The most commonly used components are listed below (all
 	available components are listed in
-	<varname>_USE_QT4_ALL</varname> in
+	<varname>_USE_QT_ALL</varname>, <varname>_USE_QT4_ONLY</varname>,
+	and <varname>_USE_QT5_ONLY</varname> variables in
 	<filename>/usr/ports/Mk/bsd.qt.mk</filename>):</para>
 
       <table frame="none">
-	<title>Available Qt 4 Library Components</title>
+	<title>Available Qt Library Components</title>
 
 	<tgroup cols="2">
 	  <thead>
@@ -1435,9 +1401,18 @@ PLIST_SUB+=	QT_INCDIR_REL=${QT_INCDIR_RE
 
 	  <tbody>
 	    <row>
+	      <entry><literal>core</literal></entry>
+	      <entry>core library (Qt 5 only)</entry>
+	    </row>
+
+	    <row>
 	      <entry><literal>corelib</literal></entry>
-	      <entry>core library (can be omitted unless the port
-		uses nothing but <literal>corelib</literal>)</entry>
+	      <entry>core library (Qt 4 only)</entry>
+	    </row>
+
+	    <row>
+	      <entry><literal>dbus</literal></entry>
+	      <entry>Qt DBus library</entry>
 	    </row>
 
 	    <row>
@@ -1452,43 +1427,43 @@ PLIST_SUB+=	QT_INCDIR_REL=${QT_INCDIR_RE
 
 	    <row>
 	      <entry><literal>opengl</literal></entry>
-	      <entry>OpenGL library</entry>
+	      <entry>Qt OpenGL library</entry>
 	    </row>
 
 	    <row>
-	      <entry><literal>qt3support</literal></entry>
-	      <entry>Qt 3 compatibility library</entry>
+	      <entry><literal>script</literal></entry>
+	      <entry>script library</entry>
 	    </row>
 
 	    <row>
-	      <entry><literal>qtestlib</literal></entry>
-	      <entry>unit testing library</entry>
+	      <entry><literal>sql</literal></entry>
+	      <entry>SQL library</entry>
 	    </row>
 
 	    <row>
-	      <entry><literal>script</literal></entry>
-	      <entry>script library</entry>
+	      <entry><literal>testlib</literal></entry>
+	      <entry>unit testing library</entry>
 	    </row>
 
 	    <row>
-	      <entry><literal>sql</literal></entry>
-	      <entry>SQL library</entry>
+	      <entry><literal>webkit</literal></entry>
+	      <entry>Qt WebKit library</entry>
 	    </row>
 
 	    <row>
 	      <entry><literal>xml</literal></entry>
-	      <entry>XML library</entry>
+	      <entry>Qt XML library</entry>
 	    </row>
 	  </tbody>
 	</tgroup>
       </table>
 
-      <para>You can determine which libraries the application
-	depends on, by running <command>ldd</command> on the main
+      <para>To determine the libraries an application
+	depends on, run <command>ldd</command> on the main
 	executable after a successful compilation.</para>
 
       <table frame="none">
-	<title>Available Qt 4 Tool Components</title>
+	<title>Available Qt Tool Components</title>
 
 	<tgroup cols="2">
 	  <thead>
@@ -1500,36 +1475,55 @@ PLIST_SUB+=	QT_INCDIR_REL=${QT_INCDIR_RE
 
 	  <tbody>
 	    <row>
-	      <entry><literal>moc</literal></entry>
-	      <entry>meta object compiler (needed for almost
-		every Qt application at buildtime)</entry>
+	      <entry><literal>qmake</literal></entry>
+	      <entry>Makefile generator/build utility</entry>
 	    </row>
 
 	    <row>
-	      <entry><literal>qmake</literal></entry>
-	      <entry>Makefile generator / build utility</entry>
+	      <entry><literal>buildtools</literal></entry>
+	      <entry>build tools (<command>moc</command>,
+		<command>rcc</command>), needed for almost
+		every Qt application (Qt 5 only)</entry>
+	    </row>
+
+	    <row>
+	      <entry><literal>linguisttools</literal></entry>
+	      <entry>localization tools: <command>lrelease</command>,
+		<command>lupdate</command> (Qt 5 only)</entry>
+	    </row>
+
+	    <row>
+	      <entry><literal>linguist</literal></entry>
+	      <entry>localization tools: <command>lrelease</command>,
+		<command>lupdate</command> (Qt 4 only)</entry>
+	    </row>
+
+	    <row>
+	      <entry><literal>moc</literal></entry>
+	      <entry>meta object compiler, needed for almost
+		every Qt application at buildtime (Qt 4 only)</entry>
 	    </row>
 
 	    <row>
 	      <entry><literal>rcc</literal></entry>
-	      <entry>resource compiler (needed if the application
+	      <entry>resource compiler, needed if the application
 		comes with <filename>*.rc</filename> or
-		<filename>*.qrc</filename> files)</entry>
+		<filename>*.qrc</filename> files (Qt 4 only)</entry>
 	    </row>
 
 	    <row>
 	      <entry><literal>uic</literal></entry>
-	      <entry>user interface compiler (needed if the
+	      <entry>user interface compiler, needed if the
 		application comes with <filename>*.ui</filename>
-		files created by Qt Designer - in practice, every Qt
-		application with a GUI)</entry>
+		files, in practice, every Qt
+		application with a GUI (Qt 4 only)</entry>
 	    </row>
 	  </tbody>
 	</tgroup>
       </table>
 
       <table frame="none">
-	<title>Available Qt 4 Plugin Components</title>
+	<title>Available Qt Plugin Components</title>
 
 	<tgroup cols="2">
 	  <thead>
@@ -1542,14 +1536,14 @@ PLIST_SUB+=	QT_INCDIR_REL=${QT_INCDIR_RE
 	  <tbody>
 	    <row>
 	      <entry><literal>iconengines</literal></entry>
-	      <entry>SVG icon engine plugin (if the application
-		ships SVG icons)</entry>
+	      <entry>SVG icon engine plugin, needed if the application
+		ships SVG icons (Qt 4 only)</entry>
 	    </row>
 
 	    <row>
 	      <entry><literal>imageformats</literal></entry>
-	      <entry>imageformat plugins for GIF, JPEG, MNG and
-		SVG (if the application ships image files)</entry>
+	      <entry>plugins for TGA, TIFF, and MNG
+		image formats</entry>
 	    </row>
 	  </tbody>
 	</tgroup>
@@ -1577,6 +1571,24 @@ PLIST_SUB+=	QT_INCDIR_REL=${QT_INCDIR_RE
     <sect2 xml:id="using-qmake">
       <title>Using <command>qmake</command></title>
 
+
+      <para>If the application provides a
+	<application>qmake</application> project file
+	(<filename>*.pro</filename>), define
+	<literal>USES= qmake</literal> along with
+	<literal>USE_QT<replaceable>x</replaceable></literal>.  Note
+	that <literal>USES= qmake</literal> already implies a build
+	dependency on qmake, therefore the qmake component can be
+	omitted from
+	<literal>USE_QT<replaceable>x</replaceable></literal>.
+	Similar to <link
+	  linkend="using-cmake"><application>CMake</application></link>,
+	<application>qmake</application> supports out-of-source
+	builds, which can be enabled by specifying the
+	<literal>outsource</literal> argument (see <link
+	  linkend="using-qmake-example"><literal>USES= qmake</literal>
+	example</link>).</para>
+
       <table frame="none">
 	<title>Variables for Ports That Use
 	  <command>qmake</command></title>
@@ -1592,7 +1604,7 @@ PLIST_SUB+=	QT_INCDIR_REL=${QT_INCDIR_RE
 	  <tbody>
 	    <row>
 	      <entry><varname>QMAKE_ARGS</varname></entry>
-	      <entry>Port specific <application>QMake</application>
+	      <entry>Port specific <application>qmake</application>
 		flags to be passed to the <command>qmake</command>
 		binary.</entry>
 	    </row>
@@ -1605,33 +1617,37 @@ PLIST_SUB+=	QT_INCDIR_REL=${QT_INCDIR_RE
 	    </row>
 
 	    <row>
-	      <entry><varname>QMAKE_PRO</varname></entry>
-	      <entry>Name of the project <filename>.pro</filename>
-		file.  The default is empty (using
-		autodetection).</entry>
+	      <entry><varname>QMAKE_SOURCE_PATH</varname></entry>
+
+	      <entry>Path to qmake project files
+		(<filename>.pro</filename>).  The default is
+		<literal>${WRKSRC}</literal> if an
+		out-of-source build is requested, empty
+		otherwise.</entry>
 	    </row>
 	  </tbody>
 	</tgroup>
       </table>
 
-      <para>If the application does not provide a
-	<filename>configure</filename> script but a
-	<filename>.pro</filename> file, you can use the
-	following:</para>
+      <example xml:id="using-qmake-example">
+	<title><literal>USES= qmake</literal> Example</title>
+
+	<para>This snippet demonstrates the use of
+	  <application>qmake</application> for a Qt 4 port:</para>
 
-      <programlisting>USES=	qmake
-USE_QT4=	qmake_build</programlisting>
+	<programlisting>USES=			qmake:outsource
+USE_QT4=	moc_build
+</programlisting>
 
-      <para><literal>USES=qmake</literal> instructs the port to
-	use <command>qmake</command> for configuring.
-	Note that <literal>USES=qmake</literal> does not imply a
-	dependency on Qt 4 <command>qmake</command>, thus
-	<literal>USE_QT4</literal> has to be populated with the
-	<literal>qmake_build</literal> component.</para>
+	<para>For a Qt 5 port:</para>
+	<programlisting>USES=	qmake:outsource
+USE_QT5=	buildtools_build
+</programlisting>
+      </example>
 
-      <para>Qt applications often are written to be cross-platform
+      <para>Qt applications are often written to be cross-platform
 	and often X11/Unix is not the platform they are developed
-	on, which in turn often leads to certain loose ends,
+	on, which in turn leads to certain loose ends,
 	like:</para>
 
       <itemizedlist>
@@ -1670,7 +1686,7 @@ USE_QT4=	qmake_build</programlisting>
     <sect2 xml:id="kde4-variables">
       <title>KDE 4 Variable Definitions</title>
 
-      <para>If your application depends on KDE 4.x, set
+      <para>If the application depends on KDE 4, set
 	<varname>USE_KDE4</varname> to the list of required
 	components.  <literal>_build</literal> and
 	<literal>_run</literal> suffixes can be used to force
@@ -1702,44 +1718,38 @@ USE_QT4=	qmake_build</programlisting>
 
 	    <row>
 	      <entry><literal>kdelibs</literal></entry>
-	      <entry>KDE Developer Platform</entry>
+	      <entry>KDE core libraries</entry>
 	    </row>
 
 	    <row>
 	      <entry><literal>kdeprefix</literal></entry>
 	      <entry>If set, port will be installed into
-		<literal>${KDE4_PREFIX}</literal> instead of
-		<literal>${LOCALBASE}</literal></entry>
-	    </row>
-
-	    <row>
-	      <entry><literal>sharedmime</literal></entry>
-	      <entry>MIME types database for KDE ports</entry>
+		<literal>${KDE4_PREFIX}</literal></entry>
 	    </row>
 
 	    <row>
 	      <entry><literal>automoc4</literal></entry>
-	      <entry>Automatic moc for Qt 4 packages</entry>
+	      <entry>Build tool to automatically generate moc files</entry>
 	    </row>
 
 	    <row>
 	      <entry><literal>akonadi</literal></entry>
-	      <entry>Storage server for KDE-Pim</entry>
+	      <entry>Storage server for KDE PIM data</entry>
 	    </row>
 
 	    <row>
 	      <entry><literal>soprano</literal></entry>
-	      <entry>Qt 4 RDF framework</entry>
+	      <entry>Library for Resource Description Framework (RDF)</entry>
 	    </row>
 
 	    <row>
 	      <entry><literal>strigi</literal></entry>
-	      <entry>Desktop search daemon</entry>
+	      <entry>Strigi desktop search library</entry>
 	    </row>
 
 	    <row>
 	      <entry><literal>libkcddb</literal></entry>
-	      <entry>KDE CDDB library</entry>
+	      <entry>KDE CDDB (compact disc database) library</entry>
 	    </row>
 
 	    <row>
@@ -1766,7 +1776,7 @@ USE_QT4=	qmake_build</programlisting>
 
 	    <row>
 	      <entry><literal>libkipi</literal></entry>
-	      <entry> KDE Image Plugin Interface</entry>
+	      <entry>KDE Image Plugin Interface</entry>
 	    </row>
 
 	    <row>
@@ -1782,17 +1792,17 @@ USE_QT4=	qmake_build</programlisting>
 
 	    <row>
 	      <entry><literal>pimlibs</literal></entry>
-	      <entry>KDE-Pim libraries</entry>
+	      <entry>Personal information management libraries</entry>
 	    </row>
 
 	    <row>
 	      <entry><literal>kate</literal></entry>
-	      <entry>Text editor framework</entry>
+	      <entry>Advanced text editor framework</entry>
 	    </row>
 
 	    <row>
 	      <entry><literal>marble</literal></entry>
-	      <entry>Virtual globe</entry>
+	      <entry>Virtual globe and world atlas</entry>
 	    </row>
 
 	    <row>
@@ -1828,15 +1838,17 @@ USE_QT4=	qmake_build</programlisting>
 	</tgroup>
       </table>
 
-      <para>KDE 4.x ports are installed into
-	<varname>KDE4_PREFIX</varname>, which is
-	<filename>/usr/local/kde4</filename> currently.  This is
+      <para>KDE 4 ports are installed into
+	<varname>KDE4_PREFIX</varname>.  This is
 	achieved by specifying the <literal>kdeprefix</literal>
 	component, which overrides the default
-	<varname>PREFIX</varname>.  The ports however respect any
-	<varname>PREFIX</varname> set via <envar>MAKEFLAGS</envar>
+	<varname>PREFIX</varname>.  The ports, however, respect any
+	<varname>PREFIX</varname> set via the <envar>MAKEFLAGS</envar>
 	environment variable and/or <command>make</command>
-	arguments.</para>
+	arguments.  Currently <varname>KDE4_PREFIX</varname>
+	is identical to the default <varname>PREFIX</varname>,
+	<literal>${LOCALBASE}</literal>.
+      </para>
 
       <example xml:id="kde4-components-example">
 	<title><varname>USE_KDE4</varname> Example</title>


More information about the svn-doc-all mailing list