Mon Nov 8 22:21:33 2021 UTC ()
fixes.xml: add more details about REPLACE_* variables

Address PR pkg/56301 from J. Lewis Muir. I have added further details
about specific variables, and given more general information about
where they may be located. (While here, spell "Perl" consistently.)


(gutteridge)
diff -r1.164 -r1.165 pkgsrc/doc/guide/files/fixes.xml

cvs diff -r1.164 -r1.165 pkgsrc/doc/guide/files/fixes.xml (expand / switch to unified diff)

--- pkgsrc/doc/guide/files/fixes.xml 2021/08/23 18:38:16 1.164
+++ pkgsrc/doc/guide/files/fixes.xml 2021/11/08 22:21:33 1.165
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1<!-- $NetBSD: fixes.xml,v 1.164 2021/08/23 18:38:16 wiz Exp $ --> 1<!-- $NetBSD: fixes.xml,v 1.165 2021/11/08 22:21:33 gutteridge Exp $ -->
2 2
3<chapter id="fixes"> <?dbhtml filename="fixes.html"?> 3<chapter id="fixes"> <?dbhtml filename="fixes.html"?>
4<title>Making your package work</title> 4<title>Making your package work</title>
5 5
6<sect1 id="general-operation"> 6<sect1 id="general-operation">
7 <title>General operation</title> 7 <title>General operation</title>
8 8
9 <para>One appealing feature of pkgsrc is that it runs on many 9 <para>One appealing feature of pkgsrc is that it runs on many
10 different platforms. As a result, it is important to ensure, 10 different platforms. As a result, it is important to ensure,
11 where possible, that packages in pkgsrc are portable. This 11 where possible, that packages in pkgsrc are portable. This
12 chapter mentions some particular details you should pay 12 chapter mentions some particular details you should pay
13 attention to while working on pkgsrc.</para> 13 attention to while working on pkgsrc.</para>
14 14
@@ -1471,56 +1471,72 @@ pre-configure: @@ -1471,56 +1471,72 @@ pre-configure:
1471 </orderedlist> 1471 </orderedlist>
1472 </sect2> 1472 </sect2>
1473 1473
1474 <sect2 id="perl-scripts"> 1474 <sect2 id="perl-scripts">
1475 <title>Packages containing Perl scripts</title> 1475 <title>Packages containing Perl scripts</title>
1476 1476
1477 <para>If your package contains interpreted Perl scripts, add 1477 <para>If your package contains interpreted Perl scripts, add
1478 <quote>perl</quote> to the <varname>USE_TOOLS</varname> variable 1478 <quote>perl</quote> to the <varname>USE_TOOLS</varname> variable
1479 and set <varname>REPLACE_PERL</varname> to ensure that the proper 1479 and set <varname>REPLACE_PERL</varname> to ensure that the proper
1480 interpreter path is set. <varname>REPLACE_PERL</varname> should 1480 interpreter path is set. <varname>REPLACE_PERL</varname> should
1481 contain a list of scripts, relative to <varname>WRKSRC</varname>, 1481 contain a list of scripts, relative to <varname>WRKSRC</varname>,
1482 that you want adjusted. Every occurrence of 1482 that you want adjusted. Every occurrence of
1483 <filename>*/bin/perl</filename> in a she-bang line will be 1483 <filename>*/bin/perl</filename> in a she-bang line will be
1484 replaced with the full path to the perl executable.</para> 1484 replaced with the full path to the Perl executable.</para>
1485 1485
1486 <para>If a particular version of perl is needed, set the 1486 <para>If a particular version of Perl is needed, set the
1487 <varname>PERL5_REQD</varname> variable to the version number. The 1487 <varname>PERL5_REQD</varname> variable to the version number. The
1488 default is <quote>5.0</quote>.</para> 1488 default is <quote>5.0</quote>.</para>
1489 1489
1490 <para>See <xref linkend="perl-modules" /> for information 1490 <para>See <xref linkend="perl-modules" /> for information
1491 about handling perl modules.</para> 1491 about handling Perl modules.</para>
 1492
 1493 <para>There is also the <varname>REPLACE_PERL6</varname> variable
 1494 for the language now known as Raku.</para>
