summaryrefslogtreecommitdiff
path: root/mk/bsd.pkg.mk
AgeCommit message (Collapse)AuthorFilesLines
2006-07-17Added LOCALBASE, PKGINFODIR and PKGMANDIR to _BUILD_DEFS, since theyrillig1-1/+4
influence the way the package is installed. Also, they are so commonly used that it would be a nuisance to add it to every package Makefile.
2006-07-15Split the variable BUILD_DEFS into those that are defined by packagesrillig1-44/+15
and those that are defined by the infrastructure (_BUILD_DEFS). This allows the build-defs-message target to be moved to the end of bsd.pkg.mk. Now it prints the correct result even in unprivileged builds, which had been wrong due to the order in which the files have been included. For example, ${UNPRIVILEGED_USER} was displayed as (not defined) although its value was defined, which could be checked with "bmake show-var". Tested with one package that _does_ define BUILD_DEFS and with one that doesn't. The behavior stays the same.
2006-07-13Remove line noting that "this file was derived from bsd.ports.mk".jlam1-3/+1
The contents of this file are no longer remotedly related to bsd.ports.mk, and pkgsrc's heritage from ports is documented elsewhere.
2006-07-13* Add a new stage "bootstrap-depends" that happens before all otherjlam1-199/+18
stages, and that installs dependencies listed in BOOTSTRAP_DEPENDS. The bootstrap-depends step works just like the normal depends step and honors the value of DEPENDS_TARGET. It's now possible to add dependencies solely to facilitate fetching the distfiles, e.g. BOOTSTRAP_DEPENDS+= curl-[0-9]*:../../www/curl * Teach the tools framework about ":bootstrap" as a tools modifier which indicates the tool should be added as a dependency via BOOTSTRAP_DEPENDS. * Add "digest" to the tools framework. * Use USE_TOOLS+=digest:bootstrap to force pkgsrc to install digest before anything else. Get rid of unused "uptodate-digest" target and related digest version-checking code. * Finish the refactoring work: split checksum-related code out of bsd.pkg.mk and into pkgsrc/mk/checksum and replace the "checksum" target command list with a script that does all the real work. * Make DIGEST_ALGORITHMS and PATCH_DIGEST_ALGORITHM into private variables by prepending them with an underscore. Also, rename _PATCH_DIGEST_ALGORITHM to _PATCH_DIGEST_ALGORITHMS and adjust the makepatchsum target to allow that variable to contain a list of algorithms, all of which are used when creating the patch checksums for ${DISTINFO_FILE}.
2006-07-10Completely nuke the concept of PKG_PHASE from pkgsrc except for thejlam1-3/+2
purposes of caching MAKEVARS within bsd.pkg.mk and bsd.makevars.mk.
2006-07-08Update the comments to reflect the current default workflow.jlam1-2/+4
2006-07-07Rename <phase>_COOKIE variables to _COOKIE.<phase>. These are privatejlam1-2/+2
variables so there are no user-visible changes. This change just makes it a little easier to write for loops.
2006-07-07Remove the commands that tried to make the ${X11BASE} directory if itjlam1-8/+2
didn't exist. Those commands were never run anyway, but moving the .MAIN target exposed these commands as unassociated.
2006-07-06Make it a little easier to read the lock/unlock output by inserting somejlam1-3/+3
quotes.
2006-07-06Refactor the README.html generation code from bsd.pkg.mk into a separatejlam1-314/+4
bsd.pkg.readme.mk and document the public targets and variables for this new file.
2006-07-06Fix previous... instead of moving bsd.pkg.barrier.mk down below .MAIN,jlam1-6/+6
move .MAIN all the way to the top of the file. bsd.pkg.barrier.mk (currently) needs to be included before bsd.wrapper.mk since it defines _BARRIER_COOKIE, which is expanded and used in place within bsd.wrapper.mk. This makes the "wrapper" phase run again.
2006-07-06Move inclusion of bsd.pkg.barrier.mk under the .MAIN target becausejlam1-4/+4
bsd.pkg.barrier.mk uses the "make()" test expression. Also, include "all" as a post-barrier target since it is implicitly the ".MAIN" target when a user just types "make" in a package directory.
2006-07-05Fixed the test on PKG_{FAIL,SKIP}_REASON. Added a prefix line to therillig1-3/+8
output of PKG_SKIP_REASON, since the plain message does not say where it comes from.
2006-07-05Flatten out recursive makes into a single re-invocation of make byjlam1-1/+4
introducing the concept of a "barrier". We separate the user-invokable targets into ones that must happen before the barrier, and ones that must happen after the barrier. The ones that happen after the barrier are run in a sub-make process. In this case, the targets that must be run after the barrier are from the "wrapper" step and beyond. We rewrite the various "flow" targets, e.g. wrapper, configure, build, etc., so that they of the right form to use the barrier target. This now completely removes the concept of PKG_PHASE from pkgsrc. It is replaced with the concept of "before" and "after" the barrier, and this state can be checked by testing for the existence of the barrier cookie file. Because we've removed most of the recursive makes, there is now nowhere to hook the PKG_ERROR_HANDLER.* commands, so remove them for now. As part of this commit, put back the logic that conditionalized the sources for the various cookie files. Because the sources are all "phony" targets, they were always run, regardless of whether or not the cookie file already existed. Now, if a cookie file exists, then that entire phase associated with that cookie file is skipped. Lastly, fix a thinko in configure/bsd.configure.mk where setting NO_CONFIGURE in a package Makefile would manage to skip the "wrapper" step altogether. Fix this by correctly noting "wrapper" and not "patch" as the preceding step to "configure".
2006-07-05Refactor configure, build, test and wrapper phases out of bsd.pkg.mkjlam1-575/+16
and into their own directories. Also do some cleanups with build/_build and pkginstall -- we get rid of _build and simply run pkginstall as part of the "build" target. Introduce a new mechanism to handle varying directory depths under ${WRKSRC} in which we find files to override, e.g. configure, config.*, libtool, etc. OVERRIDE_DIRDEPTH is a package-settable variable that specifies how far under ${WRKSRC} the various targets should look, and it defaults to "2". We preserve the meaning of the various *_OVERRIDE variables, so if they are defined, then their values supersede the OVERRIDE_DIRDEPTH mechanism. devel/tla will need to specially set OVERRIDE_DIRDEPTH to 3 (see log for revision 1.1857 for bsd.pkg.mk -- to be done in a separate commit.
2006-06-18devel/tla has the GNU config scripts in a */*/* directory.rillig1-3/+3
2006-06-18Define CONFIG_{GUESS,SUB,RPATH}_OVERRIDE also whenrillig1-7/+11
OVERRIDE_GNU_CONFIG_SCRIPTS is defined.
2006-06-18Fixed wrong indentation of .if/.else/.endif.rillig1-4/+4
2006-06-17Added a variable OVERRIDE_GNU_CONFIG_SCRIPTS that allows a package torillig1-2/+2
override the config.guess, config.sub and config.rpath scripts even if GNU_CONFIGURE is not defined. This is needed for devel/tla.
2006-06-15Output PKG_{FAIL,SKIP}_REASON messages to standard error instead ofjlam1-7/+10
standard output. These are error or warning messages, so they shouldn't be "seen" by anything expecting the output of a "make" command to make sense. This addresses PR pkg/32239 by following the suggestions by Roland Illig.
2006-06-15Allow the standard build target to be overridden by the one generatedjlam1-2/+4
if PKG_{FAIL,SKIP}_REASON is set. This fixes the behavior when one invokes "make build" in a package that sets a fail or skip reason to stop as soon as the reason is printed.
2006-06-12Move the common make command executed in su-target into a separate makejlam1-4/+10
variable to try to get rid of potential quoting problems.
2006-06-11Split out the "work" symlink creation into a separate step and add itjlam1-9/+15
as a source for the "makedirs" target. This ensures the symlink is created regardless of whether ${WRKDIR} already exists or not.
2006-06-09Introduce the capability to gather all the warnings and errors thatjlam1-6/+7
are generated for a target and output them all at once at the conclusion of the target's invocation. The implementation is in bsd.pkg.error.mk, which defines a macro target "error-check" that will print out any non-empty warning and error files in ${WARNING_DIR} and ${ERROR_DIR} and exit appropriately if there were errors. Convert some targets that were just long sequences of ${ERROR_MSG} or ${WARNING_MSG} within a single shell statement to use the new delayed error output via error-check. Modify the compiler "fail" wrappers for C++ and Fortran to be less verbose during invocation. Instead collect the warnings and only print them at the end of the completed phase, e.g. after "configure" and/or "build" completes.
2006-06-08Introduce "makedirs" as a helper target to create directories withjlam1-1/+4
unprivileged ownership.
2006-06-08Replaced PHASE_MSG with STEP_MSG in many (but not all) places where itrillig1-3/+3
wasn't used to identify a ``phase'', as defined in the pkgsrc guide.
2006-06-07If there is _ZERO_FILESIZE_P, then it's natural to have _NONZERO_FILESIZE_Pjlam1-4/+7
to test for the opposite condition.
2006-06-07Move _ZERO_FILESIZE_P ftom bsd.pkginstall.mk to bsd.pkg.mk so it can morejlam1-1/+6
clearly be used in other modules.
2006-06-07Add WARNING_CAT and ERROR_CAT which are filters for outputting filejlam1-1/+4
contents to standard error. They prefix the output with "WARNING: " and "ERROR: " respectively.
2006-06-06Move some variable definitions out of bsd.prefs.mk and back intojlam1-1/+10
bsd.pkg.mk. They didn't actually need to be defined in bsd.prefs.mk, just somewhere before the "main" bsd.<phase>.mk files were included. This moves some conditional (?=) definitions back into bsd.pkg.mk so they won't conflict with any conditional definitions in package Makefiles. This should fix the "checksum" problems in lang/php-gd as noted here: http://mail-index.netbsd.org/pkgsrc-users/2006/06/05/0012.html where EXTRACT_SUFX had the wrong value due to the order in while *.mk files were included.
2006-06-06Separate out the part of bsd.tools.mk that actually created the toolsjlam1-26/+7
into a new file pkgsrc/mk/tools/create.mk. This leaves bsd.tools.mk as a file that pulls in all of the other ones. Also move the tools-related targets from bsd.pkg.mk into bsd.tools.mk. The tools cookie file has been removed, as well as hooks for {pre,do,post}-tools. Instead, there is now only a single public target "tools" which may be invoked. Invoking "tools" will always cause all of the tools in ${TOOLS_DIR} to be created. The "tools" step has been moved and is now just after the "depends" step and before sources are extracted. This is the earliest place where the "tools" step can be taken, and it allows the created tools to be used in all steps/phases after it, starting with "extract". As a consequence, we should just invoke tools by their bare names in targets, e.g. awk, sed, patch, etc., instead of with the ${VARIABLE} names, e.g. ${AWK}, ${SED}, ${PATCH}, etc.
2006-06-06Refactor "patch" code into correspondingly named subdirectory ofjlam1-4/+4
pkgsrc/mk. Also get rid of the recursive make for the "patch" target. This basically merges the "patch" phase into the "tools" phase. There should eventually be a standalone script that can be used to verify checksums listed in distinfo that should be used instead of the roll-your-own code in the do-pkgsrc-patch target.
2006-06-06Refactor "fetch" and "extract" code into correspondingly namedjlam1-483/+12
subdirectories of pkgsrc/mk. Move the following files around for locality: pkgsrc/mk/scripts/extract -> pkgsrc/mk/extract/extract pkgsrc/mk/bsd.sites.mk -> pkgsrc/mk/fetch/sites.mk Also get rid of the recursive make for the "fetch" and "extract" targets. This basically merges the "fetch" and "extract" phases into the "patch" phase. There is still much more work to do to simplify the fetch code, but this is a good start.
2006-06-05Use PHASE_MSG, STEP_MSG, WARNING_MSG, and ERROR_MSG in place of ECHO_MSGjlam1-31/+30
in various places.
2006-06-05Remove spurious comment.jlam1-3/+1
2006-06-05Move definitions for UPDATE_TARGET and DEPENDS_TARGET closer to wherejlam1-31/+1
they are used. Also, move UPDATE_RUNNING into the install module where it is used, and make it "private" by prepending with an underscore.
2006-06-05Ensure the directory containing the lockfile is created prior to thejlam1-1/+2
lockfile's creation. Fixes the "depends" step when PKGSRC_LOCKTYPE is not "none".
2006-06-05Backout previous and fix in another way -- use "set -e" to force thejlam1-4/+4
shell to exit if any untested command fails. This is based on Roland Illig's recommendation from his pkglint talk at pkgsrcCon/Paris.
2006-06-04Fix problem in su-target: the exitcode of the make command is discarded,tv1-3/+3
so it would exit successfully even if the sub-make failed. This caused rather interesting behavior with SU_CMD=sudo, and sudo timed out. Ensure that the result code is preserved by using a && chain rather than ;.
2006-06-04Move some "update"-only variables from bsd.pkg.mk to bsd.pkg.update.mk.jlam1-3/+1
2006-06-04Make LOCKFILE into a "private" variable by prepending with an underscore.jlam1-14/+14
2006-06-04Include bsd.pkg.update.mk to get the "update" targets and variables.jlam1-1/+3
2006-06-04Move test for the lockfile within the target's shell code instead ofjlam1-7/+4
testing for it at the Makefile level.
2006-06-04Drop the use of _ACQUIRE_LOCK and _RELEASE_LOCK and replace withjlam1-64/+57
acquire-lock and release-lock macro targets. Take advantage of using a make target by breaking up the _ACQUIRE_LOCK script into smaller pieces, and make better use of the *_MSG definitions for printing messages within the acquire-lock and release-lock targets.
2006-06-04Convert just-in-time su targets to use su-target instead of ${_SU_TARGET}.jlam1-33/+10
Garbage-collect the (now) unused _SU_TARGET.
2006-06-03First pass at implementing support for package system flavors otherjlam1-1332/+41
than pkgsrc's current one. This is an important lead-up to any project that redesigns the pkg_* tools in that it doesn't tie us to past design (mis)choices. This commit mostly deals with rearranging code, although there was a considerable amount of rewriting done in cases where I thought the code was somewhat messy and was difficult to understand. The design I chose for supporting multiple package system flavors is that the various depends, install, package, etc. modules would define default targets and variables that may be overridden in files from pkgsrc/mk/flavor/${PKG_FLAVOR}. The default targets would do the sensible thing of doing nothing, and pkgsrc infrastructure would rely on the appropriate things to be defined in pkgsrc/mk/flavor to do the real work. The pkgsrc/mk/flavor directory contains subdirectories corresponding to each package system flavor that we support. Currently, I only have "pkg" which represents the current pkgsrc-native package flavor. I've separated out most of the code where we make assumptions about the package system flavor, mostly either because we directly use the pkg_* tools, or we make assumptions about the package meta-data directory, or we directly manipulate the package meta-data files, and placed it into pkgsrc/mk/flavor/pkg. There are several new modules that have been refactored out of bsd.pkg.mk as part of these changes: check, depends, install, package, and update. Each of these modules has been slimmed down by rewriting them to avoid some recursive make calls. I've also religiously documented which targets are "public" and which are "private" so that users won't rely on reaching into pkgsrc innards to call a private target. The "depends" module is a complete overhaul of the way that we handle dependencies. There is now a separate "depends" phase that occurs before the "extract" phase where dependencies are installed. This differs from the old way where dependencies were installed just before extraction occurred. The reduce-depends.mk file is now replaced by a script that is invoked only once during the depends phase and is used to generate a cookie file that holds the full set of reduced dependencies. It is now possible to type "make depends" in a package directory and all missing dependencies will be installed. Future work on this project include: * Resolve the workflow design in anticipation of future work on staged installations where "package" conceptually happens before "install". * Rewrite the buildlink3 framework to not assume the use of the pkgsrc pkg_* tools. * Rewrite the pkginstall framework to provide a standard pkg_* tool to perform the actions, and allowing a purely declarative file per package to describe what actions need to be taken at install or deinstall time. * Implement support for the SVR4 package flavor. This will be proof that the appropriate abstractions are in place to allow using a completely different set of package management tools.
2006-05-23Packages may set the variable FETCH_MESSAGE to a list of lines that arerillig1-2/+11
printed when some distfile must be fetched manually. After printing them, the build is aborted. This deprecates the old _FETCH_MESSAGE, as packages should never need to define variables with leading underscores.
2006-05-22Move the check-shlibs target from bsd.pkg.mk to bsd.pkg.check.mk wherejlam1-46/+3
it will live with other "check" targets run after package installation. Get rid of SHLIB_HANDLING, whose meaning had mutated over the years from one thing to another. Currently, it is used to basically note whether the system's "ldd" command can be usefully run on the package's binaries and libraries. Rename this variable to CHECK_SHLIBS_SUPPORTED for more clarity. CHECK_SHLIBS is now a variable set exclusively by the user in /etc/mk.conf to note whether the check for missing run-time search paths is performed after a package is installed. It defaults to "no" unless PKG_DEVELOPER is set.
2006-05-21Move mk/install to mk/pkginstall to better reflect the contents (thejlam1-2/+2
pkginstall framework).
2006-05-21Pass PKG_PHASE=install when recursively calling make from within thejlam1-4/+4
real-su-install target so that the {pre,do,post}-install target command lists will see the correct, fully-expanded definitions of certain phase-specific variables.