head 1.50;
access;
symbols
pkgsrc-2026Q1:1.50.0.2
pkgsrc-2026Q1-base:1.50
pkgsrc-2025Q4:1.49.0.22
pkgsrc-2025Q4-base:1.49
pkgsrc-2025Q3:1.49.0.20
pkgsrc-2025Q3-base:1.49
pkgsrc-2025Q2:1.49.0.18
pkgsrc-2025Q2-base:1.49
pkgsrc-2025Q1:1.49.0.16
pkgsrc-2025Q1-base:1.49
pkgsrc-2024Q4:1.49.0.14
pkgsrc-2024Q4-base:1.49
pkgsrc-2024Q3:1.49.0.12
pkgsrc-2024Q3-base:1.49
pkgsrc-2024Q2:1.49.0.10
pkgsrc-2024Q2-base:1.49
pkgsrc-2024Q1:1.49.0.8
pkgsrc-2024Q1-base:1.49
pkgsrc-2023Q4:1.49.0.6
pkgsrc-2023Q4-base:1.49
pkgsrc-2023Q3:1.49.0.4
pkgsrc-2023Q3-base:1.49
pkgsrc-2023Q2:1.49.0.2
pkgsrc-2023Q2-base:1.49
pkgsrc-2023Q1:1.48.0.2
pkgsrc-2023Q1-base:1.48
pkgsrc-2022Q4:1.46.0.2
pkgsrc-2022Q4-base:1.46
pkgsrc-2022Q3:1.45.0.8
pkgsrc-2022Q3-base:1.45
pkgsrc-2022Q2:1.45.0.6
pkgsrc-2022Q2-base:1.45
pkgsrc-2022Q1:1.45.0.4
pkgsrc-2022Q1-base:1.45
pkgsrc-2021Q4:1.45.0.2
pkgsrc-2021Q4-base:1.45
pkgsrc-2021Q3:1.44.0.10
pkgsrc-2021Q3-base:1.44
pkgsrc-2021Q2:1.44.0.8
pkgsrc-2021Q2-base:1.44
pkgsrc-2021Q1:1.44.0.6
pkgsrc-2021Q1-base:1.44
pkgsrc-2020Q4:1.44.0.4
pkgsrc-2020Q4-base:1.44
pkgsrc-2020Q3:1.44.0.2
pkgsrc-2020Q3-base:1.44
pkgsrc-2020Q2:1.43.0.2
pkgsrc-2020Q2-base:1.43
pkgsrc-2020Q1:1.41.0.4
pkgsrc-2020Q1-base:1.41
pkgsrc-2019Q4:1.41.0.26
pkgsrc-2019Q4-base:1.41
pkgsrc-2019Q3:1.41.0.22
pkgsrc-2019Q3-base:1.41
pkgsrc-2019Q2:1.41.0.20
pkgsrc-2019Q2-base:1.41
pkgsrc-2019Q1:1.41.0.18
pkgsrc-2019Q1-base:1.41
pkgsrc-2018Q4:1.41.0.16
pkgsrc-2018Q4-base:1.41
pkgsrc-2018Q3:1.41.0.14
pkgsrc-2018Q3-base:1.41
pkgsrc-2018Q2:1.41.0.12
pkgsrc-2018Q2-base:1.41
pkgsrc-2018Q1:1.41.0.10
pkgsrc-2018Q1-base:1.41
pkgsrc-2017Q4:1.41.0.8
pkgsrc-2017Q4-base:1.41
pkgsrc-2017Q3:1.41.0.6
pkgsrc-2017Q3-base:1.41
pkgsrc-2017Q2:1.41.0.2
pkgsrc-2017Q2-base:1.41
pkgsrc-2017Q1:1.40.0.2
pkgsrc-2017Q1-base:1.40
pkgsrc-2016Q4:1.39.0.4
pkgsrc-2016Q4-base:1.39
pkgsrc-2016Q3:1.39.0.2
pkgsrc-2016Q3-base:1.39
pkgsrc-2016Q2:1.38.0.12
pkgsrc-2016Q2-base:1.38
pkgsrc-2016Q1:1.38.0.10
pkgsrc-2016Q1-base:1.38
pkgsrc-2015Q4:1.38.0.8
pkgsrc-2015Q4-base:1.38
pkgsrc-2015Q3:1.38.0.6
pkgsrc-2015Q3-base:1.38
pkgsrc-2015Q2:1.38.0.4
pkgsrc-2015Q2-base:1.38
pkgsrc-2015Q1:1.38.0.2
pkgsrc-2015Q1-base:1.38
pkgsrc-2014Q4:1.36.0.12
pkgsrc-2014Q4-base:1.36
pkgsrc-2014Q3:1.36.0.10
pkgsrc-2014Q3-base:1.36
pkgsrc-2014Q2:1.36.0.8
pkgsrc-2014Q2-base:1.36
pkgsrc-2014Q1:1.36.0.6
pkgsrc-2014Q1-base:1.36
pkgsrc-2013Q4:1.36.0.4
pkgsrc-2013Q4-base:1.36
pkgsrc-2013Q3:1.36.0.2
pkgsrc-2013Q3-base:1.36
pkgsrc-2013Q2:1.34.0.2
pkgsrc-2013Q2-base:1.34
pkgsrc-2013Q1:1.31.0.2
pkgsrc-2013Q1-base:1.31
pkgsrc-2012Q4:1.30.0.4
pkgsrc-2012Q4-base:1.30
pkgsrc-2012Q3:1.30.0.2
pkgsrc-2012Q3-base:1.30
pkgsrc-2012Q2:1.28.0.8
pkgsrc-2012Q2-base:1.28
pkgsrc-2012Q1:1.28.0.6
pkgsrc-2012Q1-base:1.28
pkgsrc-2011Q4:1.28.0.4
pkgsrc-2011Q4-base:1.28
pkgsrc-2011Q3:1.28.0.2
pkgsrc-2011Q3-base:1.28
pkgsrc-2011Q2:1.26.0.20
pkgsrc-2011Q2-base:1.26
pkgsrc-2011Q1:1.26.0.18
pkgsrc-2011Q1-base:1.26
pkgsrc-2010Q4:1.26.0.16
pkgsrc-2010Q4-base:1.26
pkgsrc-2010Q3:1.26.0.14
pkgsrc-2010Q3-base:1.26
pkgsrc-2010Q2:1.26.0.12
pkgsrc-2010Q2-base:1.26
pkgsrc-2010Q1:1.26.0.10
pkgsrc-2010Q1-base:1.26
pkgsrc-2009Q4:1.26.0.8
pkgsrc-2009Q4-base:1.26
pkgsrc-2009Q3:1.26.0.6
pkgsrc-2009Q3-base:1.26
pkgsrc-2009Q2:1.26.0.4
pkgsrc-2009Q2-base:1.26
pkgsrc-2009Q1:1.26.0.2
pkgsrc-2009Q1-base:1.26
pkgsrc-2008Q4:1.25.0.16
pkgsrc-2008Q4-base:1.25
pkgsrc-2008Q3:1.25.0.14
pkgsrc-2008Q3-base:1.25
cube-native-xorg:1.25.0.12
cube-native-xorg-base:1.25
pkgsrc-2008Q2:1.25.0.10
pkgsrc-2008Q2-base:1.25
cwrapper:1.25.0.8
pkgsrc-2008Q1:1.25.0.6
pkgsrc-2008Q1-base:1.25
pkgsrc-2007Q4:1.25.0.4
pkgsrc-2007Q4-base:1.25
pkgsrc-2007Q3:1.25.0.2
pkgsrc-2007Q3-base:1.25
pkgsrc-2007Q2:1.24.0.2
pkgsrc-2007Q2-base:1.24
pkgsrc-2007Q1:1.23.0.2
pkgsrc-2007Q1-base:1.23
pkgsrc-2006Q4:1.21.0.2
pkgsrc-2006Q4-base:1.21
pkgsrc-2006Q3:1.19.0.2
pkgsrc-2006Q3-base:1.19
pkgsrc-2006Q2:1.16.0.2
pkgsrc-2006Q2-base:1.16
pkgsrc-2006Q1:1.13.0.2
pkgsrc-2006Q1-base:1.13
pkgsrc-2005Q4:1.11.0.2
pkgsrc-2005Q4-base:1.11
pkgsrc-2005Q3:1.9.0.2
pkgsrc-2005Q3-base:1.9
pkgsrc-2005Q2:1.5.0.2
pkgsrc-2005Q2-base:1.5
pkgsrc-2005Q1:1.1.1.1.0.4
pkgsrc-2005Q1-base:1.1.1.1
pkgsrc-2004Q4:1.1.1.1.0.2
pkgsrc-2004Q4-base:1.1.1.1
pkgsrc-base:1.1.1.1
TNF:1.1.1;
locks; strict;
comment @# @;
1.50
date 2026.01.10.21.13.49; author wiz; state Exp;
branches;
next 1.49;
commitid Fw2BijOkfNtfiTpG;
1.49
date 2023.05.20.15.43.53; author rillig; state Exp;
branches;
next 1.48;
commitid LukJQq9KcFcvvIpE;
1.48
date 2023.01.24.14.32.37; author wiz; state Exp;
branches;
next 1.47;
commitid dthnnNiSYP0XQNaE;
1.47
date 2023.01.24.14.15.43; author wiz; state Exp;
branches;
next 1.46;
commitid vvQeFgbsq5u5LNaE;
1.46
date 2022.12.06.00.36.13; author gutteridge; state Exp;
branches;
next 1.45;
commitid 1YUHJUtEZFyaMq4E;
1.45
date 2021.11.09.17.53.33; author gutteridge; state Exp;
branches;
next 1.44;
commitid bN6mihjTPuMw89gD;
1.44
date 2020.08.20.13.31.58; author bacon; state Exp;
branches;
next 1.43;
commitid yvLb9tVS8zRj1OkC;
1.43
date 2020.06.20.09.47.05; author wiz; state Exp;
branches;
next 1.42;
commitid q7Ti0WMpcrYdKWcC;
1.42
date 2020.06.18.20.30.12; author wiz; state Exp;
branches;
next 1.41;
commitid QqZURWITOPeLmKcC;
1.41
date 2017.06.29.14.22.49; author leot; state Exp;
branches;
next 1.40;
commitid T7veDQbAwb6BchXz;
1.40
date 2017.01.06.20.26.39; author sevan; state Exp;
branches;
next 1.39;
commitid TnHdwNczx7eMMWAz;
1.39
date 2016.07.10.07.46.29; author rillig; state Exp;
branches;
next 1.38;
commitid rYkF5Jbr8p6GoKdz;
1.38
date 2014.12.30.15.18.59; author wiz; state Exp;
branches;
next 1.37;
commitid OQMYuJ1wnfLWP44y;
1.37
date 2014.12.30.15.13.19; author wiz; state Exp;
branches;
next 1.36;
commitid RRdsYBWaMIUIN44y;
1.36
date 2013.07.30.07.14.09; author wiz; state Exp;
branches;
next 1.35;
commitid X6yXAffm61HWNsZw;
1.35
date 2013.07.30.03.38.38; author ryoon; state Exp;
branches;
next 1.34;
commitid rCSFl2A2vVCQBrZw;
1.34
date 2013.04.21.15.20.46; author wiz; state Exp;
branches;
next 1.33;
1.33
date 2013.04.21.12.44.00; author wiz; state Exp;
branches;
next 1.32;
1.32
date 2013.04.16.13.55.33; author wiz; state Exp;
branches;
next 1.31;
1.31
date 2013.03.20.01.29.24; author obache; state Exp;
branches;
next 1.30;
1.30
date 2012.08.05.21.29.46; author wiz; state Exp;
branches;
next 1.29;
1.29
date 2012.08.02.05.53.40; author obache; state Exp;
branches;
next 1.28;
1.28
date 2011.08.30.15.21.46; author wiz; state Exp;
branches;
next 1.27;
1.27
date 2011.08.30.15.18.56; author wiz; state Exp;
branches;
next 1.26;
1.26
date 2009.03.20.19.33.28; author joerg; state Exp;
branches;
next 1.25;
1.25
date 2007.10.01.22.38.42; author rillig; state Exp;
branches;
next 1.24;
1.24
date 2007.06.01.11.07.24; author rillig; state Exp;
branches;
next 1.23;
1.23
date 2007.01.17.03.11.18; author rillig; state Exp;
branches;
next 1.22;
1.22
date 2007.01.03.00.58.24; author kano; state Exp;
branches;
next 1.21;
1.21
date 2006.12.10.03.15.01; author kano; state Exp;
branches;
next 1.20;
1.20
date 2006.10.18.03.06.14; author ben; state Exp;
branches;
next 1.19;
1.19
date 2006.09.13.23.23.39; author wiz; state Exp;
branches;
next 1.18;
1.18
date 2006.09.10.19.51.49; author wiz; state Exp;
branches;
next 1.17;
1.17
date 2006.09.09.23.49.08; author wiz; state Exp;
branches;
next 1.16;
1.16
date 2006.04.06.07.57.10; author reed; state Exp;
branches;
next 1.15;
1.15
date 2006.04.06.07.33.30; author reed; state Exp;
branches;
next 1.14;
1.14
date 2006.04.06.06.21.57; author reed; state Exp;
branches;
next 1.13;
1.13
date 2006.03.09.21.45.51; author jlam; state Exp;
branches;
next 1.12;
1.12
date 2006.02.12.14.44.59; author rillig; state Exp;
branches;
next 1.11;
1.11
date 2005.10.23.11.25.58; author rillig; state Exp;
branches;
next 1.10;
1.10
date 2005.10.07.09.56.12; author rillig; state Exp;
branches;
next 1.9;
1.9
date 2005.09.14.16.40.57; author reed; state Exp;
branches;
next 1.8;
1.8
date 2005.09.14.15.55.35; author reed; state Exp;
branches;
next 1.7;
1.7
date 2005.09.02.19.12.37; author rillig; state Exp;
branches;
next 1.6;
1.6
date 2005.07.27.21.29.50; author rpaulo; state Exp;
branches;
next 1.5;
1.5
date 2005.06.03.16.05.30; author reed; state Exp;
branches;
next 1.4;
1.4
date 2005.05.24.12.14.42; author wiz; state Exp;
branches;
next 1.3;
1.3
date 2005.05.14.22.34.59; author rillig; state Exp;
branches;
next 1.2;
1.2
date 2005.04.12.16.13.27; author tv; state Exp;
branches;
next 1.1;
1.1
date 2004.10.21.14.27.43; author grant; state Exp;
branches
1.1.1.1;
next ;
1.1.1.1
date 2004.10.21.14.27.43; author grant; state Exp;
branches;
next ;
desc
@@
1.50
log
@doc: remove lesstif reference
@
text
@
Buildlink methodologyBuildlink is a framework in pkgsrc that controls what headers and libraries
are seen by a package's configure and build processes. This is implemented
in a two step process:Symlink headers and libraries for dependencies into
BUILDLINK_DIR, which by default is a subdirectory
of WRKDIR.Create wrapper scripts that are used in place of the normal compiler
tools that translate and
into references to
BUILDLINK_DIR. The wrapper scripts also make
native compiler on some operating systems look like GCC, so that
packages that expect GCC won't require modifications to build with
those native compilers.This normalizes the environment in which a package is built so that the
package may be built consistently despite what other software may be
installed. Please note that the normal system header and library paths,
e.g. /usr/include,
/usr/lib, etc., are always searched -- buildlink3 is
designed to insulate the package build from non-system-supplied
software.Converting packages to use buildlink3The process of converting packages to use the buildlink3
framework (bl3ifying) is fairly straightforward.
The things to keep in mind are:Ensure that the build always calls the wrapper scripts
instead of the actual toolchain. Some packages are tricky,
and the only way to know for sure is the check
${WRKDIR}/.work.log to see if the
wrappers are being invoked.Don't override PREFIX from within
the package Makefile, e.g. Java VMs, standalone shells,
etc., because the code to symlink files into
${BUILDLINK_DIR} looks for files
relative to pkg_info -qp pkgname.
Remember that only the
buildlink3.mk files that you list in a
package's Makefile are added as dependencies for that package.
If a dependency on a particular package is required for its libraries and
headers, then we replace:
DEPENDS+= foo>=1.1.0:../../category/foo
with
.include "../../category/foo/buildlink3.mk"
The buildlink3.mk files usually define the required dependencies.
If you need a newer version of the dependency when using buildlink3.mk
files, then you can define it in your Makefile; for example:
BUILDLINK_API_DEPENDS.foo+= foo>=1.1.0
.include "../../category/foo/buildlink3.mk"
There are several buildlink3.mk
files in pkgsrc/mk
that handle special package issues:bdb.buildlink3.mk chooses either
the native or a pkgsrc Berkeley DB implementation based on
the values of BDB_ACCEPTED and
BDB_DEFAULT.curses.buildlink3.mk: If the system
comes with neither Curses nor NCurses, this will take care
to install the devel/ncurses package.krb5.buildlink3.mk uses the value
of KRB5_ACCEPTED to choose between
adding a dependency on Heimdal or MIT-krb5 for packages that
require a Kerberos 5 implementation.motif.buildlink3.mk checks for a
system-provided Motif installation or adds a dependency on
x11/motif. The user can set
MOTIF_TYPE to dt or
motif to choose which Motif version will be
used.readline.buildlink3.mk checks for a
system-provided GNU readline or editline (libedit) installation,
or adds a dependency on devel/readline,
devel/editline. The user can set
READLINE_DEFAULT to choose readline implementation.
If your package really needs GNU readline library, its Makefile
should include devel/readline/buildlink3.mk
instead of readline.buildlink3.mk.oss.buildlink3.mk defines several
variables that may be used by packages that use the
Open Sound System (OSS) API.pgsql.buildlink3.mk will accept
any of the Postgres versions in the variable
PGSQL_VERSIONS_ACCEPTED and default to
the version PGSQL_VERSION_DEFAULT. See
the file for more information.pthread.buildlink3.mk uses the value of
PTHREAD_OPTS and checks for native pthreads or adds
a dependency on devel/pth as needed.xaw.buildlink3.mk uses the value of
XAW_TYPE to choose a particular Athena widgets
library.The comments in those buildlink3.mk
files provide a more complete
description of how to use them properly.Writing buildlink3.mk filesA package's buildlink3.mk file is
included by Makefiles to indicate the need to compile and link
against header files and libraries provided by the package. A
buildlink3.mk file should always provide
enough information to add the correct type of dependency
relationship and include any other
buildlink3.mk files that it needs to find
headers and libraries that it needs in turn.To generate an initial buildlink3.mk
file for further editing, Rene Hexel's pkgtools/createbuildlink
package is highly recommended. For most packages, the following
command will generate a good starting point for
buildlink3.mk files:
&cprompt; cd pkgsrc/category/pkgdir
&cprompt; createbuildlink >buildlink3.mkAnatomy of a buildlink3.mk fileThe following real-life example
buildlink3.mk is taken
from pkgsrc/graphics/tiff:
BUILDLINK_TREE+= tiff
.if !defined(TIFF_BUILDLINK3_MK)
TIFF_BUILDLINK3_MK:=
BUILDLINK_API_DEPENDS.tiff+= tiff>=3.6.1
BUILDLINK_ABI_DEPENDS.tiff+= tiff>=3.7.2nb1
BUILDLINK_PKGSRCDIR.tiff?= ../../graphics/tiff
.include "../../devel/zlib/buildlink3.mk"
.include "../../graphics/jpeg/buildlink3.mk"
.endif # TIFF_BUILDLINK3_MK
BUILDLINK_TREE+= -tiff
The header and footer manipulate
BUILDLINK_TREE, which is common across all
buildlink3.mk files and is used to track
the dependency tree.The main section is protected from multiple inclusion
and controls how the dependency on pkg is
added. Several important variables are set in the section:BUILDLINK_API_DEPENDS.pkg
is the dependency version recorded in the installed
package; this should always be set using
+= to ensure that
we're appending to any pre-existing list of values. This
variable should be set to the last version of the
package that had an backwards-incompatible API change.
BUILDLINK_PKGSRCDIR.pkg
is the location of the pkg
pkgsrc directory.BUILDLINK_DEPMETHOD.pkg
(not shown above) controls whether we use
BUILD_DEPENDS or
DEPENDS to add the dependency on
pkg. The build dependency is
selected by setting
BUILDLINK_DEPMETHOD.pkg
to build. By default, the full dependency is
used.BUILDLINK_INCDIRS.pkg
and
BUILDLINK_LIBDIRS.pkg
(not shown above) are lists of subdirectories of
${BUILDLINK_PREFIX.pkg}
to add to the header and library search paths. These
default to include and lib
respectively.BUILDLINK_CPPFLAGS.pkg
(not shown above) is the list of preprocessor flags to add
to CPPFLAGS, which are passed on to the
configure and build phases. The -I option
should be avoided and instead be handled using
BUILDLINK_INCDIRS.pkg as
above.The following variables are all optionally defined within
this second section (protected against multiple inclusion) and
control which package files are symlinked into
${BUILDLINK_DIR} and how their names are
transformed during the symlinking:BUILDLINK_FILES.pkg
(not shown above) is a shell glob pattern relative to
${BUILDLINK_PREFIX.pkg}
to be symlinked into
${BUILDLINK_DIR},
e.g. include/*.h.BUILDLINK_FILES_CMD.pkg
(not shown above) is a shell pipeline that
outputs to stdout a list of files relative to
${BUILDLINK_PREFIX.pkg}.
The resulting files are to be symlinked
into ${BUILDLINK_DIR}. By default,
this takes the +CONTENTS of a
pkg and filters it through
${BUILDLINK_CONTENTS_FILTER.pkg}.BUILDLINK_CONTENTS_FILTER.pkg
(not shown above) is a filter command that filters
+CONTENTS input into a list of files
relative to
${BUILDLINK_PREFIX.pkg}
on stdout. By default,
BUILDLINK_CONTENTS_FILTER.pkg
outputs the contents of the include
and lib directories in the package
+CONTENTS.BUILDLINK_FNAME_TRANSFORM.pkg
(not shown above) is a list of sed arguments used to
transform the name of the source filename into a
destination filename, e.g. -e
"s|/curses.h|/ncurses.h|g".This section can additionally include any
buildlink3.mk needed for
pkg's library dependencies.
Including these buildlink3.mk files
means that the headers and libraries for these
dependencies are also symlinked into
${BUILDLINK_DIR}
whenever the pkgbuildlink3.mk
file is included. Dependencies are only added for directly
include buildlink3.mk files.When providing a buildlink3.mk and
including other buildlink3.mk files in it,
please only add necessary ones, i.e., those whose libraries or
header files are automatically exposed when the package is
use.In particular, if only an executable
(bin/foo) is linked against a library, that
library does not need to be propagated in the
buildlink3.mk file.The following steps should help you decide if a
buildlink3.mk file needs to be included:
Look at the installed header files: What
headers do they include? The packages providing these files
must be buildlinked.Run ldd on all installed
libraries and look against what other libraries they link.
Some of the packages providing these probably need to be
buildlinked; however, it's not automatic, since e.g. GTK on
some systems pulls in the X libraries, so they will show up in
the ldd output, while on others (like OS
X) it won't. ldd output can thus only be
used as a hint.Updating
BUILDLINK_API_DEPENDS.pkg
and
BUILDLINK_ABI_DEPENDS.pkg
in buildlink3.mk filesBoth variables set lower bounds for a version of this package.
The two variables differ in that one describes source
compatibility (API) and the other binary compatibility (ABI).
The difference is that a change in the API breaks compilation of
programs while changes in the ABI stop compiled programs from
running.The
BUILDLINK_API_DEPENDS.pkg
variable in a buildlink3.mk should be
changed very rarely. (One possible scenario: If all packages
using this package need a higher version than defined in the
buildlink3.mk,
BUILDLINK_API_DEPENDS.pkg
could be updated to that higher version.)On the other hand, changes to
BUILDLINK_ABI_DEPENDS.pkg
are more common. The variable will need to be updated every
time the major version of one of its shared libraries is changed,
or any other change where a binary built against the previous
version of the package will not run against the new version any
longer.In such a case, the package's
BUILDLINK_ABI_DEPENDS.pkg
must be increased to require the new package version. Then the
PKGREVISION of all packages
foo that depend on this package need
to be increased, and if they have
buildlink3.mk files,
BUILDLINK_ABI_DEPENDS.foo
in their buildlink3.mk files must be
increased to the new version as well. This is required so that a
package will pull in the versions of the packages that use the
new ABI and that the packages' PKGREVISIONs
uniquely identify the packages built against the new ABI. The
pkgtools/revbump package can
help with these updates.See for more information
about dependencies on other packages, including the
BUILDLINK_API_DEPENDS definitions.Please take careful consideration before adjusting
BUILDLINK_API_DEPENDS.pkg
or
BUILDLINK_ABI_DEPENDS.pkg
in a buildlink3.mk file as we don't want to
cause unneeded package deletions and rebuilds. In many cases,
new versions of packages work just fine with older
dependencies.Also, it is not needed to set
BUILDLINK_ABI_DEPENDS.pkg
when it is identical to
BUILDLINK_API_DEPENDS.pkg.Note there is also the distinction that users are able to disable
enforcement of ABI dependencies using the USE_ABI_DEPENDS
variable, but there is no equivalent option for API dependencies.Writing builtin.mk filesSome packages in pkgsrc install headers and libraries that
coincide with headers and libraries present in the base system.
Aside from a buildlink3.mk file, these
packages should also include a builtin.mk
file that includes the necessary checks to decide whether using
the built-in software or the pkgsrc software is
appropriate.The only requirements of a builtin.mk file for
pkg are:It should set
USE_BUILTIN.pkg
to either yes or no
after it is included.It should not override any
USE_BUILTIN.pkg
which is already set before the
builtin.mk file is included.It should be written to allow multiple inclusion. This
is very important and takes careful
attention to Makefile coding.Anatomy of a builtin.mk fileThe following is the recommended template for builtin.mk
files:
.if !defined(IS_BUILTIN.foo)
#
# IS_BUILTIN.foo is set to "yes" or "no" depending on whether "foo"
# genuinely exists in the system or not.
#
IS_BUILTIN.foo?= no
# BUILTIN_PKG.foo should be set here if "foo" is built-in and its package
# version can be determined.
#
. if !empty(IS_BUILTIN.foo:M[yY][eE][sS])
BUILTIN_PKG.foo?= foo-1.0
. endif
.endif # IS_BUILTIN.foo
.if !defined(USE_BUILTIN.foo)
USE_BUILTIN.foo?= ${IS_BUILTIN.foo}
. if defined(BUILTIN_PKG.foo)
. for _depend_ in ${BUILDLINK_API_DEPENDS.foo}
. if !empty(USE_BUILTIN.foo:M[yY][eE][sS])
USE_BUILTIN.foo!= \
${PKG_ADMIN} pmatch '${_depend_}' ${BUILTIN_PKG.foo} \
&& ${ECHO} "yes" || ${ECHO} "no"
. endif
. endfor
. endif
.endif # USE_BUILTIN.foo
CHECK_BUILTIN.foo?= no
.if !empty(CHECK_BUILTIN.foo:M[nN][oO])
#
# Here we place code that depends on whether USE_BUILTIN.foo is set to
# "yes" or "no".
#
.endif # CHECK_BUILTIN.foo
The first section sets
IS_BUILTIN.pkg
depending on if pkg really exists
in the base system. This should not be a base system software
with similar functionality to pkg;
it should only be yes if the actual package is
included as part of the base system. This variable is only
used internally within the builtin.mk
file.The second section sets
BUILTIN_PKG.pkg
to the version of pkg in the base
system if it exists (if
IS_BUILTIN.pkg
is yes). This variable is only used internally
within the builtin.mk file.The third section sets
USE_BUILTIN.pkg
and is required in all
builtin.mk files. The code in this
section must make the determination whether the built-in
software is adequate to satisfy the dependencies listed in
BUILDLINK_API_DEPENDS.pkg.
This is typically done by comparing
BUILTIN_PKG.pkg
against each of the dependencies in
BUILDLINK_API_DEPENDS.pkg.
USE_BUILTIN.pkgmust be set to the correct value by the
end of the builtin.mk file. Note that
USE_BUILTIN.pkg
may be yes even if
IS_BUILTIN.pkg
is no because we may make the determination
that the built-in version of the software is similar enough to
be used as a replacement.The last section is guarded by
CHECK_BUILTIN.pkg,
and includes code that uses the value of
USE_BUILTIN.pkg
set in the previous section. This typically includes, e.g.,
adding additional dependency restrictions and listing additional
files to symlink into ${BUILDLINK_DIR} (via
BUILDLINK_FILES.pkg).
@
1.49
log
@doc/guide: move the PREFER section to the user's guide and rewrite it
The variables PREFER_PKGSRC and PREFER_NATIVE are user-settable,
therefore it was confusing to see them documented only in the developer
part.
Rewrite the whole section to sync with reality since neither of these
variables is tested for the word "no".
@
text
@d2 1
a2 1
d121 4
a124 5
x11/lesstif or x11/motif. The user can set
MOTIF_TYPE to dt,
lesstif or motif
to choose which Motif version will be used.
@
1.48
log
@doc: revert previous
@
text
@d2 1
a2 1
a572 68
Global preferences for native or pkgsrc softwareWhen building packages, it's possible to choose whether to set
a global preference for using either the built-in (native)
version or the pkgsrc version of software to satisfy a
dependency. This is controlled by setting
PREFER_PKGSRC and
PREFER_NATIVE. These variables take values
of either yes, no, or a list of
packages. PREFER_PKGSRC tells pkgsrc to
use the pkgsrc versions of software, while
PREFER_NATIVE tells pkgsrc to use the
built-in versions. Preferences are determined by the most
specific instance of the package in either
PREFER_PKGSRC or
PREFER_NATIVE. If a package is specified
in neither or in both variables, then
PREFER_PKGSRC has precedence over
PREFER_NATIVE. For example, to require
using pkgsrc versions of software for all but the most basic
bits on a NetBSD system, you can set:
PREFER_PKGSRC= yes
PREFER_NATIVE= getopt skey tcp_wrappers
A package must have a
builtin.mk
file to be listed in PREFER_NATIVE,
otherwise it is simply ignored in that list.PREFER_PKGSRC and
PREFER_NATIVE should be set during bootstrap
to ensure that the bootstrap process does not use inapropriate
native tools as dependencies for core packages.
&rprompt; ./bootstrap --prefer-pkgsrc yes --prefer-native openssl
Switching between settings globally at a later date can introduce
complications with dependency resolution. This is caused by packages
built with the opposite preference being installed alongside each
other. Hence, any changes to these variables after bootstrap will
necessitate rebuilding all packages depending on one whose preference
has been changed. This is not trivial and should be avoided.When using pkgsrc on Linux systems, there is high risk of
"leakage", where programs installed by pkgsrc may inadvertently use a
command or library not installed by pkgsrc, e.g. those installed by
yum or apt. Such foreign dependencies may be installed, removed, or
upgraded to a version incompatible with the pkgsrc package at any
time, causing pkgsrc packages to subsequently malfunction. Pkgsrc
cannot prevent this, as it has no control over other package managers.
Another potential problem is that under Redhat Enterprise and related
Linux systems, yum packages are only patched and never upgraded, so
eventually they may become too outdated for use by pkgsrc. Even
intentionally using foreign dependencies, not considered leakage, can
lead to these problems, so it is generally discouraged. In order to
minimize such problems, PREFER_PKGSRC defaults to "yes" on Linux systems.
This ensures that pkgsrc is aware of any changes to dependency packages
and can rebuild or upgrade the entire dependency tree as needed. This
default can be overridden by setting --prefer-pkgsrc to "no" or a list of
packages, or by setting --prefer-native to "yes".
@
1.47
log
@doc: document BUILDLINK_DEPMETHOD test.
@
text
@d2 1
a2 1
d252 1
a252 2
BUILD_DEPENDS,
TEST_DEPENDS, or
d257 1
a257 2
to build, while setting it to test causes
it to become a test dependency. By default, the full dependency is
@
1.46
log
@buildlink.xml: drop RCS ID from code example
It served no real purpose here, and causes CVS to inject the revision
details of the generated HTML file on each update instead.
@
text
@d2 1
a2 1
d252 2
a253 1
BUILD_DEPENDS or
d258 2
a259 1
to build. By default, the full dependency is
@
1.45
log
@buildlink.xml: add a note about USE_ABI_DEPENDS
@
text
@d2 1
a2 1
a205 2
# $NetBSD: buildlink3.mk,v 1.16 2009/03/20 19:24:45 joerg Exp $
@
1.44
log
@buildlink.xml: Document new PREFER_PKGSRC=yes default for Linux
Also document new boostrap --prefer-native flag and clarify dangers of
changing PREFER_* after bootstrap
@
text
@d2 1
a2 1
d436 1
a436 1
Also it is not needed to set
d439 5
a443 1
BUILDLINK_API_DEPENDS.pkg.
@
1.43
log
@Another try at improving the ABI/API section.
@
text
@d2 1
a2 1
d605 9
a613 3
Setting PREFER_NATIVE should be performed
straight after bootstrap and PREFER_PKGSRC during
bootstrap.
d616 22
a637 5
built with the opposite preference being installed alongside each other.
&rprompt; ./bootstrap --prefer-pkgsrc yes
@
1.42
log
@Try to improve the BUILDLINK_A{B,P}I_DEPENDS description after
comments from rillig@@.
@
text
@d1 2
a2 1
d410 12
a421 11
PKGREVISION of all packages that depend on
this package need to be increased, and if they have
buildlink3.mk files, their
BUILDLINK_ABI_DEPENDS.pkg
must be increased to the new version as well. This is required
so that a package will pull in the versions of the packages that
use the new ABI and that the packages'
PKGREVISIONs uniquely identify the packages
built against the new ABI. The pkgtools/revbump package can help with
these updates.
@
1.41
log
@Delete reference to x11/openmotif, it was retired in 2015, superseded by
x11/motif.
@
text
@d1 1
a1 1
d235 1
a235 1
is the actual dependency recorded in the installed
d239 1
a239 1
variable should be set to the first version of the
d382 2
a383 1
These two variables differ in that one describes source
d389 1
a389 1
Changes to the
d391 14
a404 4
variable in a buildlink3.mk file happen
very rarely. One possible reason is that all packages depending
on this already need a newer version. In case it is bumped see
the description below.
d406 1
a406 2
The most common example of an ABI change is that the major
version of a shared library is increased. In this case,
d408 3
a410 3
should be adjusted to require at least the new package version.
Then the packages that depend on this package need their
PKGREVISIONs increased and, if they have
d413 11
a423 8
adjusted, too. This is needed so pkgsrc will require the correct
package dependency and not settle for an older one when building
the source.See for
more information about dependencies on other packages,
including the BUILDLINK_ABI_DEPENDS and
ABI_DEPENDS definitions.
d429 4
a432 3
as we don't want to cause unneeded package deletions and
rebuilds. In many cases, new versions of packages work just
fine with older dependencies.
@
1.40
log
@Instruct the reader to set prefer-pkgsrc during bootstrap. It appears that
setting this post bootstrap does create issues, as observed with a Linux user
today.
@
text
@d1 1
a1 1
d120 2
a121 3
x11/lesstif, x11/motif or x11/openmotif. The user can set
d123 2
a124 3
lesstif, motif or
openmotif to choose
which Motif version will be used.
@
1.39
log
@detab
@
text
@d1 1
a1 1
d590 11
@
1.38
log
@Add closing tag.
@
text
@d1 1
a1 1
d209 1
a209 1
BUILDLINK_TREE+= tiff
d214 3
a216 3
BUILDLINK_API_DEPENDS.tiff+= tiff>=3.6.1
BUILDLINK_ABI_DEPENDS.tiff+= tiff>=3.7.2nb1
BUILDLINK_PKGSRCDIR.tiff?= ../../graphics/tiff
d222 1
a222 1
BUILDLINK_TREE+= -tiff
@
1.37
log
@Remove pkg_views support, second part: infrastructure.
@
text
@d1 1
a1 1
d324 1
a324 1
+CONTENTS.
@
1.36
log
@Fix typo
@
text
@d1 1
a1 1
d320 1
a320 1
on stdout. By default for overwrite packages,
d324 1
a324 3
+CONTENTS, and for pkgviews packages,
it outputs any libtool archives in
lib directories.
@
1.35
log
@Add paragraph on readline.buildlink3.mk and devel/readline/buildlink3.mk.
@
text
@d1 1
a1 1
d131 1
a131 1
system-provided GNU readline or ediline (libedit) installation,
@
1.34
log
@Minor fixes from rodent.
@
text
@d1 1
a1 1
d130 11
@
1.33
log
@ldd is not reliable for when to include buildlink3.mk files in others.
Update paragraph. Based on discussion with rodent@@.
@
text
@d1 1
a1 1
d341 1
a341 1
please only add necessary ones. I.e. those whose libraries or
d362 1
a362 1
X) it won't. lddoutput can thus only be
@
1.32
log
@Explain when buildlink3.mk files need to be included in other buildlink3.mk
files. Requested by rodent.
@
text
@d1 1
a1 1
a352 4
Run ldd on all installed
libraries and look against what other libraries they link. The
packages providing these must be
buildlinked.
d356 8
@
1.31
log
@refrect addtion of x11/motif as a MOTIF_TYPE
@
text
@d1 1
a1 1
d338 24
@
1.30
log
@Improve postgresql section as suggested by previous commit.
@
text
@d1 1
a1 1
d120 2
a121 1
x11/lesstif or lesstif, or openmotif to choose
@
1.29
log
@Update postgresql version information.
XXX: bare version numbers should not be in here, described with
XXX: PGSQL_VERSION_DEFAULT/PGSQL_VERSIONS_ACCEPTED instead.
@
text
@d1 1
a1 1
d135 3
a137 1
either Postgres 8.3, 8.4, 9.0, or 9.1, whichever is found installed. See
@
1.28
log
@Fix an editoro.
@
text
@d1 1
a1 1
d135 1
a135 1
either Postgres 8.0, 8.1, or 8.2, whichever is found installed. See
@
1.27
log
@Update documentation of ABI/API depends variables.
@
text
@d1 1
a1 1
d350 1
a350 1
BUILDLINK_API_DEPENDS.pkgreplaceable>varname>
@
1.26
log
@Update buildlink3 section for the BUILDLINK_TREE changes.
@
text
@d1 1
a1 1
d227 1
a227 1
package that had an API change.
d337 5
a341 1
Updating BUILDLINK_API_DEPENDS.pkg in buildlink3.mk files
d343 12
a354 4
The situation that requires increasing the dependency listed in
BUILDLINK_API_DEPENDS.pkg
after a package update is when the API or interface to the
header files change.
d356 11
a366 19
In this case,
BUILDLINK_API_DEPENDS.pkg
should be adjusted to require at least the new package
version. In some cases, the packages that depend on this new
version may need their PKGREVISIONs
increased and, if they have buildlink3.mk
files, their
BUILDLINK_API_DEPENDS.pkg
adjusted, too. This is needed so pkgsrc will require the
correct package dependency and not settle for an older one
when building the source.BUILDLINK_ABI_DEPENDS.pkg
should be increased when the binary interface or sonames
(major number of the library version) of any installed
shared libraries change. This is needed so that binary
packages made using it will require the correct package
dependency and not settle for an older one which will not
contain the necessary shared libraries.
d369 2
a370 2
more information about dependencies on other packages,
including the BUILDLINK_ABI_DEPENDS and
d382 2
a383 2
BUILDLINK_ABI_DEPENDS.pkg
when it is identical to
@
1.25
log
@Documented how to query for the options with which a dependent package
has been built.
@
text
@d1 1
a1 1
d192 1
a192 1
# $NetBSD: buildlink3.mk,v 1.7 2004/03/18 09:12:12 jlam Exp $
d194 1
a194 2
BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH}+
TIFF_BUILDLINK3_MK:= ${TIFF_BUILDLINK3_MK}+
d196 6
a201 11
.if ${BUILDLINK_DEPTH} == "+"
BUILDLINK_DEPENDS+= tiff
.endif
BUILDLINK_PACKAGES:= ${BUILDLINK_PACKAGES:Ntiff}
BUILDLINK_PACKAGES+= tiff
.if ${TIFF_BUILDLINK3_MK} == "+"
BUILDLINK_API_DEPENDS.tiff+= tiff>=3.6.1
BUILDLINK_PKGSRCDIR.tiff?= ../../graphics/tiff
.endif # TIFF_BUILDLINK3_MK
d205 1
d207 1
a207 1
BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH:S/+$//}
d211 1
a211 1
BUILDLINK_DEPTH, which is common across all
d213 1
a213 17
at what depth we are including
buildlink3.mk files.
The first section controls if the dependency on
pkg is added.
BUILDLINK_DEPENDS is the global list of
packages for which dependencies are added by
buildlink3.The second section advises pkgsrc that the
buildlink3.mk file for
pkg has been included at some point.
BUILDLINK_PACKAGES is the global list of
packages for which buildlink3.mk files
have been included. It must always be
appended to within a buildlink3.mk
file.
d215 1
a215 1
The third section is protected from multiple inclusion
d323 1
a323 1
The last section includes any
d332 2
a333 1
file is included.
@
1.24
log
@Changed all environments so that the first relevant
column starts in column 1. Everything else is left to the style sheet.
@
text
@d1 1
a1 1
d161 2
@
1.23
log
@Renamed BUILDLINK_TRANSFORM.* to BUILDLINK_FNAME_TRANSFORM.*, to make
clear that these variables are completely unrelated to
BUILDLINK_TRANSFORM.
Added a legacy check that catches appearances of BUILDLINK_TRANSFORM.*.
XXX: Where should incompatible changes in pkgsrc be documented?
@
text
@d1 1
a1 1
d72 3
a74 3
DEPENDS+= foo>=1.1.0:../../category/foo
d78 3
a80 3
.include "../../category/foo/buildlink3.mk"
d86 4
a89 4
BUILDLINK_API_DEPENDS.foo+= foo>=1.1.0
.include "../../category/foo/buildlink3.mk"
d189 2
a190 2
# $NetBSD: buildlink3.mk,v 1.7 2004/03/18 09:12:12 jlam Exp $
d192 2
a193 2
BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH}+
TIFF_BUILDLINK3_MK:= ${TIFF_BUILDLINK3_MK}+
d195 3
a197 3
.if !empty(BUILDLINK_DEPTH:M+)
BUILDLINK_DEPENDS+= tiff
.endif
d199 2
a200 2
BUILDLINK_PACKAGES:= ${BUILDLINK_PACKAGES:Ntiff}
BUILDLINK_PACKAGES+= tiff
d202 4
a205 4
.if !empty(TIFF_BUILDLINK3_MK:M+)
BUILDLINK_API_DEPENDS.tiff+= tiff>=3.6.1
BUILDLINK_PKGSRCDIR.tiff?= ../../graphics/tiff
.endif # TIFF_BUILDLINK3_MK
d207 2
a208 2
.include "../../devel/zlib/buildlink3.mk"
.include "../../graphics/jpeg/buildlink3.mk"
d210 2
a211 2
BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH:S/+$//}
d444 37
a480 40
.if !defined(IS_BUILTIN.foo)
#
# IS_BUILTIN.foo is set to "yes" or "no" depending on whether "foo"
# genuinely exists in the system or not.
#
IS_BUILTIN.foo?= no
# BUILTIN_PKG.foo should be set here if "foo" is built-in and its package
# version can be determined.
#
. if !empty(IS_BUILTIN.foo:M[yY][eE][sS])
BUILTIN_PKG.foo?= foo-1.0
. endif
.endif # IS_BUILTIN.foo
.if !defined(USE_BUILTIN.foo)
USE_BUILTIN.foo?= ${IS_BUILTIN.foo}
. if defined(BUILTIN_PKG.foo)
. for _depend_ in ${BUILDLINK_API_DEPENDS.foo}
. if !empty(USE_BUILTIN.foo:M[yY][eE][sS])
USE_BUILTIN.foo!= \
if ${PKG_ADMIN} pmatch '${_depend_}' ${BUILTIN_PKG.foo}; then \
${ECHO} "yes"; \
else \
${ECHO} "no"; \
fi
. endif
. endfor
. endif
.endif # USE_BUILTIN.foo
CHECK_BUILTIN.foo?= no
.if !empty(CHECK_BUILTIN.foo:M[nN][oO])
#
# Here we place code that depends on whether USE_BUILTIN.foo is set to
# "yes" or "no".
#
.endif # CHECK_BUILTIN.foo
d554 4
a557 4
PREFER_PKGSRC= yes
PREFER_NATIVE= getopt skey tcp_wrappers
@
1.22
log
@sync with mk/pgsql.buildlink3.mk rev. 1.20
> As discussed on tech-pkg, remove PostgreSQL 7.4.
@
text
@d1 1
a1 1
d334 1
a334 1
BUILDLINK_TRANSFORM.pkg
@
1.21
log
@sync with mk/pgsql.buildlink3.mk rev. 1.18
> Added postgresql82 version 8.2.0
@
text
@d1 1
a1 1
d135 1
a135 1
either Postgres 7.4, 8.0, 8.1, or 8.2, whichever is found installed. See
@
1.20
log
@Update the PostgreSQL versions referenced in buildlink.xml
@
text
@d1 1
a1 1
d135 1
a135 1
either Postgres 7.4, 8.0, or 8.1, whichever is found installed. See
@
1.19
log
@Describe valid values for MOTIF_TYPE.
@
text
@d1 1
a1 1
d135 1
a135 1
either Postgres 7.3 or 7.4, whichever is found installed. See
@
1.18
log
@It seems that the contents of should start in the first column
for consistency. Make it so.
@
text
@d1 1
a1 1
d118 7
a124 5
motif.buildlink3.mk checks
for a system-provided
Motif installation or adds a dependency on x11/lesstif or
x11/openmotif.
@
1.17
log
@Whitespace cleanups.
@
text
@d1 1
a1 1
d175 4
a178 2
&cprompt; cd pkgsrc/category/pkgdir
&cprompt; createbuildlink >buildlink3.mk
@
1.16
log
@Move around text and rewrite some of the text
explaining BUILDLINK_API_DEPENDS and
BUILDLINK_ABI_DEPENDS.
@
text
@d1 1
a1 1
d7 2
a8 2
are seen by a package's configure and build processes. This is implemented
in a two step process:
d13 2
a14 2
BUILDLINK_DIR, which by default is a subdirectory
of WRKDIR.
d19 6
a24 6
tools that translate and
into references to
BUILDLINK_DIR. The wrapper scripts also make
native compiler on some operating systems look like GCC, so that
packages that expect GCC won't require modifications to build with
those native compilers.
d29 6
a34 6
package may be built consistently despite what other software may be
installed. Please note that the normal system header and library paths,
e.g. /usr/include,
/usr/lib, etc., are always searched -- buildlink3 is
designed to insulate the package build from non-system-supplied
software.
d40 2
a41 2
framework (bl3ifying) is fairly straightforward.
The things to keep in mind are:
d45 5
a49 5
Ensure that the build always calls the wrapper scripts
instead of the actual toolchain. Some packages are tricky,
and the only way to know for sure is the check
${WRKDIR}/.work.log to see if the
wrappers are being invoked.
d53 6
a58 6
Don't override PREFIX from within
the package Makefile, e.g. Java VMs, standalone shells,
etc., because the code to symlink files into
${BUILDLINK_DIR} looks for files
relative to pkg_info -qp pkgname.
d62 4
a65 4
Remember that only the
buildlink3.mk files that you list in a
package's Makefile are added as dependencies for that package.
d69 2
a70 2
If a dependency on a particular package is required for its libraries and
headers, then we replace:
d72 3
a74 3
DEPENDS+= foo>=1.1.0:../../category/foo
d78 3
a80 3
.include "../../category/foo/buildlink3.mk"
d84 1
a84 2
files, then you can define it in your Makefile; for example:
d86 4
a89 4
BUILDLINK_API_DEPENDS.foo+= foo>=1.1.0
.include "../../category/foo/buildlink3.mk"
d92 2
a93 2
files in pkgsrc/mk
that handle special package issues:
d98 3
a100 3
the native or a pkgsrc Berkeley DB implementation based on
the values of BDB_ACCEPTED and
BDB_DEFAULT.
d105 3
a107 3
comes with neither Curses nor NCurses, this will take care
to install the devel/ncurses package.
d112 3
a114 3
of KRB5_ACCEPTED to choose between
adding a dependency on Heimdal or MIT-krb5 for packages that
require a Kerberos 5 implementation.
d119 4
a122 4
for a system-provided
Motif installation or adds a dependency on x11/lesstif or
x11/openmotif.
d127 2
a128 2
variables that may be used by packages that use the
Open Sound System (OSS) API.
d133 2
a134 2
either Postgres 7.3 or 7.4, whichever is found installed. See
the file for more information.
d139 3
a141 3
PTHREAD_OPTS and checks for native pthreads or adds
a dependency on devel/pth as needed.
d146 2
a147 2
XAW_TYPE to choose a particular Athena widgets
library.
d152 2
a153 2
files provide a more complete
description of how to use them properly.
d159 15
a173 15
A package's buildlink3.mk file is
included by Makefiles to indicate the need to compile and link
against header files and libraries provided by the package. A
buildlink3.mk file should always provide
enough information to add the correct type of dependency
relationship and include any other
buildlink3.mk files that it needs to find
headers and libraries that it needs in turn. To generate an initial buildlink3.mk
file for further editing, Rene Hexel's pkgtools/createbuildlink
package is highly recommended. For most packages, the following
command will generate a good starting point for
buildlink3.mk files:
d176 1
a176 1
&cprompt; createbuildlink >buildlink3.mk
d182 2
a183 2
buildlink3.mk is taken
from pkgsrc/graphics/tiff:
d185 2
a186 2
# $NetBSD: buildlink3.mk,v 1.7 2004/03/18 09:12:12 jlam Exp $
d188 2
a189 2
BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH}+
TIFF_BUILDLINK3_MK:= ${TIFF_BUILDLINK3_MK}+
d191 42
a232 43
.if !empty(BUILDLINK_DEPTH:M+)
BUILDLINK_DEPENDS+= tiff
.endif
BUILDLINK_PACKAGES:= ${BUILDLINK_PACKAGES:Ntiff}
BUILDLINK_PACKAGES+= tiff
.if !empty(TIFF_BUILDLINK3_MK:M+)
BUILDLINK_API_DEPENDS.tiff+= tiff>=3.6.1
BUILDLINK_PKGSRCDIR.tiff?= ../../graphics/tiff
.endif # TIFF_BUILDLINK3_MK
.include "../../devel/zlib/buildlink3.mk"
.include "../../graphics/jpeg/buildlink3.mk"
BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH:S/+$//}
The header and footer manipulate
BUILDLINK_DEPTH, which is common across all
buildlink3.mk files and is used to track
at what depth we are including
buildlink3.mk files. The first section controls if the dependency on
pkg is added.
BUILDLINK_DEPENDS is the global list of
packages for which dependencies are added by
buildlink3. The second section advises pkgsrc that the
buildlink3.mk file for
pkg has been included at some point.
BUILDLINK_PACKAGES is the global list of
packages for which buildlink3.mk files
have been included. It must always be
appended to within a buildlink3.mk
file. The third section is protected from multiple inclusion
and controls how the dependency on pkg is
added. Several important variables are set in the section:
d235 9
a243 9
BUILDLINK_API_DEPENDS.pkg
is the actual dependency recorded in the installed
package; this should always be set using
+= to ensure that
we're appending to any pre-existing list of values. This
variable should be set to the first version of the
package that had an API change.
d246 4
a249 4
BUILDLINK_PKGSRCDIR.pkg
is the location of the pkg
pkgsrc directory.
d252 10
a261 12
BUILDLINK_DEPMETHOD.pkg
(not shown above) controls whether we use
BUILD_DEPENDS or
DEPENDS to add the dependency on
pkg.
The build dependency is selected by setting
BUILDLINK_DEPMETHOD.pkg
to build. By default, the
full dependency is used.
d264 2
a265 3
BUILDLINK_INCDIRS.pkg
d272 1
a272 1
respectively.
d275 2
a276 3
BUILDLINK_CPPFLAGS.pkg
d282 1
a282 1
above.
d286 5
a290 5
The following variables are all optionally defined within
this second section (protected against multiple inclusion) and
control which package files are symlinked into
${BUILDLINK_DIR} and how their names are
transformed during the symlinking:
d293 2
a294 3
BUILDLINK_FILES.pkg
d299 1
a299 1
e.g. include/*.h.
d302 10
a311 12
BUILDLINK_FILES_CMD.pkg
(not shown above) is a shell pipeline that
outputs to stdout a list of files relative to
${BUILDLINK_PREFIX.pkg}.
The resulting files are to be symlinked
into ${BUILDLINK_DIR}. By default,
this takes the +CONTENTS of a
pkg and filters it through
${BUILDLINK_CONTENTS_FILTER.pkg}.
d314 2
a315 3
BUILDLINK_CONTENTS_FILTER.pkg
d326 1
a326 2
lib directories.
d329 2
a330 3
BUILDLINK_TRANSFORM.pkg
d334 1
a334 2
"s|/curses.h|/ncurses.h|g".
d338 10
a347 11
The last section includes any
buildlink3.mk needed for
pkg's library dependencies.
Including these buildlink3.mk files
means that the headers and libraries for these
dependencies are also symlinked into
${BUILDLINK_DIR}
whenever the pkgbuildlink3.mk
file is included.
d353 1
a353 2
The situation that requires increasing the dependency listed in
d356 1
a356 1
header files change.
d358 11
a368 11
In this case,
BUILDLINK_API_DEPENDS.pkg
should be adjusted to require at least the new package
version. In some cases, the packages that depend on this new
version may need their PKGREVISIONs
increased and, if they have buildlink3.mk
files, their
BUILDLINK_API_DEPENDS.pkg
adjusted, too. This is needed so pkgsrc will require the
correct package dependency and not settle for an older one
when building the source.
d370 1
a370 2
BUILDLINK_ABI_DEPENDS.pkg
d376 1
a376 1
contain the necessary shared libraries.
d378 1
a378 2
See for
d381 1
a381 1
ABI_DEPENDS definitions.
d383 7
a389 7
Please take careful consideration before adjusting
BUILDLINK_API_DEPENDS.pkg
or
BUILDLINK_ABI_DEPENDS.pkg
as we don't want to cause unneeded package deletions and
rebuilds. In many cases, new versions of packages work just
fine with older dependencies.
d391 1
a391 2
Also it is not needed to set
d394 1
a394 1
BUILDLINK_API_DEPENDS.pkg.
d401 1
a401 2
Some packages in pkgsrc install headers and libraries that
d407 1
a407 1
appropriate.
d409 2
a410 3
The only requirements of a builtin.mk file for
pkg are:
d414 4
a417 5
It should set
USE_BUILTIN.pkg
to either yes or no
after it is included.
d421 4
a424 5
It should not override any
USE_BUILTIN.pkg
which is already set before the
builtin.mk file is included.
d428 3
a430 4
It should be written to allow multiple inclusion. This
is very important and takes careful
attention to Makefile coding.
d438 1
a438 1
files:
d440 88
a527 90
.if !defined(IS_BUILTIN.foo)
#
# IS_BUILTIN.foo is set to "yes" or "no" depending on whether "foo"
# genuinely exists in the system or not.
#
IS_BUILTIN.foo?= no
# BUILTIN_PKG.foo should be set here if "foo" is built-in and its package
# version can be determined.
#
. if !empty(IS_BUILTIN.foo:M[yY][eE][sS])
BUILTIN_PKG.foo?= foo-1.0
. endif
.endif # IS_BUILTIN.foo
.if !defined(USE_BUILTIN.foo)
USE_BUILTIN.foo?= ${IS_BUILTIN.foo}
. if defined(BUILTIN_PKG.foo)
. for _depend_ in ${BUILDLINK_API_DEPENDS.foo}
. if !empty(USE_BUILTIN.foo:M[yY][eE][sS])
USE_BUILTIN.foo!= \
if ${PKG_ADMIN} pmatch '${_depend_}' ${BUILTIN_PKG.foo}; then \
${ECHO} "yes"; \
else \
${ECHO} "no"; \
fi
. endif
. endfor
. endif
.endif # USE_BUILTIN.foo
CHECK_BUILTIN.foo?= no
.if !empty(CHECK_BUILTIN.foo:M[nN][oO])
#
# Here we place code that depends on whether USE_BUILTIN.foo is set to
# "yes" or "no".
#
.endif # CHECK_BUILTIN.foo
The first section sets
IS_BUILTIN.pkg
depending on if pkg really exists
in the base system. This should not be a base system software
with similar functionality to pkg;
it should only be yes if the actual package is
included as part of the base system. This variable is only
used internally within the builtin.mk
file. The second section sets
BUILTIN_PKG.pkg
to the version of pkg in the base
system if it exists (if
IS_BUILTIN.pkg
is yes). This variable is only used internally
within the builtin.mk file. The third section sets
USE_BUILTIN.pkg
and is required in all
builtin.mk files. The code in this
section must make the determination whether the built-in
software is adequate to satisfy the dependencies listed in
BUILDLINK_API_DEPENDS.pkg.
This is typically done by comparing
BUILTIN_PKG.pkg
against each of the dependencies in
BUILDLINK_API_DEPENDS.pkg.
USE_BUILTIN.pkgmust be set to the correct value by the
end of the builtin.mk file. Note that
USE_BUILTIN.pkg
may be yes even if
IS_BUILTIN.pkg
is no because we may make the determination
that the built-in version of the software is similar enough to
be used as a replacement. The last section is guarded by
CHECK_BUILTIN.pkg,
and includes code that uses the value of
USE_BUILTIN.pkg
set in the previous section. This typically includes, e.g.,
adding additional dependency restrictions and listing
additional files to symlink into
${BUILDLINK_DIR} (via
BUILDLINK_FILES.pkg).
d533 29
a561 31
When building packages, it's possible to choose whether to set
a global preference for using either the built-in (native)
version or the pkgsrc version of software to satisfy a
dependency. This is controlled by setting
PREFER_PKGSRC and
PREFER_NATIVE. These variables take values
of either yes, no, or a list of
packages. PREFER_PKGSRC tells pkgsrc to
use the pkgsrc versions of software, while
PREFER_NATIVE tells pkgsrc to use the
built-in versions. Preferences are determined by the most
specific instance of the package in either
PREFER_PKGSRC or
PREFER_NATIVE. If a package is specified
in neither or in both variables, then
PREFER_PKGSRC has precedence over
PREFER_NATIVE. For example, to require
using pkgsrc versions of software for all but the most basic
bits on a NetBSD system, you can set:
PREFER_PKGSRC= yes
PREFER_NATIVE= getopt skey tcp_wrappers
A package must have a
builtin.mk
file to be listed in PREFER_NATIVE,
otherwise it is simply ignored in that list.
@
1.15
log
@Fix documention about about BUILDLINK_API_DEPENDS (was
BUILDLINK_DEPENDS) and BUILDLINK_ABI_DEPENDS.pkg (was
BUILDLINK_RECOMMENDED).
Noticed
@
text
@d1 1
a1 1
d368 1
a368 2
There are two situations that require increasing the
dependency listed in
d370 2
a371 1
after a package update:
d373 1
a373 12
if the sonames (major number of the library version)
of any installed shared libraries change. if the API or interface to the header files change. In these cases,
d381 18
a398 4
adjusted, too. This is needed so that binary packages made
using it will require the correct package dependency and not
settle for an older one which will not contain the necessary
shared libraries.
d402 2
d406 7
a412 5
fine with older dependencies. See for
more information about dependencies on other packages,
including the BUILDLINK_ABI_DEPENDS and
ABI_DEPENDS definitions.
@
1.14
log
@Over 1200 files touched but no revisions bumped :)
RECOMMENDED is removed. It becomes ABI_DEPENDS.
BUILDLINK_RECOMMENDED.foo becomes BUILDLINK_ABI_DEPENDS.foo.
BUILDLINK_DEPENDS.foo becomes BUILDLINK_API_DEPENDS.foo.
BUILDLINK_DEPENDS does not change.
IGNORE_RECOMMENDED (which defaulted to "no") becomes USE_ABI_DEPENDS
which defaults to "yes".
Added to obsolete.mk checking for IGNORE_RECOMMENDED.
I did not manually go through and fix any aesthetic tab/spacing issues.
I have tested the above patch on DragonFly building and packaging
subversion and pkglint and their many dependencies.
I have also tested USE_ABI_DEPENDS=no on my NetBSD workstation (where I
have used IGNORE_RECOMMENDED for a long time). I have been an active user
of IGNORE_RECOMMENDED since it was available.
As suggested, I removed the documentation sentences suggesting bumping for
"security" issues.
As discussed on tech-pkg.
I will commit to revbump, pkglint, pkg_install, createbuildlink separately.
Note that if you use wip, it will fail! I will commit to pkgsrc-wip
later (within day).
@
text
@d1 1
a1 1
d244 1
a244 2
package that had the last change in the major number of a
shared library or that had a major API change.
@
1.13
log
@ossaudio.buildlink3.mk instances should now be "oss.buildlink3.mk"
@
text
@d1 1
a1 1
d88 1
a88 1
BUILDLINK_DEPENDS.foo+= foo>=1.1.0
d200 1
a200 1
BUILDLINK_DEPENDS.tiff+= tiff>=3.6.1
d238 1
a238 1
BUILDLINK_DEPENDS.pkg
d366 1
a366 1
Updating BUILDLINK_DEPENDS.pkg in buildlink3.mk files
d371 1
a371 1
BUILDLINK_DEPENDS.pkg
d386 1
a386 1
BUILDLINK_DEPENDS.pkg
d392 1
a392 1
BUILDLINK_DEPENDS.pkg
d399 1
a399 1
BUILDLINK_DEPENDS.pkg
d405 2
a406 2
including the BUILDLINK_RECOMMENDED and
RECOMMENDED definitions.
d476 1
a476 1
. for _depend_ in ${BUILDLINK_DEPENDS.foo}
d522 1
a522 1
BUILDLINK_DEPENDS.pkg.
d526 1
a526 1
BUILDLINK_DEPENDS.pkg.
@
1.12
log
@Removed trailing white-space.
@
text
@d1 1
a1 1
d127 1
a127 1
ossaudio.buildlink3.mk defines several
@
1.11
log
@Reindented all s.
@
text
@d1 1
a1 1
d24 1
a24 1
those native compilers.
d32 1
a32 1
/usr/lib, etc., are always searched -- buildlink3 is
d51 1
a51 1
d57 1
a57 1
relative to pkg_info -qp pkgname.
d60 1
a60 1
d63 1
a63 1
buildlink3.mk files that you list in a
d71 1
a71 1
d101 1
a101 1
BDB_DEFAULT.
d107 2
a108 2
to install the devel/ncurses package.
d113 1
a113 1
of KRB5_ACCEPTED to choose between
d121 1
a121 1
Motif installation or adds a dependency on
d183 1
a183 1
buildlink3.mk is taken
d248 1
a248 1
d252 1
a252 1
pkgsrc directory.
d254 1
a254 1
d259 1
a259 1
BUILD_DEPENDS or
d261 1
a261 1
pkg.
d264 1
a264 1
to build. By default, the
d268 1
a268 1
d280 1
a280 1
d288 3
a290 3
BUILDLINK_INCDIRS.pkg as
above.
d305 1
a305 1
to be symlinked into
d307 3
a309 3
e.g. include/*.h.
d313 1
a313 1
(not shown above) is a shell pipeline that
d316 1
a316 1
The resulting files are to be symlinked
d318 1
a318 1
this takes the +CONTENTS of a
d320 1
a320 1
${BUILDLINK_CONTENTS_FILTER.pkg}.
d322 2
a323 2
d339 2
a340 2
d345 1
a345 1
transform the name of the source filename into a
d347 1
a347 1
"s|/curses.h|/ncurses.h|g".
d349 1
a349 1
d358 1
a358 1
${BUILDLINK_DIR}
d360 2
a361 2
buildlink3.mk
file is included.
d423 1
a423 1
pkg are:
d446 1
a446 1
attention to Makefile coding.
d514 1
a514 1
within the builtin.mk file.
d546 1
a546 1
d548 1
a548 1
d572 1
a572 1
d579 1
a579 1
builtin.mk
@
1.10
log
@Removed the -3 option from the example call to createbuildlink.
@
text
@d1 1
a1 1
d72 3
a74 1
DEPENDS+= foo>=1.1.0:../../category/foo
d78 3
a80 1
.include "../../category/foo/buildlink3.mk"
d87 4
a90 2
BUILDLINK_DEPENDS.foo+= foo>=1.1.0
.include "../../category/foo/buildlink3.mk"
d186 2
a187 2
# $NetBSD: buildlink3.mk,v 1.7 2004/03/18 09:12:12 jlam Exp $
d189 2
a190 2
BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH}+
TIFF_BUILDLINK3_MK:= ${TIFF_BUILDLINK3_MK}+
d192 3
a194 3
.if !empty(BUILDLINK_DEPTH:M+)
BUILDLINK_DEPENDS+= tiff
.endif
d196 2
a197 2
BUILDLINK_PACKAGES:= ${BUILDLINK_PACKAGES:Ntiff}
BUILDLINK_PACKAGES+= tiff
d199 4
a202 4
.if !empty(TIFF_BUILDLINK3_MK:M+)
BUILDLINK_DEPENDS.tiff+= tiff>=3.6.1
BUILDLINK_PKGSRCDIR.tiff?= ../../graphics/tiff
.endif # TIFF_BUILDLINK3_MK
d204 2
a205 2
.include "../../devel/zlib/buildlink3.mk"
.include "../../graphics/jpeg/buildlink3.mk"
d207 2
a208 1
BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH:S/+$//}
d457 40
a496 40
.if !defined(IS_BUILTIN.foo)
#
# IS_BUILTIN.foo is set to "yes" or "no" depending on whether "foo"
# genuinely exists in the system or not.
#
IS_BUILTIN.foo?= no
# BUILTIN_PKG.foo should be set here if "foo" is built-in and its package
# version can be determined.
#
. if !empty(IS_BUILTIN.foo:M[yY][eE][sS])
BUILTIN_PKG.foo?= foo-1.0
. endif
.endif # IS_BUILTIN.foo
.if !defined(USE_BUILTIN.foo)
USE_BUILTIN.foo?= ${IS_BUILTIN.foo}
. if defined(BUILTIN_PKG.foo)
. for _depend_ in ${BUILDLINK_DEPENDS.foo}
. if !empty(USE_BUILTIN.foo:M[yY][eE][sS])
USE_BUILTIN.foo!= \
if ${PKG_ADMIN} pmatch '${_depend_}' ${BUILTIN_PKG.foo}; then \
${ECHO} "yes"; \
else \
${ECHO} "no"; \
fi
. endif
. endfor
. endif
.endif # USE_BUILTIN.foo
CHECK_BUILTIN.foo?= no
.if !empty(CHECK_BUILTIN.foo:M[nN][oO])
#
# Here we place code that depends on whether USE_BUILTIN.foo is set to
# "yes" or "no".
#
.endif # CHECK_BUILTIN.foo
d573 4
a576 4
PREFER_PKGSRC= yes
PREFER_NATIVE= getopt skey tcp_wrappers
@
1.9
log
@Remove indentation of second line of example I just committed.
@
text
@d1 1
a1 1
d171 1
a171 1
&cprompt; createbuildlink -3 >buildlink3.mk
@
1.8
log
@In the "converting packages to use buildlink" section,
mention setting BUILDLINK_DEPENDS.foo.
(Suggested by Steven M. Bellovin on tech-pkg.)
@
text
@d1 1
a1 1
d84 1
a84 1
.include "../../category/foo/buildlink3.mk"
@
1.7
log
@Various fixes for typos and grammar by Leonard Schmidt.
@
text
@d1 1
a1 1
d78 8
@
1.6
log
@Replace by as discussed on netbsd-docs@@.
ok hubertf@@
@
text
@d1 1
a1 1
d91 1
a91 1
curses.buildlink3.mk If the system
d109 1
a109 1
x11/openmotif;
d115 1
a115 1
Open Sound System (OSS) API;
d128 1
a128 1
role="pkg">devel/pth as needed;
d237 1
a237 1
pkgsrc directory;
d362 1
a362 1
of any installed shared libraries change;
@
1.5
log
@Remove link back to this same documentation.
@
text
@d1 1
a1 1
d93 2
a94 1
to install the devel/ncurses package.
d107 3
a109 2
Motif installation or adds a dependency on x11/lesstif or
x11/openmotif;
d127 2
a128 1
a dependency on devel/pth as needed;
d156 2
a157 1
file for further editing, Rene Hexel's pkgtools/createbuildlink
@
1.4
log
@Add an id to all sect[123].
@
text
@d1 1
a1 1
d384 1
a384 1
linkend="dependencies"/> and for
@
1.3
log
@Applied the "detab" tab->space conversion.
@
text
@d1 1
a1 1
d36 1
a36 1
d140 1
a140 1
d161 1
a161 1
d346 1
a346 1
d391 1
a391 1
d432 1
a432 1
d530 1
a530 1
@
1.2
log
@Remove reference to USE_BUILDLINK3.
@
text
@d1 1
a1 1
d72 1
a72 1
DEPENDS+= foo>=1.1.0:../../category/foo
d171 2
a172 2
BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH}+
TIFF_BUILDLINK3_MK:= ${TIFF_BUILDLINK3_MK}+
d175 1
a175 1
BUILDLINK_DEPENDS+= tiff
d178 2
a179 2
BUILDLINK_PACKAGES:= ${BUILDLINK_PACKAGES:Ntiff}
BUILDLINK_PACKAGES+= tiff
d182 3
a184 3
BUILDLINK_DEPENDS.tiff+= tiff>=3.6.1
BUILDLINK_PKGSRCDIR.tiff?= ../../graphics/tiff
.endif # TIFF_BUILDLINK3_MK
d189 1
a189 1
BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH:S/+$//}
d444 1
a444 1
IS_BUILTIN.foo?= no
d450 1
a450 1
BUILTIN_PKG.foo?= foo-1.0
d455 1
a455 1
USE_BUILTIN.foo?= ${IS_BUILTIN.foo}
d459 5
a463 5
USE_BUILTIN.foo!= \
if ${PKG_ADMIN} pmatch '${_depend_}' ${BUILTIN_PKG.foo}; then \
${ECHO} "yes"; \
else \
${ECHO} "no"; \
d468 1
a468 1
.endif # USE_BUILTIN.foo
d470 1
a470 1
CHECK_BUILTIN.foo?= no
d555 2
a556 2
PREFER_PKGSRC= yes
PREFER_NATIVE= getopt skey tcp_wrappers
@
1.1
log
@Initial revision
@
text
@d1 1
a1 1
a44 5
Set USE_BUILDLINK3 to
yes.
@
1.1.1.1
log
@import The pkgsrc guide, the docbook conversion/replacement of
Packages.txt; Packages.txt will be going away.
this package contains the source files and a mechanism to install
pkgsrc/doc/pkgsrc.{html,txt} which are distributed with pkgsrc. it
uses the same docbook infrastructure that is used to build the
documentation on www.NetBSD.org.
@
text
@@