pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/mk



Module Name:    pkgsrc
Committed By:   joerg
Date:           Sat Jan 13 12:48:57 UTC 2018

Modified Files:
        pkgsrc/mk: bsd.pkg.mk bsd.utils.mk
        pkgsrc/mk/build: test.mk
        pkgsrc/mk/depends: bsd.depends.mk
        pkgsrc/mk/pkgformat/pkg: depends.mk list-dependencies
            resolve-dependencies

Log Message:
Introduce TEST_DEPENDS.

Place them in ALL_DEPENDS iff PKGSRC_RUN_TESTS is set, so that bulk
builds will pick them up.


To generate a diff of this commit:
cvs rdiff -u -r1.2029 -r1.2030 pkgsrc/mk/bsd.pkg.mk
cvs rdiff -u -r1.10 -r1.11 pkgsrc/mk/bsd.utils.mk
cvs rdiff -u -r1.18 -r1.19 pkgsrc/mk/build/test.mk
cvs rdiff -u -r1.27 -r1.28 pkgsrc/mk/depends/bsd.depends.mk
cvs rdiff -u -r1.5 -r1.6 pkgsrc/mk/pkgformat/pkg/depends.mk
cvs rdiff -u -r1.2 -r1.3 pkgsrc/mk/pkgformat/pkg/list-dependencies \
    pkgsrc/mk/pkgformat/pkg/resolve-dependencies

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/mk/bsd.pkg.mk
diff -u pkgsrc/mk/bsd.pkg.mk:1.2029 pkgsrc/mk/bsd.pkg.mk:1.2030
--- pkgsrc/mk/bsd.pkg.mk:1.2029 Tue Jan  2 05:49:44 2018
+++ pkgsrc/mk/bsd.pkg.mk        Sat Jan 13 12:48:56 2018
@@ -1,4 +1,4 @@
-#      $NetBSD: bsd.pkg.mk,v 1.2029 2018/01/02 05:49:44 maya Exp $
+#      $NetBSD: bsd.pkg.mk,v 1.2030 2018/01/13 12:48:56 joerg Exp $
 #
 # This file is in the public domain.
 #
@@ -93,6 +93,7 @@ MAINTAINER=${OWNER}
 MAINTAINER?=           pkgsrc-users%NetBSD.org@localhost
 .endif
 PKGWILDCARD?=          ${PKGBASE}-[0-9]*
