Chapter 22. Frequently Asked Questions

This section contains the answers to questions that may arise when you are writing a package. If you don't find your question answered here, first have a look in the other chapters, and if you still don't have the answer, ask on the pkgsrc-users mailing list.

22.1. What is the difference between MAKEFLAGS, .MAKEFLAGS and MAKE_FLAGS?
22.2. What is the difference between MAKE, GMAKE and MAKE_PROGRAM?
22.3. What is the difference between CC, PKG_CC and PKGSRC_COMPILER?
22.4. What is the difference between BUILDLINK_LDFLAGS, BUILDLINK_LDADD and BUILDLINK_LIBS?
22.5. Why does make show-var VARNAME=BUILDLINK_PREFIX.foo say it's empty?
22.6. What does ${MASTER_SITE_SOURCEFORGE:=package/} mean? I don't understand the := inside it.
22.7. Which mailing lists are there for package developers?
22.8. Where is the pkgsrc documentation?
22.9. I have a little time to kill. What shall I do?

22.1.

What is the difference between MAKEFLAGS, .MAKEFLAGS and MAKE_FLAGS?

MAKEFLAGS are the flags passed to the pkgsrc-internal invocations of make(1), while MAKE_FLAGS are the flags that are passed to the MAKE_PROGRAM when building the package. [FIXME: What is .MAKEFLAGS for?]

22.2.

What is the difference between MAKE, GMAKE and MAKE_PROGRAM?

MAKE is the path to the make(1) program that is used in the pkgsrc infrastructure. GMAKE is the path to GNU Make, but you need to say USE_TOOLS+=gmake to use that. MAKE_PROGRAM is the path to the Make program that is used for building the package.

22.3.

What is the difference between CC, PKG_CC and PKGSRC_COMPILER?

CC is the path to the real C compiler, which can be configured by the pkgsrc user. PKG_CC is the path to the compiler wrapper. PKGSRC_COMPILER is not a path to a compiler, but the type of compiler that should be used. See mk/compiler.mk for more information about the latter variable.

22.4.

What is the difference between BUILDLINK_LDFLAGS, BUILDLINK_LDADD and BUILDLINK_LIBS?

[FIXME]

22.5.

Why does make show-var VARNAME=BUILDLINK_PREFIX.foo say it's empty?

For optimization reasons, some variables are only available in the wrapper phase and later. To simulate the wrapper phase, append PKG_PHASE=wrapper to the above command.

22.6.

What does ${MASTER_SITE_SOURCEFORGE:=package/} mean? I don't understand the := inside it.

The := is not really an assignment operator, like you might expect at first sight. Instead, it is a degenerate form of ${LIST:old_string=new_string}, which is documented in the make(1) man page and which you may have seen as in ${SRCS:.c=.o}. In the case of MASTER_SITE_*, old_string is the empty string and new_string is package/. That's where the : and the = fall together.

22.7.

Which mailing lists are there for package developers?

tech-pkg

This is a list for technical discussions related to pkgsrc development, e.g. soliciting feedback for changes to pkgsrc infrastructure, proposed new features, questions related to porting pkgsrc to a new platform, advice for maintaining a package, patches that affect many packages, help requests moved from pkgsrc-users when an infrastructure bug is found, etc.

pkgsrc-bugs

All bug reports in category "pkg" sent with send-pr(1) appear here. Please do not report your bugs here directly; use one of the other mailing lists.

22.8.

Where is the pkgsrc documentation?

There are many places where you can find documentation about pkgsrc:

  • The pkgsrc guide (this document) is a collection of chapters that explain large parts of pkgsrc, but some chapters tend to be outdated. Which ones they are is hard to say.

  • On the mailing list archives (see http://mail-index.NetBSD.org/), you can find discussions about certain features, announcements of new parts of the pkgsrc infrastructure and sometimes even announcements that a certain feature has been marked as obsolete. The benefit here is that each message has a date appended to it.

  • Many of the files in the mk/ directory start with a comment that describes the purpose of the file and how it can be used by the pkgsrc user and package authors. An easy way to find this documentation is to run bmake help.

  • The CVS log messages are a rich source of information, but they tend to be highly abbreviated, especially for actions that occur often. Some contain a detailed description of what has changed, but they are geared towards the other pkgsrc developers, not towards an average pkgsrc user. They also only document changes, so if you don't know what has been before, these messages may not be worth too much to you.

  • Some parts of pkgsrc are only implicitly documented, that is the documentation exists only in the mind of the developer who wrote the code. To get this information, use the cvs annotate command to see who has written it and ask on the tech-pkg mailing list, so that others can find your questions later (see above). To be sure that the developer in charge reads the mail, you may CC him or her.

22.9.

I have a little time to kill. What shall I do?

This is not really an FAQ yet, but here's the answer anyway.

  • Run pkg_chk -N (from the pkgtools/pkg_chk package). It will tell you about newer versions of installed packages that are available, but not yet updated in pkgsrc.

  • Browse pkgsrc/doc/TODO — it contains a list of suggested new packages and a list of cleanups and enhancements for pkgsrc that would be nice to have.

  • Review packages for which review was requested on the tech-pkg mailing list.