Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 29 Jun 2013 11:43:01 +0000 (UTC)
From:      Chris Rees <crees@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r322046 - head/Mk
Message-ID:  <201306291143.r5TBh199051898@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: crees
Date: Sat Jun 29 11:43:01 2013
New Revision: 322046
URL: http://svnweb.freebsd.org/changeset/ports/322046

Log:
  When python ports are installed that depend on the architecture/ABI of the
  system currently installed (i.e. PYEASYINSTALL_ARCHDEP) the entire version
  string of the system is used in the destination directory, for example;
  
  python_ldap-2.4.12-py2.7-freebsd-10.0-CURRENT-amd64.egg
  
  This plays havoc when STABLE, RELEASE and RELENG are used, not forgetting
  patchlevels as well.  Now, only the major FreeBSD version number is included;
  
  python_ldap-2.4.12-py2.7-freebsd-10-amd64.egg
  
  Given that ABI should be stable at least over major releases, this now allows
  packages to be created and installed correctly.
  
  PR:		ports/133081
  Submitted by:	Stef Walter <stef@memberwebs.com>
  		(this patch used as a starting point)
  Reviewed by:	No objections from python@

Modified:
  head/Mk/bsd.python.mk

Modified: head/Mk/bsd.python.mk
==============================================================================
--- head/Mk/bsd.python.mk	Sat Jun 29 11:26:36 2013	(r322045)
+++ head/Mk/bsd.python.mk	Sat Jun 29 11:43:01 2013	(r322046)
@@ -171,7 +171,7 @@ Python_Include_MAINTAINER=	python@FreeBS
 #
 # PYEASYINSTALL_OSARCH
 #					- Platform identifier for easy_install.
-#					  default: -${OPSYS:L}-${_OSRELEASE}-${ARCH}
+#					  default: -${OPSYS:L}-${OSVERSION:C/([0-9]*)[0-9]{5}/\1/}-${ARCH}
 #							   if PYEASYINSTALL_ARCHDEP is defined.
 #
 # PYEASYINSTALL_CMD - Full file path to easy_install command.
@@ -476,10 +476,8 @@ MAKE_ENV+=						PYTHONPATH=${PYEASYINSTA
 .endif
 
 .if defined(PYEASYINSTALL_ARCHDEP)
-.if !defined(_OSRELEASE)
-_OSRELEASE!=					${UNAME} -r
-.endif
-PYEASYINSTALL_OSARCH?=			-${OPSYS:L}-${_OSRELEASE}-${ARCH}
+PYEASYINSTALL_OSARCH?=			-${OPSYS:L}-${OSVERSION:C/([0-9]*)[0-9]{5}/\1/}-${ARCH}
+MAKE_ENV+=						_PYTHON_HOST_PLATFORM=${PYEASYINSTALL_OSARCH}
 .endif
 PYEASYINSTALL_EGG?=				${PYDISTUTILS_PKGNAME:C/[^A-Za-z0-9.]+/_/g}-${PYDISTUTILS_PKGVERSION:C/[^A-Za-z0-9.]+/_/g}-py${PYTHON_VER}${PYEASYINSTALL_OSARCH}.egg
 PYEASYINSTALL_CMD?=				${LOCALBASE}/bin/easy_install-${PYTHON_VER}
@@ -502,13 +500,13 @@ pre-install-easyinstall:
 
 add-plist-post: add-plist-easyinstall
 add-plist-easyinstall:
-	@# @unexec line must be located before any other line while @exec must not.
-	@${CAT} ${TMPPLIST} > ${TMPPLIST}.pei_tmp
-	@${ECHO_CMD} "@unexec ${PYEASYINSTALL_CMD} ${PYEASYINSTALL_UNINSTALLARGS}" \
-		> ${TMPPLIST}
-	@${CAT} ${TMPPLIST}.pei_tmp >> ${TMPPLIST}
-	@${ECHO_CMD} "@exec ${SETENV} PYTHONPATH=${PYEASYINSTALL_SITELIBDIR} \
-		${PYEASYINSTALL_CMD} ${PYEASYINSTALL_INSTALLARGS}" \
+	@# Easiest to fake pyeasyinstall, or it complains about paths
+	@${ECHO_CMD} "@unexec ${REINPLACE_CMD} -i '' \
+			-e '\,^\./${PYEASYINSTALL_EGG}$$,d' \
+			${PYEASYINSTALL_SITELIBDIR}/easy-install.pth" \
+		>> ${TMPPLIST}
+	@${ECHO_CMD} "@exec ${PRINTF} '1a\n./${PYEASYINSTALL_EGG}\n.\nw\nq\n' | \
+			/bin/ed ${PYEASYINSTALL_SITELIBDIR}/easy-install.pth" \
 		>> ${TMPPLIST}
 .endif		# defined(USE_PYDISTUTILS) && ${USE_PYDISTUTILS} == "easy_install"
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201306291143.r5TBh199051898>