+TEST_DEPENDS?=         # empty
 TOOL_DEPENDS?=         # empty
 .if defined(GITHUB_TAG)
 WRKSRC?=               ${WRKDIR}/${GITHUB_PROJECT}-${GITHUB_TAG:C/^v//}

Index: pkgsrc/mk/bsd.utils.mk
diff -u pkgsrc/mk/bsd.utils.mk:1.10 pkgsrc/mk/bsd.utils.mk:1.11
--- pkgsrc/mk/bsd.utils.mk:1.10 Thu May  9 23:37:25 2013
+++ pkgsrc/mk/bsd.utils.mk      Sat Jan 13 12:48:56 2018
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.utils.mk,v 1.10 2013/05/09 23:37:25 riastradh Exp $
+# $NetBSD: bsd.utils.mk,v 1.11 2018/01/13 12:48:56 joerg Exp $
 #
 # This Makefile fragment is included by bsd.pkg.mk and defines utility
 # and otherwise miscellaneous variables and targets.
@@ -11,6 +11,9 @@
 DEPENDS_TYPE?=  all
 .if !empty(DEPENDS_TYPE:Mbuild) || !empty(DEPENDS_TYPE:Mall)
 _ALL_DEPENDS+= ${BOOTSTRAP_DEPENDS} ${BUILD_DEPENDS} ${TOOL_DEPENDS}
+.  if !empty(PKGSRC_RUN_TESTS:M[yY][eE][sS])
+_ALL_DEPENDS+= ${TEST_DEPENDS}
+.  endif
 .endif
 .if !empty(DEPENDS_TYPE:Minstall) || !empty(DEPENDS_TYPE:Mpackage) || \
     !empty(DEPENDS_TYPE:Mall)

Index: pkgsrc/mk/build/test.mk
diff -u pkgsrc/mk/build/test.mk:1.18 pkgsrc/mk/build/test.mk:1.19
--- pkgsrc/mk/build/test.mk:1.18        Sun May 27 14:32:29 2012
+++ pkgsrc/mk/build/test.mk     Sat Jan 13 12:48:56 2018
@@ -1,4 +1,4 @@
-# $NetBSD: test.mk,v 1.18 2012/05/27 14:32:29 cheusov Exp $
+# $NetBSD: test.mk,v 1.19 2018/01/13 12:48:56 joerg Exp $
 #
 # After the "build" phase, many packages provide some sort of self-test
 # that can be run on the not-yet installed package. To enable these
@@ -58,6 +58,7 @@ TEST_MAKE_CMD= \
 ###
 _TEST_TARGETS+=        check-vulnerable
 _TEST_TARGETS+=        build
+_TEST_TARGETS+=        test-depends
 _TEST_TARGETS+=        acquire-test-lock
 _TEST_TARGETS+=        ${_COOKIE.test}
 _TEST_TARGETS+=        release-test-lock

Index: pkgsrc/mk/depends/bsd.depends.mk
diff -u pkgsrc/mk/depends/bsd.depends.mk:1.27 pkgsrc/mk/depends/bsd.depends.mk:1.28
--- pkgsrc/mk/depends/bsd.depends.mk:1.27       Tue Jan  2 01:01:42 2018
+++ pkgsrc/mk/depends/bsd.depends.mk    Sat Jan 13 12:48:56 2018
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.depends.mk,v 1.27 2018/01/02 01:01:42 rillig Exp $
+# $NetBSD: bsd.depends.mk,v 1.28 2018/01/13 12:48:56 joerg Exp $
 #
 # This Makefile fragment is included by bsd.pkg.mk and provides all
 # variables and targets related to dependencies.
@@ -110,7 +110,7 @@ depends-cookie:
 #      Command line variables:
 #
 #      VARNAME
-#              DEPENDS, BUILD_DEPENDS, or TOOL_DEPENDS.
+#              DEPENDS, BUILD_DEPENDS, TEST_DEPENDS, or TOOL_DEPENDS.
 #
 # Keywords: depends dependencies
 show-depends: .PHONY _pkgformat-show-depends

Index: pkgsrc/mk/pkgformat/pkg/depends.mk
diff -u pkgsrc/mk/pkgformat/pkg/depends.mk:1.5 pkgsrc/mk/pkgformat/pkg/depends.mk:1.6
--- pkgsrc/mk/pkgformat/pkg/depends.mk:1.5      Mon Jul 18 09:57:10 2016
+++ pkgsrc/mk/pkgformat/pkg/depends.mk  Sat Jan 13 12:48:57 2018
@@ -1,4 +1,4 @@
-# $NetBSD: depends.mk,v 1.5 2016/07/18 09:57:10 leot Exp $
+# $NetBSD: depends.mk,v 1.6 2018/01/13 12:48:57 joerg Exp $
 
 # This command prints out the dependency patterns for all full (run-time)
 # dependencies of the package.
@@ -11,7 +11,7 @@
 #
 #      <depends_type>  <pattern>       <directory>
 #
-# Valid dependency types are "bootstrap", "build" and "full".
+# Valid dependency types are "bootstrap", "build", "test" and "full".
 #
 # ${_RDEPENDS_FILE} contains the resolved dependency information
 # for the package.  For each line in ${_DEPENDS_FILE}
@@ -52,6 +52,7 @@ _REDUCE_RESOLVED_DEPENDS_CMD=${PKGSRC_SE
 _pkgformat-show-depends: .PHONY
        @case ${VARNAME:Q}"" in                                         \
        BUILD_DEPENDS)  ${_REDUCE_DEPENDS_CMD} ${BUILD_DEPENDS:Q} ;;    \
+       TEST_DEPENDS)   ${_HOST_REDUCE_DEPENDS_CMD} ${TEST_DEPENDS:Q} ;;\
        TOOL_DEPENDS)   ${_HOST_REDUCE_DEPENDS_CMD} ${TOOL_DEPENDS:Q} ;;\
        DEPENDS|*)      ${_REDUCE_DEPENDS_CMD} ${DEPENDS:Q} ;;          \
        esac
