Sun Aug 28 09:40:35 2016 UTC ()
Let print-PLIST generate python version agnostic PYVERSSUFFIX in filenames.
This is somewhat related to the recent PLIST_SUBST commit.  Ok'd by wiz@


(richard)
diff -r1.7 -r1.8 pkgsrc/lang/python/distutils.mk
diff -r1.23 -r1.24 pkgsrc/lang/python/egg.mk

cvs diff -r1.7 -r1.8 pkgsrc/lang/python/Attic/distutils.mk (expand / switch to unified diff)

--- pkgsrc/lang/python/Attic/distutils.mk 2014/12/31 13:57:28 1.7
+++ pkgsrc/lang/python/Attic/distutils.mk 2016/08/28 09:40:35 1.8
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1# $NetBSD: distutils.mk,v 1.7 2014/12/31 13:57:28 wiz Exp $ 1# $NetBSD: distutils.mk,v 1.8 2016/08/28 09:40:35 richard Exp $
2# 2#
3# Common logic for python distributions that use distutils. 3# Common logic for python distributions that use distutils.
4# 4#
5.include "../../mk/bsd.fast.prefs.mk" 5.include "../../mk/bsd.fast.prefs.mk"
6 6
7.include "../../lang/python/pyversion.mk" 7.include "../../lang/python/pyversion.mk"
8 8
9# This file should be included to package python "distributions" which 9# This file should be included to package python "distributions" which
10# use distutils. See egg.mk for distributions that use setuptools and 10# use distutils. See egg.mk for distributions that use setuptools and
11# extensions.mk for ad hoc cases. 11# extensions.mk for ad hoc cases.
12 12
13# Some day, hoist the PYDISTUTILSPKG code in extension.mk to here, 13# Some day, hoist the PYDISTUTILSPKG code in extension.mk to here,
14# after all distutils-using packages use this. 14# after all distutils-using packages use this.
@@ -18,15 +18,17 @@ PYDISTUTILSPKG= yes @@ -18,15 +18,17 @@ PYDISTUTILSPKG= yes
18# can do so, and provide support for a PLIST entry that represents 18# can do so, and provide support for a PLIST entry that represents
19# this norm and will work with all python versions. 19# this norm and will work with all python versions.
20 20
21# Set the egg file basename. 21# Set the egg file basename.
22EGG_NAME?= ${DISTNAME:C/-([^0-9])/_\1/g} 22EGG_NAME?= ${DISTNAME:C/-([^0-9])/_\1/g}
23 23
24# Python distutils will create an eggfile. 24# Python distutils will create an eggfile.
25PY_NO_EGG?= no 25PY_NO_EGG?= no
26 26
27# Egg files have the version encoded, so generalize in PLIST. 27# Egg files have the version encoded, so generalize in PLIST.
28PLIST_SUBST+= EGG_FILE=${EGG_NAME}-py${PYVERSSUFFIX}.egg-info 28PLIST_SUBST+= EGG_FILE=${EGG_NAME}-py${PYVERSSUFFIX}.egg-info
29PRINT_PLIST_AWK+= { gsub("${EGG_NAME}-py${PYVERSSUFFIX}.egg-info", \ 29PRINT_PLIST_AWK+= { gsub("${EGG_NAME}-py${PYVERSSUFFIX}.egg-info", \
30 "$${EGG_FILE}") } 30 "$${EGG_FILE}") }
 31PRINT_PLIST_AWK+= { gsub(/${PYVERSSUFFIX}/, \
 32 "$${PYVERSSUFFIX}") }
31 33
32.include "../../lang/python/extension.mk" 34.include "../../lang/python/extension.mk"

cvs diff -r1.23 -r1.24 pkgsrc/lang/python/egg.mk (expand / switch to unified diff)

