diff options
author | tv <tv@pkgsrc.org> | 1999-05-24 23:04:52 +0000 |
---|---|---|
committer | tv <tv@pkgsrc.org> | 1999-05-24 23:04:52 +0000 |
commit | 2d4fbc2e96993e6b6c23e0676046e007fe46a243 (patch) | |
tree | 15f1f397daaac6c5ebff75d8374f41abef08c7d3 /mk | |
parent | 96b5e8be1ee512f5b1430770376009d721f0182e (diff) | |
download | pkgsrc-2d4fbc2e96993e6b6c23e0676046e007fe46a243.tar.gz |
- The comment above the _COOKIE settings says "don't change these!!", so
use = to set them, not ?=.
- _DEPENDS_USE doesn't actually do any macro expansion, so save some
processing time by executing it exactly once (remove the .USE operator).
- Merge the IGNORE targets. Add an IGNORE target for depends and
check-depends (see bottom).
- Don't check for installation of a package in ${DEPENDS} when doing
a "make depends". Instead, let the return code of make fall through
(using && instead of ; in the last clause of each depend recursion block).
- Provide a variable IGNORE_FAIL: when set, causes the ignore message
to be printed (regardless of IGNORE_SILENT or ECHO_MSG setting) and the
build to fail with ${FALSE}. Used with the next addition:
- Add a new target, "check-depends", which is called as part of "real-fetch".
This validates whether the dependencies of a pkg to be built are installed,
and if not, whether those dependencies will prospectively build (will
not set IGNORE directly or indirectly through the various disable options).
Recurses to "depends" with a DEPENDS_TARGET of "check-depends".
...And now, it is no longer necessary to mark dependent pkgs as unusable
when their dependencies are unusable thanks to an incorrect LICENSE,
_FOR_PLATFORM setting, and so forth. The check-depends step will validate
everything before fetching a single file.
Diffstat (limited to 'mk')
-rw-r--r-- | mk/bsd.pkg.mk | 92 |
1 files changed, 39 insertions, 53 deletions
diff --git a/mk/bsd.pkg.mk b/mk/bsd.pkg.mk index 87b31318683..99f9df0f8d0 100644 --- a/mk/bsd.pkg.mk +++ b/mk/bsd.pkg.mk @@ -1,4 +1,4 @@ -# $NetBSD: bsd.pkg.mk,v 1.274 1999/05/24 21:25:00 tron Exp $ +# $NetBSD: bsd.pkg.mk,v 1.275 1999/05/24 23:04:52 tv Exp $ # # This file is in the public domain. # @@ -124,12 +124,12 @@ MAKE_ENV+= LIBTOOL="${LIBTOOL} ${LIBTOOL_FLAGS}" # Don't change these!!! These names are built into the _TARGET_USE macro, # there is no way to refer to them cleanly from within the macro AFAIK. -EXTRACT_COOKIE?= ${WRKDIR}/.extract_done -CONFIGURE_COOKIE?= ${WRKDIR}/.configure_done -INSTALL_COOKIE?= ${WRKDIR}/.install_done -BUILD_COOKIE?= ${WRKDIR}/.build_done -PATCH_COOKIE?= ${WRKDIR}/.patch_done -PACKAGE_COOKIE?= ${WRKDIR}/.package_done +EXTRACT_COOKIE= ${WRKDIR}/.extract_done +CONFIGURE_COOKIE= ${WRKDIR}/.configure_done +INSTALL_COOKIE= ${WRKDIR}/.install_done +BUILD_COOKIE= ${WRKDIR}/.build_done +PATCH_COOKIE= ${WRKDIR}/.patch_done +PACKAGE_COOKIE= ${WRKDIR}/.package_done # Miscellaneous overridable commands: XMKMF?= xmkmf -a @@ -702,30 +702,14 @@ IGNORE= "Unacceptable license: ${LICENSE} - set ACCEPTABLE_LICENSES in /etc/mk.c .endif .if defined(IGNORE) -.if defined(IGNORE_SILENT) -IGNORECMD= ${DO_NADA} -.else -IGNORECMD= ${ECHO_MSG} "===> ${PKGNAME} ${IGNORE}." -.endif -fetch: - @${IGNORECMD} -checksum: - @${IGNORECMD} -extract: - @${IGNORECMD} -patch: - @${IGNORECMD} -configure: - @${IGNORECMD} -all: - @${IGNORECMD} -build: - @${IGNORECMD} -install: - @${IGNORECMD} -deinstall: - @${IGNORECMD} -package: +.if defined(IGNORE_FAIL) +IGNORECMD?= ${ECHO} "===> ${PKGNAME} ${IGNORE}." && ${FALSE} +.elif defined(IGNORE_SILENT) +IGNORECMD?= ${DO_NADA} +.endif +IGNORECMD?= ${ECHO_MSG} "===> ${PKGNAME} ${IGNORE}." +fetch checksum extract patch configure all build install deinstall package \ +depends check-depends: @${IGNORECMD} .endif # IGNORE .endif # !NO_IGNORE @@ -1536,7 +1520,7 @@ fetch-list: fetch-list-recursive: @${MAKE} fetch-list-one-pkg .if ${RECURSIVE_FETCH_LIST} != "NO" - @for dir in `${ECHO} ${FETCH_DEPENDS} ${BUILD_DEPENDS} ${DEPENDS} ${RUN_DEPENDS} | ${TR} '\040' '\012' | ${SED} -e 's/^[^:]*://' -e 's/:.*//' | sort -u` ; do \ + @for dir in `${ECHO} ${BUILD_DEPENDS} ${DEPENDS} ${RUN_DEPENDS} | ${TR} '\040' '\012' | ${SED} -e 's/^[^:]*://' -e 's/:.*//' | sort -u` ; do \ (cd $$dir && ${MAKE} fetch-list-recursive; ); \ done .endif # ${RECURSIVE_FETCH_LIST} != "NO" @@ -1728,10 +1712,6 @@ depends: misc-depends ${_PKG_SILENT}${_PKG_DEBUG}cd ${.CURDIR} && ${MAKE} ${.MAKEFLAGS} build-depends ${_PKG_SILENT}${_PKG_DEBUG}cd ${.CURDIR} && ${MAKE} ${.MAKEFLAGS} run-depends -.if make(fetch-depends) -DEPENDS_TMP+= ${FETCH_DEPENDS} -.endif - .if make(build-depends) DEPENDS_TMP+= ${BUILD_DEPENDS} .endif @@ -1740,7 +1720,7 @@ DEPENDS_TMP+= ${BUILD_DEPENDS} DEPENDS_TMP+= ${RUN_DEPENDS} .endif -_DEPENDS_USE: .USE +_DEPENDS_USE: .if defined(DEPENDS_TMP) .if !defined(NO_DEPENDS) .for i in ${DEPENDS_TMP} @@ -1774,7 +1754,7 @@ _DEPENDS_USE: .USE if [ ! -d "$$dir" ]; then \ ${ECHO_MSG} ">> No directory for $$prog. Skipping.."; \ else \ - (cd $$dir && ${MAKE} ${.MAKEFLAGS} $$target); \ + (cd $$dir && ${MAKE} ${.MAKEFLAGS} $$target) && \ ${ECHO_MSG} "===> Returning to build of ${PKGNAME}"; \ fi; \ fi @@ -1804,14 +1784,10 @@ misc-depends: uptodate-pkgtools if [ ! -d $$dir ]; then \ ${ECHO_MSG} ">> No directory for $$dir. Skipping.."; \ else \ - (cd $$dir && ${MAKE} ${.MAKEFLAGS} $$target); \ - found="`${PKG_INFO} -e \"$$package\" || ${TRUE}`"; \ - if [ X"$$found" = X"" ]; then \ - ${ECHO_MSG} "===> $$package did not install properly"; \ - exit 1 ; \ - fi; \ - fi \ - fi + (cd $$dir && ${MAKE} ${.MAKEFLAGS} $$target) && \ + ${ECHO_MSG} "===> Returning to build of ${PKGNAME}"; \ + fi; \ + fi .endfor .endif # !NO_DEPENDS .else @@ -1820,11 +1796,21 @@ misc-depends: uptodate-pkgtools .endif +real-fetch: check-depends +.if !target(check-depends) +check-depends: +.if (defined(DEPENDS) || defined(BUILD_DEPENDS) || defined(RUN_DEPENDS)) && \ + !defined(NO_DEPENDS) && !defined(NO_CHECK_DEPENDS) + ${_PKG_SILENT}${_PKG_DEBUG}${ECHO_MSG} "===> Validating dependencies for ${PKGNAME}" + ${_PKG_SILENT}${_PKG_DEBUG}${MAKE} DEPENDS_TARGET=check-depends ECHO_MSG=${TRUE:Q} IGNORE_FAIL=1 depends || \ + (${ECHO_MSG} "===> ${PKGNAME} cannot build necessary dependencies."; ${FALSE}) +.endif +.endif + .if !target(clean-depends) clean-depends: -.if defined(FETCH_DEPENDS) || defined(BUILD_DEPENDS) \ - || defined(DEPENDS) || defined(RUN_DEPENDS) - @for dir in `${ECHO} ${FETCH_DEPENDS} ${BUILD_DEPENDS} ${DEPENDS} ${RUN_DEPENDS} | ${TR} '\040' '\012' | ${SED} -e 's/^[^:]*://' -e 's/:.*//' | sort -u`; do \ +.if defined(BUILD_DEPENDS) || defined(DEPENDS) || defined(RUN_DEPENDS) + @for dir in `${ECHO} ${BUILD_DEPENDS} ${DEPENDS} ${RUN_DEPENDS} | ${TR} '\040' '\012' | ${SED} -e 's/^[^:]*://' -e 's/:.*//' | sort -u`; do \ if [ -d $$dir ] ; then \ (cd $$dir && ${MAKE} CLEANDEPENDS=${CLEANDEPENDS} clean ); \ fi \ @@ -1834,7 +1820,7 @@ clean-depends: .if !target(depends-list) depends-list: -.for dir in ${FETCH_DEPENDS} ${BUILD_DEPENDS} ${DEPENDS} +.for dir in ${BUILD_DEPENDS} ${DEPENDS} @cd ${dir:C/^[^:]*://:C/:.*//} && ${MAKE} package-name depends-list PACKAGE_NAME_TYPE=${PACKAGE_NAME_TYPE} .endfor .endif @@ -1905,8 +1891,8 @@ describe: ${ECHO} -n "|/dev/null"; \ fi; \ ${ECHO} -n "|${MAINTAINER}|${CATEGORIES}|"; \ - case "A${FETCH_DEPENDS}B${BUILD_DEPENDS}C${DEPENDS}D" in \ - ABCD) ;; \ + case "A${BUILD_DEPENDS}B${DEPENDS}C" in \ + ABC) ;; \ *) cd ${.CURDIR} && ${ECHO} -n `${MAKE} depends-list|sort -u`;; \ esac; \ ${ECHO} -n "|"; \ @@ -2015,7 +2001,7 @@ show-pkgtools-version: .if !target(print-depends-list) print-depends-list: -.if defined(FETCH_DEPENDS) || defined(BUILD_DEPENDS) || defined(DEPENDS) +.if defined(BUILD_DEPENDS) || defined(DEPENDS) @${ECHO} -n 'This port requires package(s) "' @${ECHO} -n `${MAKE} depends-list | sort -u` @${ECHO} '" to build.' |