pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/mk Introduce the PKGCONFIG_OVERRIDE_STAGE variable to ...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/af60360fff5c
branches:  trunk
changeset: 482339:af60360fff5c
user:      jmmv <jmmv%pkgsrc.org@localhost>
date:      Mon Oct 25 18:02:20 2004 +0000

description:
Introduce the PKGCONFIG_OVERRIDE_STAGE variable to let a package
specify when the pkgconfig substitutions have to be applied; defaults
to pre-configure.  This is useful because some packages modify the .pc
files during the build process (adding -L flags), so they have to wait
until the build finishes to add the correct rpaths.

Also modify the regular expression in PKGCONFIG_OVERRIDE_SED to match
and fix multiple -L flags, instead of just one.

diffstat:

 mk/bsd.pkg.mk |  11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diffs (28 lines):

diff -r 38063eab497c -r af60360fff5c mk/bsd.pkg.mk
--- a/mk/bsd.pkg.mk     Mon Oct 25 17:40:00 2004 +0000
+++ b/mk/bsd.pkg.mk     Mon Oct 25 18:02:20 2004 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: bsd.pkg.mk,v 1.1522 2004/10/21 17:18:44 tv Exp $
+#      $NetBSD: bsd.pkg.mk,v 1.1523 2004/10/25 18:02:20 jmmv Exp $
 #
 # This file is in the public domain.
 #
@@ -2268,10 +2268,17 @@
 .endif
 
 PKGCONFIG_OVERRIDE_SED= \
-       -e 's|^\(Libs:.*[       ]\)-L\([        ]*[^    ]*\)\(.*\)$$|\1${COMPILER_RPATH_FLAG}\2 -L\2\3|'
+       '/^Libs:.*[     ]/s|-L\([       ]*[^    ]*\)|${COMPILER_RPATH_FLAG}\1 -L\1|g'
+PKGCONFIG_OVERRIDE_STAGE?=     pre-configure
 
 .if defined(PKGCONFIG_OVERRIDE) && !empty(PKGCONFIG_OVERRIDE)
+.  if ${PKGCONFIG_OVERRIDE_STAGE} == "pre-configure"
 _CONFIGURE_PREREQ+=            subst-pkgconfig
+.  elif ${PKGCONFIG_OVERRIDE_STAGE} == "post-configure"
+_CONFIGURE_POSTREQ+=           subst-pkgconfig
+.  else
+SUBST_STAGE.pkgconfig=         ${PKGCONFIG_OVERRIDE_STAGE}
+.  endif
 SUBST_CLASSES+=                        pkgconfig
 SUBST_MESSAGE.pkgconfig=       "Adding rpaths to pkgconfig files."
 SUBST_FILES.pkgconfig=         ${PKGCONFIG_OVERRIDE:S/^${WRKSRC}\///}



Home | Main Index | Thread Index | Old Index