From 3d2e1ef6e8c44292a9388a1ce1b6982d03a983a3 Mon Sep 17 00:00:00 2001 From: leot Date: Mon, 20 May 2019 18:14:24 +0000 Subject: 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). XXX: No BUILD_DEPENDS example is provided, if you have any good and common XXX: BUILD_DEPENDS example please add it (a TODO comment was added regarding XXX: that). At least according a quick grep of BUILD_DEPENDS probably most of XXX: them are actually BUILD_DEPENDS and maybe all real BUILD_DEPENDS are via XXX: buildlink3.mk inclusion. --- doc/guide/files/creating.xml | 15 ++++++++++++--- doc/guide/files/fixes.xml | 41 +++++++++++++++++++++++++++++++---------- doc/guide/files/tools.xml | 4 ++-- 3 files changed, 45 insertions(+), 15 deletions(-) (limited to 'doc/guide') diff --git a/doc/guide/files/creating.xml b/doc/guide/files/creating.xml index 4744f2b5b36..056064a0390 100644 --- a/doc/guide/files/creating.xml +++ b/doc/guide/files/creating.xml @@ -1,4 +1,4 @@ - + Creating a new pkgsrc package from scratch @@ -43,13 +43,22 @@ created first. The buildlink3.mk file makes sure that the p 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 diff --git a/doc/guide/files/fixes.xml b/doc/guide/files/fixes.xml index 76170642636..f2d04112943 100644 --- a/doc/guide/files/fixes.xml +++ b/doc/guide/files/fixes.xml @@ -1,4 +1,4 @@ - + Making your package work @@ -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,13 +356,24 @@ ACCEPTABLE_LICENSES+=xv-license If your package needs binaries from another package to build, - use the BUILD_DEPENDS definition: + use the TOOL_DEPENDS definition: -BUILD_DEPENDS+= itstool-[0-9]*:../../textproc/itstool +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. + + + + If your package needs a library with which to link and there is no buildlink3.mk file diff --git a/doc/guide/files/tools.xml b/doc/guide/files/tools.xml index 6a86eadda79..0148b7f603a 100644 --- a/doc/guide/files/tools.xml +++ b/doc/guide/files/tools.xml @@ -1,11 +1,11 @@ - + Tools needed for building or running 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 -- cgit v1.2.3