@@ -61,6 +62,7 @@ _LIST_DEPENDS_CMD=    \
                PKGSRCDIR=${PKGSRCDIR:Q} PWD_CMD=${PWD_CMD:Q} SED=${SED:Q} \
                ${SH} ${PKGSRCDIR}/mk/pkgformat/pkg/list-dependencies \
                        " "${BOOTSTRAP_DEPENDS:Q} \
+                       " "${TEST_DEPENDS:Q} \
                        " "${TOOL_DEPENDS:Q} \
                        " "${BUILD_DEPENDS:Q} \
                        " "${DEPENDS:Q}
@@ -71,12 +73,19 @@ _LIST_DEPENDS_CMD.bootstrap=        \
                ${SH} ${PKGSRCDIR}/mk/pkgformat/pkg/list-dependencies \
                        " "${BOOTSTRAP_DEPENDS:Q} " " " " " "
 
+_LIST_DEPENDS_CMD.test=        \
+       ${PKGSRC_SETENV} AWK=${AWK:Q} PKG_ADMIN=${PKG_ADMIN:Q} \
+               PKGSRCDIR=${PKGSRCDIR:Q} PWD_CMD=${PWD_CMD:Q} SED=${SED:Q} \
+               ${SH} ${PKGSRCDIR}/mk/pkgformat/pkg/list-dependencies \
+                       " " " "${TEST_DEPENDS:Q} " " " " " "
+
 _RESOLVE_DEPENDS_CMD=  \
        ${PKGSRC_SETENV} _PKG_DBDIR=${_PKG_DBDIR:Q} PKG_INFO=${PKG_INFO:Q} \
                HOST_PKG_INFO=${HOST_PKG_INFO:Q} \
                _DEPENDS_FILE=${_DEPENDS_FILE:Q} \
                ${SH} ${PKGSRCDIR}/mk/pkgformat/pkg/resolve-dependencies \
                        " "${BOOTSTRAP_DEPENDS:Q} \
+                       " " \
                        " "${TOOL_DEPENDS:Q} \
                        " "${BUILD_DEPENDS:Q} \
                        " "${DEPENDS:Q}
@@ -91,7 +100,13 @@ _RESOLVE_DEPENDS_CMD=       \
 #              build, full.
 #
 _DEPENDS_INSTALL_CMD=                                                  \
-       case $$type in bootstrap) Type=Bootstrap;; tool) Type=Tool;; build) Type=Build;; full) Type=Full;; esac; \
+       case $$type in                                                  \
+       bootstrap)      Type=Bootstrap;;                                \
+       tool)           Type=Tool;;                                     \
+       build)          Type=Build;;                                    \
+       test)           Type=Test;;                                     \
+       full)           Type=Full;;                                     \
+       esac;                                                           \
        case $$type in                                                  \
        bootstrap|tool)                                                 \
                if expr "${USE_CROSS_COMPILE:Uno}" : '[yY][eE][sS]' >/dev/null; then \
@@ -103,7 +118,7 @@ _DEPENDS_INSTALL_CMD=                                                       \
                archopt=TARGET_ARCH=${MACHINE_ARCH};                    \
                pkg=`${_HOST_PKG_BEST_EXISTS} "$$pattern" || ${TRUE}`;  \
                ;;                                                      \
-       build|full)                                                     \
+       build|test|full)                                                        \
                extradep=" ${PKGNAME}";                                 \
                cross=${USE_CROSS_COMPILE:Uno};                         \
                archopt=;                                               \
@@ -126,7 +141,7 @@ _DEPENDS_INSTALL_CMD=                                                       \
                case $$type in                                          \
                bootstrap|tool)                                         \
                        pkg=`${_HOST_PKG_BEST_EXISTS} "$$pattern" || ${TRUE}`;; \
