pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/mk add support for extracting binary/library requires/...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/c635e8639126
branches:  trunk
changeset: 460155:c635e8639126
user:      grant <grant%pkgsrc.org@localhost>
date:      Sat Aug 23 09:11:19 2003 +0000

description:
add support for extracting binary/library requires/provides on Darwin,
and simplify the logic to reduce code duplication.

fixes PR pkg/22492 from Julien T. Letessier.

diffstat:

 mk/bsd.pkg.mk |  40 ++++++++++++++++++++++++----------------
 1 files changed, 24 insertions(+), 16 deletions(-)

diffs (70 lines):

diff -r 4344301c5703 -r c635e8639126 mk/bsd.pkg.mk
--- a/mk/bsd.pkg.mk     Sat Aug 23 09:07:07 2003 +0000
+++ b/mk/bsd.pkg.mk     Sat Aug 23 09:11:19 2003 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: bsd.pkg.mk,v 1.1243 2003/08/23 08:09:17 grant Exp $
+#      $NetBSD: bsd.pkg.mk,v 1.1244 2003/08/23 09:11:19 grant Exp $
 #
 # This file is in the public domain.
 #
@@ -2666,10 +2666,12 @@
        bins=`${PKG_INFO} -qL ${PKGNAME} | { ${EGREP} -h '/(bin|sbin|libexec)/' || ${TRUE}; }`; \
        if [ "${OBJECT_FMT}" = "ELF" ]; then                            \
                shlibs=`${PKG_INFO} -qL ${PKGNAME} | { ${EGREP} -h '/lib/lib.*.so' || ${TRUE}; }`; \
+       elif [ "${OBJECT_FMT}" = "Mach-O" ]; then                       \
+               shlibs=`${PKG_INFO} -qL ${PKGNAME} | { ${EGREP} -h '/lib/lib.*.dylib' || ${TRUE}; }`; \
        else                                                            \
                shlibs="";                                              \
        fi;                                                             \
-       if [ X${LDD} = X ]; then                                        \
+       if [ "X${LDD}" = X ]; then                                      \
                ldd=`${TYPE} ldd 2>/dev/null | ${AWK} '{ print $$NF }'`;\
        else                                                            \
                ldd="${LDD}";                                           \
@@ -4321,26 +4323,32 @@
 .  endif
 .  if ${CHECK_SHLIBS} == "YES"
        ${_PKG_SILENT}${_PKG_DEBUG}                                     \
+       case "${LDD}" in                                                \
+       "")     ldd=`${TYPE} ldd 2>/dev/null | ${AWK} '{ print $$NF }'`;; \
+       *)      ldd="${LDD}";                                           \
+       esac;                                                           \
        case "${OBJECT_FMT}" in                                         \
        ELF)    bins=`${SETENV} PREFIX=${PREFIX} ${AWK} '/^(bin|sbin|libexec)\// { print ENVIRON["PREFIX"] "/" $$0 }' ${PLIST} || ${TRUE}`; \
                libs=`${SETENV} PREFIX=${PREFIX} ${AWK} '/^lib\/lib.*\.so\.[0-9]+$$/ { print ENVIRON["PREFIX"] "/" $$0 }' ${PLIST} || ${TRUE}`; \
-               for i in "" $$libs; do                                  \
-                       ${TEST} "$$i" = "" && continue;                 \
-                       ${ECHO} "PROVIDES=$$i" >> ${BUILD_INFO_FILE};   \
-               done;                                                   \
-               case "${LDD}" in                                        \
-               "")     ldd=`${TYPE} ldd 2>/dev/null | ${AWK} '{ print $$NF }'`;; \
-               *)      ldd="${LDD}";                                   \
-               esac;                                                   \
                if ${TEST} "$$bins" != "" -o "$$libs" != ""; then       \
                        requires=`($$ldd $$bins $$libs 2>/dev/null || ${TRUE}) | ${AWK} 'NF == 3 { print $$3 }' | ${SORT} -u`; \
-                       for req in "" $$requires; do                    \
-                               ${TEST} "$$req" = "" && continue;       \
-                               ${ECHO} "REQUIRES=$$req" >> ${BUILD_INFO_FILE}; \
-                       done;                                           \
+               fi;                                                     \
+               ;;                                                      \
+       Mach-O) bins=`${SETENV} PREFIX=${PREFIX} ${AWK} '/^(bin|sbin|libexec)\// { print ENVIRON["PREFIX"] "/" $$0 }' ${PLIST} || ${TRUE}`; \
+               libs=`${SETENV} PREFIX=${PREFIX} ${AWK} '/^lib\/lib.*\.dylib/ { print ENVIRON["PREFIX"] "/" $$0 }' ${PLIST} || ${TRUE}`; \
+               if ${TEST} "$$bins" != "" -o "$$libs" != ""; then       \
+                       requires=`($$ldd $$bins $$libs 2>/dev/null || ${TRUE}) | ${AWK} 'NF > 1 { print $$1 }' | ${SORT} -u`; \
                fi;                                                     \
-               ;;                                                      \
-       esac
+               ;;                                                      \
+       esac;                                                           \
+       for i in "" $$libs; do                                          \
+               ${TEST} "$$i" = "" && continue;                         \
+               ${ECHO} "PROVIDES=$$i" >> ${BUILD_INFO_FILE};           \
+       done;                                                           \
+       for req in "" $$requires; do                                    \
+               ${TEST} "$$req" = "" && continue;                       \
+               ${ECHO} "REQUIRES=$$req" >> ${BUILD_INFO_FILE};         \
+       done
 .  endif
        ${_PKG_SILENT}${_PKG_DEBUG}                                     \
        ${ECHO} "_PKGTOOLS_VER=${PKGTOOLS_VERSION}" >> ${BUILD_INFO_FILE}



Home | Main Index | Thread Index | Old Index