pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/mk/buildlink3 Allow the caller to override the script ...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/9c91c2e70962
branches:  trunk
changeset: 547985:9c91c2e70962
user:      cube <cube%pkgsrc.org@localhost>
date:      Mon Oct 06 13:08:16 2008 +0000

description:
Allow the caller to override the script that extracts the version of the
built-in package.  That means pkgconfig-builtin.mk can be used in even
more situations now.

diffstat:

 mk/buildlink3/pkgconfig-builtin.mk |  13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)

diffs (34 lines):

diff -r 016f5511f6de -r 9c91c2e70962 mk/buildlink3/pkgconfig-builtin.mk
--- a/mk/buildlink3/pkgconfig-builtin.mk        Mon Oct 06 12:58:29 2008 +0000
+++ b/mk/buildlink3/pkgconfig-builtin.mk        Mon Oct 06 13:08:16 2008 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: pkgconfig-builtin.mk,v 1.2 2008/10/05 21:36:35 cube Exp $
+# $NetBSD: pkgconfig-builtin.mk,v 1.3 2008/10/06 13:08:16 cube Exp $
 
 # This file is used to factor out a common pattern in builtin.mk files backed
 # up by the existence of a pkgconfig file.
@@ -8,6 +8,10 @@
 # Optionally, caller may define PKGCONFIG_BASE.<BUILTIN_PKG> as the base
 # location for a native implementation of the package.  It conveniently
 # defaults to X11BASE.
+#
+# The caller may also override the default, pkgconfig-specific, version
+# script.  That means this file can be called by a lot more generic
+# builtin.mk files.
 
 BUILTIN_FIND_FILES_VAR:=                       FIND_FILES_${BUILTIN_PKG}
 BUILTIN_FIND_FILES.FIND_FILES_${BUILTIN_PKG}=  ${PKGCONFIG_FILE.${BUILTIN_PKG}}
@@ -27,8 +31,11 @@
 .if !defined(BUILTIN_PKG.${BUILTIN_PKG}) && \
     !empty(IS_BUILTIN.${BUILTIN_PKG}:M[yY][eE][sS]) && \
     !empty(FIND_FILES_${BUILTIN_PKG}:M*.pc)
-BUILTIN_VERSION.${BUILTIN_PKG}!= \
-       ${SED} -n -e 's/Version: //p' ${FIND_FILES_${BUILTIN_PKG}}
+. if !defined(BUILTIN_VERSION_SCRIPT.${BUILTIN_PKG})
+BUILTIN_VERSION_SCRIPT.${BUILTIN_PKG}= ${SED} -n -e 's/Version: //p'
+. endif
+BUILTIN_VERSION.${BUILTIN_PKG}!= ${BUILTIN_VERSION_SCRIPT.${BUILTIN_PKG}} \
+                                       ${FIND_FILES_${BUILTIN_PKG}}
 BUILTIN_PKG.${BUILTIN_PKG}:= ${BUILTIN_PKG}-${BUILTIN_VERSION.${BUILTIN_PKG}}
 .endif
 MAKEVARS:=      ${MAKEVARS} BUILTIN_PKG.${BUILTIN_PKG}



Home | Main Index | Thread Index | Old Index