--- pkgsrc/lang/python/egg.mk 2016/06/01 09:44:52 1.23
+++ pkgsrc/lang/python/egg.mk 2016/08/28 09:40:35 1.24
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1# $NetBSD: egg.mk,v 1.23 2016/06/01 09:44:52 wiz Exp $ 1# $NetBSD: egg.mk,v 1.24 2016/08/28 09:40:35 richard Exp $
2# 2#
3# Common logic to handle Python Eggs 3# Common logic to handle Python Eggs
4# 4#
5.include "../../mk/bsd.fast.prefs.mk" 5.include "../../mk/bsd.fast.prefs.mk"
6.include "../../lang/python/pyversion.mk" 6.include "../../lang/python/pyversion.mk"
7 7
8# This file should be included to package python "distributions" which 8# This file should be included to package python "distributions" which
9# use setuptools to create an egg. Some distributions use distutils, 9# use setuptools to create an egg. Some distributions use distutils,
10# which creates an egg-info file; those should use distutils.mk 10# which creates an egg-info file; those should use distutils.mk
11 11
12EGG_NAME?= ${DISTNAME:C/-([^0-9])/_\1/g} 12EGG_NAME?= ${DISTNAME:C/-([^0-9])/_\1/g}
13EGG_INFODIR?= ${EGG_NAME}-py${PYVERSSUFFIX}.egg-info 13EGG_INFODIR?= ${EGG_NAME}-py${PYVERSSUFFIX}.egg-info
14 14
@@ -22,26 +22,28 @@ PY_PATCHPLIST= yes @@ -22,26 +22,28 @@ PY_PATCHPLIST= yes
22# egg-info directory. 22# egg-info directory.
23 23
24# The PLIST substitution of EGG_NAME is not necessary. However, it 24# The PLIST substitution of EGG_NAME is not necessary. However, it
25# is convenient. See lang/ruby/gem.mk and PLIST files for ruby gem 25# is convenient. See lang/ruby/gem.mk and PLIST files for ruby gem
26# packages to understand other examples of this feature in non-python 26# packages to understand other examples of this feature in non-python
27# packages. 27# packages.
28 28
29PLIST_SUBST+= EGG_NAME=${EGG_NAME}-py${PYVERSSUFFIX} 29PLIST_SUBST+= EGG_NAME=${EGG_NAME}-py${PYVERSSUFFIX}
30PLIST_SUBST+= EGG_INFODIR=${EGG_INFODIR} 30PLIST_SUBST+= EGG_INFODIR=${EGG_INFODIR}
31PRINT_PLIST_AWK+= { gsub(/${EGG_NAME}-py${PYVERSSUFFIX}.egg-info/, \ 31PRINT_PLIST_AWK+= { gsub(/${EGG_NAME}-py${PYVERSSUFFIX}.egg-info/, \
32 "$${EGG_INFODIR}") } 32 "$${EGG_INFODIR}") }
33PRINT_PLIST_AWK+= { gsub(/${EGG_NAME}-py${PYVERSSUFFIX}-nspkg.pth/, \ 33PRINT_PLIST_AWK+= { gsub(/${EGG_NAME}-py${PYVERSSUFFIX}-nspkg.pth/, \
34 "$${EGG_NAME}-nspkg.pth") } 34 "$${EGG_NAME}-nspkg.pth") }
 35PRINT_PLIST_AWK+= { gsub(/${PYVERSSUFFIX}/, \
 36 "$${PYVERSSUFFIX}") }
35 37
36_PYSETUPTOOLSINSTALLARGS= --single-version-externally-managed 38_PYSETUPTOOLSINSTALLARGS= --single-version-externally-managed
37 39
38DEPENDS+= ${PYPKGPREFIX}-setuptools>=0.8:../../devel/py-setuptools 40DEPENDS+= ${PYPKGPREFIX}-setuptools>=0.8:../../devel/py-setuptools
39 41
40INSTALLATION_DIRS+= ${PYSITELIB} 42INSTALLATION_DIRS+= ${PYSITELIB}
41 43
42privileged-install-hook: fixup-egg-info 44privileged-install-hook: fixup-egg-info
43.PHONY: fixup-egg-info 45.PHONY: fixup-egg-info
44fixup-egg-info: # ensure egg-info directory contents are always 644 46fixup-egg-info: # ensure egg-info directory contents are always 644
45 if ${TEST} -d "${DESTDIR}${PREFIX}/${PYSITELIB}/${EGG_INFODIR}"; then \ 47 if ${TEST} -d "${DESTDIR}${PREFIX}/${PYSITELIB}/${EGG_INFODIR}"; then \
46 ${FIND} ${DESTDIR}${PREFIX}/${PYSITELIB}/${EGG_INFODIR} -type f \ 48 ${FIND} ${DESTDIR}${PREFIX}/${PYSITELIB}/${EGG_INFODIR} -type f \
47 -exec ${CHMOD} ${SHAREMODE} '{}' +; \ 49 -exec ${CHMOD} ${SHAREMODE} '{}' +; \