Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 12 Mar 2019 12:37:41 +0000 (UTC)
From:      Tobias Kortkamp <tobik@FreeBSD.org>
To:        doc-committers@freebsd.org, svn-doc-all@freebsd.org, svn-doc-head@freebsd.org
Subject:   svn commit: r52860 - in head/en_US.ISO8859-1/books/porters-handbook: makefiles special uses
Message-ID:  <201903121237.x2CCbf8R016427@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: tobik (ports committer)
Date: Tue Mar 12 12:37:40 2019
New Revision: 52860
URL: https://svnweb.freebsd.org/changeset/doc/52860

Log:
  Porter's Handbook: Add Meson section
  
  - Document new opt_MESON_{DIS,EN}ABLED helpers
  - Fix existing examples
  
  Approved by:	bcr
  Differential Revision:	https://reviews.freebsd.org/D19554

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

Modified: head/en_US.ISO8859-1/books/porters-handbook/makefiles/chapter.xml
==============================================================================
--- head/en_US.ISO8859-1/books/porters-handbook/makefiles/chapter.xml	Tue Mar 12 10:02:49 2019	(r52859)
+++ head/en_US.ISO8859-1/books/porters-handbook/makefiles/chapter.xml	Tue Mar 12 12:37:40 2019	(r52860)
@@ -6389,6 +6389,10 @@ FOO_CONFIGURE_ENABLE=	foo</programlisting>
 	      <literal>no</literal>, use <xref
 		linkend="options-meson_yes"/>.</para>
 
+	    <para>For arguments that take <literal>enabled</literal>
+	      or <literal>disabled</literal>, see <xref
+		linkend="options-meson_enabled"/>.</para>
+
 	    <para>For all other cases, use <xref
 		linkend="options-meson_on"/>.</para>
 	  </listitem>
@@ -6711,7 +6715,7 @@ CMAKE_ARGS+=	-DOPTIMIZE:BOOL=true
 	    <literal>-D<replaceable>entry</replaceable>:BOOL=false</literal>
 	    is appended to <varname>CONFIGURE_ARGS</varname>.
 	    <varname><replaceable>OPT</replaceable>_CMAKE_BOOL_OFF</varname>
-	    is the oposite,
+	    is the opposite,
 	    <literal>-D<replaceable>entry</replaceable>:BOOL=false</literal>
 	    is appended to <varname>CMAKE_ARGS</varname> when the
 	    option is selected, and
@@ -6782,15 +6786,15 @@ MESON_ARGS+=	-Dopt=2
 	    <varname><replaceable>OPT</replaceable>_MESON_TRUE</varname>
 	    then
 	    <literal>-D<replaceable>entry</replaceable>=true</literal>
-	    is appended to <varname>CMAKE_ARGS</varname>.  When option
+	    is appended to <varname>MESON_ARGS</varname>.  When option
 	    <replaceable>OPT</replaceable> is <emphasis>not</emphasis>
 	    selected,
 	    <literal>-D<replaceable>entry</replaceable>=false</literal>
-	    is appended to <varname>CONFIGURE_ARGS</varname>.
+	    is appended to <varname>MESON_ARGS</varname>.
 	    <varname><replaceable>OPT</replaceable>_MESON_FALSE</varname>
-	    is the oposite,
+	    is the opposite,
 	    <literal>-D<replaceable>entry</replaceable>=false</literal>
-	    is appended to <varname>CMAKE_ARGS</varname> when the
+	    is appended to <varname>MESON_ARGS</varname> when the
 	    option is selected, and
 	    <literal>-D<replaceable>entry</replaceable>=true</literal>
 	    when the option is <emphasis>not</emphasis> selected.  For
@@ -6825,15 +6829,15 @@ MESON_ARGS+=	-Dtest=false -Ddebug=false \
 	    <varname><replaceable>OPT</replaceable>_MESON_YES</varname>
 	    then
 	    <literal>-D<replaceable>entry</replaceable>=yes</literal>
-	    is appended to <varname>CMAKE_ARGS</varname>.  When option
+	    is appended to <varname>MESON_ARGS</varname>.  When option
 	    <replaceable>OPT</replaceable> is <emphasis>not</emphasis>
 	    selected,
 	    <literal>-D<replaceable>entry</replaceable>=no</literal>
-	    is appended to <varname>CONFIGURE_ARGS</varname>.
+	    is appended to <varname>MESON_ARGS</varname>.
 	    <varname><replaceable>OPT</replaceable>_MESON_NO</varname>
-	    is the oposite,
+	    is the opposite,
 	    <literal>-D<replaceable>entry</replaceable>=no</literal>
-	    is appended to <varname>CMAKE_ARGS</varname> when the
+	    is appended to <varname>MESON_ARGS</varname> when the
 	    option is selected, and
 	    <literal>-D<replaceable>entry</replaceable>=yes</literal>
 	    when the option is <emphasis>not</emphasis> selected.  For
@@ -6850,11 +6854,52 @@ OPT1_MESON_NO=	optimize</programlisting>
 .include &lt;bsd.port.options.mk&gt;
 
 .if ${PORT_OPTIONS:MOPT1}
-CMAKE_ARGS+=	-Dtest=yes -Ddebug=yes \
+MESON_ARGS+=	-Dtest=yes -Ddebug=yes \
 		-Doptimize=no
 .else
