guide: Document TOOL_DEPENDS Document TOOL_DEPENDS and clarify the differencies with BUILD_DEPENDS. Adjust previous BUILD_DEPENDS examples (all of them were actually TOOL_DEPENDS). TODO: (DO NOT COMMIT IT AS-IS!): find a good BUILD_DEPENDS example. Index: creating.xml =================================================================== RCS file: /cvsroot/pkgsrc/doc/guide/files/creating.xml,v retrieving revision 1.27 diff -u -p -r1.27 creating.xml --- creating.xml 4 Jun 2018 23:55:00 -0000 1.27 +++ creating.xml 4 May 2019 12:54:11 -0000 @@ -43,13 +43,22 @@ created first. The buildlink3. version of the dependency and where it can be found in pkgsrc. This line should be placed in the third paragraph. If the dependency is only needed for building the package, but not when using it, use -BUILD_DEPENDS instead of DEPENDS. +TOOL_DEPENDS or BUILD_DEPENDS +instead of DEPENDS. +The difference between TOOL_DEPENDS and +BUILD_DEPENDS occurs when cross-compiling: +TOOL_DEPENDS are native +packages, i.e. packages for the architecture where the package +is built; +BUILD_DEPENDS are target +packages, i.e. packages for the architecture for which the package +is built. Your package may then look like this: [...] -BUILD_DEPENDS+= libxslt-[0-9]*:../../textproc/libxslt +TOOL_DEPENDS+= libxslt-[0-9]*:../../textproc/libxslt DEPENDS+= screen-[0-9]*:../../misc/screen DEPENDS+= screen>=4.0:../../misc/screen Index: fixes.xml =================================================================== RCS file: /cvsroot/pkgsrc/doc/guide/files/fixes.xml,v retrieving revision 1.147 diff -u -p -r1.147 fixes.xml --- fixes.xml 2 Jan 2019 18:48:21 -0000 1.147 +++ fixes.xml 4 May 2019 12:54:12 -0000 @@ -291,7 +291,8 @@ ACCEPTABLE_LICENSES+=xv-license Your package may depend on some other package being present - and there are various ways of expressing this dependency. pkgsrc supports the BUILD_DEPENDS and - DEPENDS definitions, the + DEPENDS and + TOOL_DEPENDS definitions, the USE_TOOLS definition, as well as dependencies via buildlink3.mk, which is the preferred way to handle dependencies, and which uses the variables named above. @@ -301,15 +302,24 @@ ACCEPTABLE_LICENSES+=xv-license follows: The DEPENDS definition registers that pre-requisite in the binary package so it will be pulled in when the binary package is later installed, whilst the - BUILD_DEPENDS definition does not, marking a - dependency that is only needed for building the package. + BUILD_DEPENDS and TOOL_DEPENDS + definitions does not, marking a dependency that is only needed for + building the package. This means that if you only need a package present whilst you are building, it should be noted as a - BUILD_DEPENDS. - - The format for a BUILD_DEPENDS and a - DEPENDS definition is: + TOOL_DEPENDS or + BUILD_DEPENDS. When cross-compiling, + TOOL_DEPENDS are native + packages, i.e. packages for the architecture where the package + is built; + BUILD_DEPENDS are target + packages, i.e. packages for the architecture for which the package + is built. + + The format for BUILD_DEPENDS, + DEPENDS and TOOL_DEPENDS + definition is: <pre-req-package-name>:../../<category>/<pre-req-package> @@ -346,10 +356,20 @@ ACCEPTABLE_LICENSES+=xv-license If your package needs binaries from another package to build, + use the TOOL_DEPENDS definition: + + +TOOL_DEPENDS+= itstool-[0-9]*:../../textproc/itstool + + + + + If your package needs static libraries to link against, header + files to include, etc. from another package to build, use the BUILD_DEPENDS definition: -BUILD_DEPENDS+= itstool-[0-9]*:../../textproc/itstool +BUILD_DEPENDS+= TODO: find a good example Index: tools.xml =================================================================== RCS file: /cvsroot/pkgsrc/doc/guide/files/tools.xml,v retrieving revision 1.7 diff -u -p -r1.7 tools.xml --- tools.xml 11 Jun 2016 20:19:36 -0000 1.7 +++ tools.xml 4 May 2019 12:54:12 -0000 @@ -5,7 +5,7 @@ The USE_TOOLS definition is used both internally by pkgsrc and also for individual packages to define what commands -are needed for building a package (like BUILD_DEPENDS) +are needed for building a package (like TOOL_DEPENDS) or for later run-time of an installed packaged (such as DEPENDS). If the native system provides an adequate tool, then in many cases, a pkgsrc