-               build|full)                                             \
+               build|test|full)                                        \
                        pkg=`${_PKG_BEST_EXISTS} "$$pattern" || ${TRUE}`;; \
                esac;                                                   \
                case "$$pkg" in                                         \
@@ -141,7 +156,7 @@ _DEPENDS_INSTALL_CMD=                                                       \
                case $$type in                                          \
                bootstrap|tool)                                         \
                        objfmt=`${HOST_PKG_INFO} -Q OBJECT_FMT "$$pkg"`;; \
-               build|full)                                             \
+               build|test|full)                                        \
                        objfmt=`${PKG_INFO} -Q OBJECT_FMT "$$pkg"`;;    \
                esac;                                                   \
                case "$$objfmt" in                                      \
@@ -235,3 +250,28 @@ _pkgformat-bootstrap-depends:
 .PHONY:
 acquire-bootstrap-depends-lock: acquire-lock
 release-bootstrap-depends-lock: release-lock
+
+######################################################################
+### test-depends (PUBLIC, pkgsrc/mk/depends/depends.mk)
+######################################################################
+### test-depends is a public target to install any missing
+### dependencies needed for the "test" stage.
+### These dependencies are listed in TEST_DEPENDS.
+###
+.PHONY: test-depends
+_TEST_DEPENDS_TARGETS+=        acquire-test-depends-lock
+_TEST_DEPENDS_TARGETS+=        _pkgformat-test-depends
+_TEST_DEPENDS_TARGETS+=        release-test-depends-lock
+
+test-depends: ${_TEST_DEPENDS_TARGETS}
+
+_pkgformat-test-depends:
+       ${RUN}${_LIST_DEPENDS_CMD.test} |                               \
+       while read type pattern dir; do                                 \
+               ${TEST} "$$type" = "test" || continue;          \
+               ${_DEPENDS_INSTALL_CMD};                                \
+       done
+
+.PHONY:
+acquire-test-depends-lock: acquire-lock
+release-test-depends-lock: release-lock

Index: pkgsrc/mk/pkgformat/pkg/list-dependencies
diff -u pkgsrc/mk/pkgformat/pkg/list-dependencies:1.2 pkgsrc/mk/pkgformat/pkg/list-dependencies:1.3
--- pkgsrc/mk/pkgformat/pkg/list-dependencies:1.2       Thu May  9 23:37:26 2013
+++ pkgsrc/mk/pkgformat/pkg/list-dependencies   Sat Jan 13 12:48:57 2018
@@ -57,12 +57,13 @@ print_entries() {
        done
 }
 
-if [ $# != 4 ]; then
-       echo "usage: list-dependencies bootstrap_depends tool_depends build_depends depends" 1>&2
+if [ $# != 5 ]; then
+       echo "usage: list-dependencies bootstrap_depends test_depends tool_depends build_depends depends" 1>&2
        exit 1
 fi
 
 print_entries bootstrap "$1"
-print_entries tool "$2"
-print_entries build "$3"
-print_entries full "$4"
+print_entries test "$2"
+print_entries tool "$3"
+print_entries build "$4"
+print_entries full "$5"
Index: pkgsrc/mk/pkgformat/pkg/resolve-dependencies
diff -u pkgsrc/mk/pkgformat/pkg/resolve-dependencies:1.2 pkgsrc/mk/pkgformat/pkg/resolve-dependencies:1.3
--- pkgsrc/mk/pkgformat/pkg/resolve-dependencies:1.2    Thu May  9 23:37:26 2013
+++ pkgsrc/mk/pkgformat/pkg/resolve-dependencies        Sat Jan 13 12:48:57 2018
@@ -40,6 +40,7 @@ find_best() {
 
 ${CAT} ${DEPENDS_FILE} | while read type pattern dir; do
        pkg=`find_best "$type" "$pattern"`
+       [ "$type" != test ] || continue
        case "$pkg" in
        "")
                error_msg "[resolve-dependencies] A package matching \`\`$pattern'' should"



Home | Main Index | Thread Index | Old Index