summaryrefslogtreecommitdiff
path: root/mk/flavor
AgeCommit message (Collapse)AuthorFilesLines
2006-10-09Main infrastructure for DESTDIR support.joerg2-8/+16
Packages may set PKG_DESTDIR_SUPPORT to either "destdir" or "user-destdir" to flag support for this, following the same rules as PKG_INSTALLATION_TYPES (e.g. define before first include of bsd.prefs.mk). The user activates it via USE_DESTDIR. When set to "yes", packages with "user-destdir" are handled as "destdir". The installation of the package will not go to ${LOCALBASE}, but a subdirectory of ${WRKDIR} instead. pre/post install scripts are not run and the package is not registered either. A binary package can be created instead to be installed normally with pkg_add. For "user-destdir" packages, everything is run as normal user and ownership is supposed to be correctled by pkg_create later. Since the current pkg_install code uses pax and it doesn't allow overwriting owners, this does not work yet. For "destdir" packages, installation, packaging and cleaning is run as root. This commit does not change the handling of DEPENDS_TARGET or bin-install to allow recursive usage.
2006-10-09Backout rev 1.13 of rillig. Addresses PR 34764 and complains onjoerg1-9/+7
pkgsrc-users.
2006-10-09Replaced the pipe operator with temporary files, since the former hidesrillig1-7/+9
errors. Now "make depends" stops on dependency directories that don't exist. The dependencies are first extracted into two temporary files and then combined with cat(1) because otherwise "make depends" passes silently on errors when it is called for the second time. Somehow ${.TARGET} didn't get removed.
2006-10-08Remove the +BUILD_DEFS file before overwriting it. This is necessary torillig1-3/+5
allow most of the packages to be created as unprivileged user, since the +BUILD_DEFS file is created by the privileged user in the "install" phase.
2006-10-08Made the code simpler and added "set -e".rillig1-7/+6
2006-10-06Remove references to DESTDIR. LOCALBASE should not be altered that way,joerg2-4/+4
since it is user settable and most of the time set by the user. X11BASE follows the same reasons. For staged installations, we don't want to register the package directly, so there's no need to prefix PKG_DBDIR either.
2006-08-04Make sure requires and libs (PROVIDES) are set forreed1-5/+5
packages that use a sub-directory for prefix, like /usr/pkg/qt3/. (I have been using this for a couple years but recently merged my patch over to new flavor mk file.) Okayed by jlam on tech-pkg.
2006-07-27Add back CONFLICTS handling that was accidentally left out when revisionjlam1-1/+2
1.1 of this file was committed and the same code was removed from bsd.pkg.mk.
2006-07-27Remove all uses of the following targets from pkgsrc:jlam1-2/+3
show-all-depends-dirs show-all-depends-dirs-excl Replace them with calls to pkgsrc/mk/scripts/depends-depth-first.awk which does the same thing but without the extra overhead of invoking a recursive make.
2006-07-27Whenever we invoke a recursive make, we need to ensure that the properjlam2-5/+5
environment ${PKGSRC_MAKE_ENV} is also passed along. Create a convenience variable RECURSIVE_MAKE that does exactly this and that can be used in place of MAKE when invoking make recursively. Use RECURSIVE_MAKE everywhere in pkgsrc/mk that we invoke make recursively.
2006-07-19Make "mirror-distfiles" less verbose by not printing out anything if nojlam1-2/+6
bootstrap dependencies need to be built and installed.
2006-07-17During 'make replace', use pkg_admin to set the unsafe_dependsgdt1-1/+2
variable to YES for each pacakge that depends on the replaced package. Discussed on tech-pkg with generally positive comments.
2006-07-15Split the variable BUILD_DEFS into those that are defined by packagesrillig1-2/+2
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-13* Add a new stage "bootstrap-depends" that happens before all otherjlam1-33/+57
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-07Rename <phase>_COOKIE variables to _COOKIE.<phase>. These are privatejlam4-17/+17
variables so there are no user-visible changes. This change just makes it a little easier to write for loops.
2006-07-06The cookie files are indirectly made using *-cookie targets, so verifyjlam1-1/+3
that they are never being created more than once by inserting a check into the *-cookie targets.
2006-07-05Fix two bugs which prevent undo-replace from working.jlam1-3/+3
2006-07-05Make the check-vulnerable target more self-sufficient, by moving somejlam1-12/+39
of the logic from fetch/fetch.mk into flavor/pkg/check.mk, so that check-vulnerable can be used as a source target. Make check-vulnerable a source target for every phase of the build workflow, which ensures that it is always run if the user starts a new phase from the command line. Fix the cookie-generation targets so that they don't append, only overwrite to the cookie file. This works around potential problems due to recursive makes. Move the cookie checks so that they surround the corresponding phase target. The presence of the cookie should now inform the make process to avoid doing any processing of phases that occur before the phase corresponding to the cookie.
2006-06-14Fix error with just-in-time su when installing dependencies. The codejlam1-3/+4
to install dependencies looked roughly like this: ${CAT} ${_DEPENDS_FILE} | while read type pattern dir; do cd $$dir && ${MAKE} install done In the code above, tghe recursive make invoked to install each dependency does a just-in-time su to acquire root privileges for the installation, but the su tries to get terminal settings for standard input (from the pipe) using tcgetattr(), which fails and subsequently causes su to exit with a puzzling "conversation failure" error. Rewrite the loop to look (roughly) like this: set -- `${CAT} ${_DEPENDS_FILE}` while test $# -gt 0; do type=$1; pattern=$2; dir=$3; shift 3 cd $$dir && ${MAKE} install done Note that this is potentially bad for shells with very low limits on the maximum command line length, but at least this preserves file descriptor 1 to reference the controlling tty unless the user does something weird with input redirection when invoking make.
2006-06-09make(1) will automatically delete partially made targets if the targetjlam2-40/+27
creation fails, so remove instances where temporary files were created then moved to the final target filename, and just directly create the target. This is just for brevity/clarity, and saves a few tool calls.
2006-06-09Introduce the capability to gather all the warnings and errors thatjlam1-22/+19
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-08Replaced PHASE_MSG with STEP_MSG in many (but not all) places where itrillig4-12/+12
wasn't used to identify a ``phase'', as defined in the pkgsrc guide.
2006-06-08Added a missing :Q operator for DEPENDS_TARGET, since like the otherrillig1-2/+2
*_TARGET variables, it is actually a _list_ of targets, not a single target.
2006-06-07Replace use of ${ECHO} with *_MSG to get more consistent-looking messages.jlam1-11/+11
2006-06-07Make use of ERROR_CAT to print the list of conflicting packages.jlam1-3/+2
2006-06-07Fix typo, reported by walt on users@crater.dragonflybsd.org.ghen1-2/+2
2006-06-07Rewrite to avoid using "grep -H", which Solaris' grep does not support.jlam1-2/+6
2006-06-06Add missing "break" that was causing reduce-depends.awk to not do anyjlam1-1/+2
reduction except by accident if the "winning" pattern is the last one.
2006-06-06Avoid using PKGNAME in target names since they are "immediately"jlam2-4/+5
resolved in much the same manner as variables set using :=. PKGNAME could be set after including bsd.pkg.mk (which is poor form), and it's too close to the pkgsrc-2006Q2 branch to fix that all over pkgsrc at this time). This fixes building shells/static-bash2.
2006-06-06We diverged too much from reduce-depends.mk -- reduce-depends.mkjlam1-5/+10
outputted dependencies if they conflicted and it didn't know how to handle them, whereas reduce-depends.awk was removing them completely. Restore the old behavior. This fixes problems that manifest when multiple dependencies can be built from the same pkgsrc package directory and which don't conflict with each other, e.g. py23-gtk2 and py23-gtk2 can both be built from pkgsrc/x11/py-gtk2.
2006-06-05Use PHASE_MSG, STEP_MSG, WARNING_MSG, and ERROR_MSG in place of ECHO_MSGjlam6-19/+19
in various places.
2006-06-05Move definitions for UPDATE_TARGET and DEPENDS_TARGET closer to wherejlam1-2/+2
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-04Add environment settings for the tools that reduce-depends.awk uses.jlam1-2/+5
From Georg Schwarz in private email.
2006-06-04Add missing definitions for CP and RM. Fix from taca@ in private email.jlam1-1/+3
2006-06-03First pass at implementing support for package system flavors otherjlam15-0/+1428
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.