pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/mk/install Add cross-compiling support for bin-install...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/aaecca6528f8
branches:  trunk
changeset: 532464:aaecca6528f8
user:      joerg <joerg%pkgsrc.org@localhost>
date:      Mon Aug 20 10:59:05 2007 +0000

description:
Add cross-compiling support for bin-install and deinstall targets.

diffstat:

 mk/install/bin-install.mk |  27 ++++++++++++++++++++++++++-
 mk/install/deinstall.mk   |  11 +++++++++--
 2 files changed, 35 insertions(+), 3 deletions(-)

diffs (75 lines):

diff -r efd7bf2f0df0 -r aaecca6528f8 mk/install/bin-install.mk
--- a/mk/install/bin-install.mk Mon Aug 20 07:32:32 2007 +0000
+++ b/mk/install/bin-install.mk Mon Aug 20 10:59:05 2007 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: bin-install.mk,v 1.10 2007/08/02 18:19:32 joerg Exp $
+# $NetBSD: bin-install.mk,v 1.11 2007/08/20 10:59:05 joerg Exp $
 #
 
 # This file provides the following targets:
@@ -55,6 +55,30 @@
        release-localbase-lock
 
 locked-su-do-bin-install:
+.if !empty(USE_CROSS_COMPILE:M[yY][eE][sS])
+       ${RUN} \
+       found=`${PKG_BEST_EXISTS} "${PKGWILDCARD}" || ${TRUE}`; \
+       if [ "$$found" != "" ]; then                                    \
+               ${ERROR_MSG} "$$found is already installed - perhaps an older version?"; \
+               ${ERROR_MSG} "If so, you may wish to \`\`pkg_delete $$found'' and install"; \
+               ${ERROR_MSG} "this package again by \`\`${MAKE} bin-install'' to upgrade it properly."; \
+               exit 1;                                                 \
+       fi
+       ${RUN} \
+       rel=${_SHORT_UNAME_R:Q};                                        \
+       arch=${MACHINE_ARCH:Q};                                         \
+       pkgpath=${PKGREPOSITORY:Q};                                     \
+       for i in ${BINPKG_SITES}; do                                    \
+               pkgpath="$$pkgpath;$$i/All";                            \
+       done;                                                           \
+       ${STEP_MSG} "Installing ${PKGNAME} from $$pkgpath";             \
+       if ${SETENV} PKG_PATH="$$pkgpath" ${PKG_ADD} -m ${MACHINE_ARCH} -I -p ${_CROSS_DESTDIR}${PREFIX} ${_BIN_INSTALL_FLAGS} ${PKGNAME_REQD:U${PKGNAME}:Q}${PKG_SUFX}; then \
+               ${ECHO} "Fixing recorded cwd...";                       \
+               ${SED} -e 's|@cwd ${_CROSS_DESTDIR}|@cwd |' ${_PKG_DBDIR}/${PKGNAME:Q}/+CONTENTS > ${_PKG_DBDIR}/${PKGNAME:Q}/+CONTENTS.tmp; \
+               ${MV} ${_PKG_DBDIR}/${PKGNAME:Q}/+CONTENTS.tmp ${_PKG_DBDIR}/${PKGNAME:Q}/+CONTENTS; \
+               ${ECHO} "`${PKG_INFO} -e ${PKGNAME_REQD:U${PKGNAME}:Q}` successfully installed."; \
+       fi
+.else
        ${RUN} \
        found=`${PKG_BEST_EXISTS} "${PKGWILDCARD}" || ${TRUE}`; \
        if [ "$$found" != "" ]; then                                    \
@@ -74,6 +98,7 @@
        if ${SETENV} PKG_PATH="$$pkgpath" ${PKG_ADD} ${_BIN_INSTALL_FLAGS} ${PKGNAME_REQD:U${PKGNAME}:Q}${PKG_SUFX}; then \
                ${ECHO} "`${PKG_INFO} -e ${PKGNAME_REQD:U${PKGNAME}:Q}` successfully installed."; \
        fi
+.endif
 
 do-bin-install-from-source:
        ${RUN} ${PKG_INFO} -qe ${PKGNAME} || {                          \
diff -r efd7bf2f0df0 -r aaecca6528f8 mk/install/deinstall.mk
--- a/mk/install/deinstall.mk   Mon Aug 20 07:32:32 2007 +0000
+++ b/mk/install/deinstall.mk   Mon Aug 20 10:59:05 2007 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: deinstall.mk,v 1.8 2007/03/09 00:39:55 rillig Exp $
+# $NetBSD: deinstall.mk,v 1.9 2007/08/20 10:59:05 joerg Exp $
 
 # DEINSTALLDEPENDS controls whether dependencies and dependents are also
 # removed when a package is de-installed.  The valid values are:
@@ -16,9 +16,16 @@
 ### It will acquire elevated privileges just-in-time.
 ###
 .PHONY: deinstall su-deinstall
-.if !target(deinstall)
+.if !empty(USE_CROSS_COMPILE:M[yY][eE][sS])
+.  if !target(deinstall)
+deinstall: su-deinstall
+       @${PHASE_MSG} "Deinstalling for ${PKGNAME}"
+.  endif
+.else
+.  if !target(deinstall)
 deinstall: su-target
        @${PHASE_MSG} "Deinstalling for ${PKGNAME}"
+.  endif
 .endif
 
 _SU_DEINSTALL_TARGETS= acquire-deinstall-lock



Home | Main Index | Thread Index | Old Index