1492 </sect2> 1495 </sect2>
1493 1496
1494 <sect2 id="shell-scripts"> 1497 <sect2 id="shell-scripts">
1495 <title>Packages containing shell scripts</title> 1498 <title>Packages containing shell scripts</title>
1496 1499
1497 <para><varname>REPLACE_SH</varname>, 1500 <para><varname>REPLACE_SH</varname>,
1498 <varname>REPLACE_BASH</varname>, <varname>REPLACE_CSH</varname>, 1501 <varname>REPLACE_BASH</varname>, <varname>REPLACE_CSH</varname>,
1499 and <varname>REPLACE_KSH</varname> can be used to replace shell 1502 and <varname>REPLACE_KSH</varname> can be used to replace shell
1500 hash bangs in files. Please use the appropriate one, preferring 1503 hash bangs in files. Please use the appropriate one, preferring
1501 <varname>REPLACE_SH</varname> in case this shell is sufficient. 1504 <varname>REPLACE_SH</varname> in case this shell is sufficient.
1502 Each should contain a list of scripts, relative to 1505 Each should contain a list of scripts, relative to
1503 <varname>WRKSRC</varname>, that you want adjusted. Every 1506 <varname>WRKSRC</varname>, that you want adjusted. Every
1504 occurrence of the matching shell in a she-bang line will be 1507 occurrence of the matching shell in a she-bang line will be
1505 replaced with the full path to the shell executable. 1508 replaced with the full path to the shell executable.
1506 When using <varname>REPLACE_BASH</varname>, don't forget to add 1509 When using <varname>REPLACE_BASH</varname>, don't forget to add
1507 <filename>bash</filename> to <varname>USE_TOOLS</varname>.</para> 1510 <filename>bash</filename> to <varname>USE_TOOLS</varname>.</para>
1508 </sect2> 1511 </sect2>
1509 1512
1510 <sect2 id="other-programming-languages"> 1513 <sect2 id="other-programming-languages">
1511 <title>Other programming languages</title> 1514 <title>Other programming languages</title>
1512 1515
1513 <para>Currently, there is no special handling for other languages 1516 <para>There are further similar REPLACE variables available, e.g.,
 1517 <varname>REPLACE_AWK</varname> for packages containing awk scripts,
 1518 and <varname>REPLACE_R</varname> for R. These two, like the others
 1519 noted above, are defined centrally in
 1520 <filename>mk/configure/replace-interpreter.mk</filename>. Other
 1521 languages define these variables within their own dedicated part of
 1522 the tree, e.g., PHP defines <varname>REPLACE_PHP</varname> in
 1523 <filename>lang/php/phpversion.mk</filename>, and Python defines
 1524 <varname>REPLACE_PYTHON</varname> in
 1525 <filename>lang/python/application.mk</filename>. For other languages,
 1526 consult the mk files found within their specific directories (the
 1527 naming convention varies).</para>
 1528
 1529 <para>Currently, special handling for other languages varies
1514 in pkgsrc. If a compiler package provides a 1530 in pkgsrc. If a compiler package provides a
1515 <filename>buildlink3.mk</filename> file, include that, otherwise 1531 <filename>buildlink3.mk</filename> file, include that, otherwise
1516 just add a (build) dependency on the appropriate compiler 1532 just add a (build) dependency on the appropriate compiler
1517 package.</para> 1533 package.</para>
1518 </sect2> 1534 </sect2>
1519</sect1> 1535</sect1>
1520 1536
1521<sect1 id="fixes.build"> 1537<sect1 id="fixes.build">
1522 <title>The <emphasis>build</emphasis> phase</title> 1538 <title>The <emphasis>build</emphasis> phase</title>
1523 1539
1524 <para>The most common failures when building a package are that 1540 <para>The most common failures when building a package are that
1525 some platforms do not provide certain header files, functions or 1541 some platforms do not provide certain header files, functions or
1526 libraries, or they provide the functions in a library that the 1542 libraries, or they provide the functions in a library that the