svn commit: r51790 - in head/en_US.ISO8859-1/books/porters-handbook: makefiles slow-porting

Tobias Kortkamp <[email protected]>
Newsgroups gmane.os.freebsd.devel.cvs.doc
Message-ID <[email protected]>
Author: tobik (ports committer)
Date: Thu Jun  7 07:58:22 2018
New Revision: 51790
URL: https://svnweb.freebsd.org/changeset/doc/51790

Log:
  Document BINARY_ALIAS in the Porter's Handbook
  
  Approved by:	mat
  Differential Revision:	https://reviews.freebsd.org/D15666

Modified:
  head/en_US.ISO8859-1/books/porters-handbook/makefiles/chapter.xml
  head/en_US.ISO8859-1/books/porters-handbook/slow-porting/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	Thu Jun  7 03:38:30 2018	(r51789)
+++ head/en_US.ISO8859-1/books/porters-handbook/makefiles/chapter.xml	Thu Jun  7 07:58:22 2018	(r51790)
@@ -8104,4 +8104,54 @@ bind910</screen>
 	files.</para>
     </sect2>
   </sect1>
+
+  <sect1 xml:id="binary-alias">
+    <title>Use <varname>BINARY_ALIAS</varname> to Rename Commands
+      Instead of Patching the Build</title>
+
+    <para>When <varname>BINARY_ALIAS</varname> is defined it will
+      create symlinks of the given commands in a directory which
+      will be prepended to <varname>PATH</varname>.</para>
+
+    <para>Use it to substitute hardcoded commands the build phase
+      relies on without having to patch any build files.</para>
+
+    <example xml:id="binary-alias-ex1">
+      <title>Using <varname>BINARY_ALIAS</varname> to Make
+	<command>gsed</command> Available as
+	<command>sed</command></title>
+
+      <para>Some ports expect <command>sed</command> to behave like
+	<application>GNU sed</application> and use features that
+	&man.sed.1; does not provide.
+	<application>GNU sed</application> is available from
+	<package role="port">textproc/gsed</package> on &os;.</para>
+
+      <para>Use <varname>BINARY_ALIAS</varname> to substitute
+	<command>sed</command> with <command>gsed</command>
+	for the duration of the build:</para>
+
+      <programlisting>BUILD_DEPENDS=	gsed:textproc/gsed
+...
+BINARY_ALIAS=	sed=gsed</programlisting>
+    </example>
+
+    <example xml:id="binary-alias-ex2">
+      <title>Using <varname>BINARY_ALIAS</varname> to Provide Aliases
+	for Hardcoded <command>python3</command> Commands</title>
+
+      <para>A port that has a hardcoded reference to
+	<command>python3</command> in its build scripts will need
+	to have it available in <varname>PATH</varname> at build
+	time.  Use <varname>BINARY_ALIAS</varname> to create an alias
+	that points to the right Python 3 binary:</para>
+
+      <programlisting>USES=	python:3.4+,build
+...
+BINARY_ALIAS=	python3=${PYTHON_CMD}</programlisting>
+
+      <para>See <xref linkend="using-python" /> for more information
+	about <literal>USES=python</literal>.</para>
+    </example>
+  </sect1>
 </chapter>

Modified: head/en_US.ISO8859-1/books/porters-handbook/slow-porting/chapter.xml
==============================================================================
--- head/en_US.ISO8859-1/books/porters-handbook/slow-porting/chapter.xml	Thu Jun  7 03:38:30 2018	(r51789)
+++ head/en_US.ISO8859-1/books/porters-handbook/slow-porting/chapter.xml	Thu Jun  7 07:58:22 2018	(r51790)
@@ -270,6 +270,13 @@
       generate updated patch files in the <filename>files</filename>
       directory.</para>
 
+    <tip>
+      <para>Use <varname>BINARY_ALIAS</varname> to substitute
+	hardcoded commands during the build and avoid patching
+	build files.  See <xref linkend="binary-alias" /> for
+	more information.</para>
+    </tip>
+
     <sect2 xml:id="slow-patch-rules">
       <title>General Rules for Patching</title>
 
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-doc-all
To unsubscribe, send any mail to "[email protected]"
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.