-CMAKE_ARGS+=	-Dtest=no -Ddebug=no \
+MESON_ARGS+=	-Dtest=no -Ddebug=no \
 		-Doptimize=yes
+.endif</programlisting>
+	</sect4>
+
+	<sect4 xml:id="options-meson_enabled">
+	  <title><varname><replaceable>OPT</replaceable>_MESON_ENABLED</varname>
+	    and
+	    <varname><replaceable>OPT</replaceable>_MESON_DISABLED</varname></title>
+
+	  <para>When option <replaceable>OPT</replaceable> is
+	    selected, for each <replaceable>entry</replaceable> in
+	    <varname><replaceable>OPT</replaceable>_MESON_ENABLED</varname>
+	    then
+	    <literal>-D<replaceable>entry</replaceable>=enabled</literal>
+	    is appended to <varname>MESON_ARGS</varname>.  When option
+	    <replaceable>OPT</replaceable> is <emphasis>not</emphasis>
+	    selected,
+	    <literal>-D<replaceable>entry</replaceable>=disabled</literal>
+	    is appended to <varname>MESON_ARGS</varname>.
+	    <varname><replaceable>OPT</replaceable>_MESON_DISABLED</varname>
+	    is the opposite,
+	    <literal>-D<replaceable>entry</replaceable>=disabled</literal>
+	    is appended to <varname>MESON_ARGS</varname> when the
+	    option is selected, and
+	    <literal>-D<replaceable>entry</replaceable>=enabled</literal>
+	    when the option is <emphasis>not</emphasis> selected.  For
+	    example:</para>
+
+	  <programlisting>OPTIONS_DEFINE=	OPT1
+OPT1_MESON_ENABLED=	test
+OPT1_MESON_DISABLED=	debug</programlisting>
+
+	  <para>is equivalent to:</para>
+
+	  <programlisting>OPTIONS_DEFINE=	OPT1
+
+.include &lt;bsd.port.options.mk&gt;
+
+.if ${PORT_OPTIONS:MOPT1}
+MESON_ARGS+=	-Dtest=enabled -Ddebug=disabled
+.else
+MESON_ARGS+=	-Dtest=disabled -Ddebug=enabled
 .endif</programlisting>
 	</sect4>
       </sect3>

Modified: head/en_US.ISO8859-1/books/porters-handbook/special/chapter.xml
==============================================================================
--- head/en_US.ISO8859-1/books/porters-handbook/special/chapter.xml	Tue Mar 12 10:02:49 2019	(r52859)
+++ head/en_US.ISO8859-1/books/porters-handbook/special/chapter.xml	Tue Mar 12 12:37:40 2019	(r52860)
@@ -1164,6 +1164,53 @@ byteorder-1.2.2     Unlicense/MIT
 	</note>
       </example>
     </sect2>
+
+    <sect2 xml:id="using-meson">
+      <title>Using <command>meson</command></title>
+
+      <para>For ports that use <application>Meson</application>,
+	define <literal>USES=meson</literal>.</para>
+
+      <table frame="none" xml:id="using-meson-variables">
+	<title>Variables for Ports That Use
+	  <command>meson</command></title>
+
+	<tgroup cols="2">
+	  <thead>
+	    <row>
+	      <entry>Variable</entry>
+	      <entry>Description</entry>
+	    </row>
+	  </thead>
+
+	  <tbody>
+	    <row>
+	      <entry><varname>MESON_ARGS</varname></entry>
+	      <entry>Port specific <application>Meson</application>
+		flags to be passed to the <command>meson</command>
+		binary.</entry>
+	    </row>
+
+	    <row>
+	      <entry><varname>MESON_BUILD_DIR</varname></entry>
+	      <entry>Path to the build directory relative to
+		<varname>WRKSRC</varname>.  Default is
+		<literal>_build</literal>.</entry>
+	    </row>
+	  </tbody>
+	</tgroup>
+      </table>
+
+      <example xml:id="using-meson-example">
+	<title><literal>USES=meson</literal> Example</title>
+
+	<para>This snippet demonstrates the use of
+	  <application>Meson</application> for a port.</para>
+
+	<programlisting>USES=		meson
+MESON_ARGS=	-Dfoo=enabled</programlisting>
+      </example>
+    </sect2>
   </sect1>
 
   <sect1 xml:id="using-autotools">

Modified: head/en_US.ISO8859-1/books/porters-handbook/uses/chapter.xml
==============================================================================
--- head/en_US.ISO8859-1/books/porters-handbook/uses/chapter.xml	Tue Mar 12 10:02:49 2019	(r52859)
+++ head/en_US.ISO8859-1/books/porters-handbook/uses/chapter.xml	Tue Mar 12 12:37:40 2019	(r52860)
@@ -1965,7 +1965,8 @@ USE_MATE=	menus:build intlhack</programlisting>
 
     <para>Possible arguments: (none)</para>
 
-    <para>Provide support for Meson based projects.</para>
+    <para>Provide support for Meson based projects.  For more
+      information see <xref linkend="using-meson" />.</para>
   </sect1>
 
   <sect1 xml:id="uses-metaport">



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201903121237.x2CCbf8R016427>