| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | # $NetBSD: extension.mk,v 1.44 2016/05/20 16:37:27 wiz Exp $ | | 1 | # $NetBSD: extension.mk,v 1.45 2016/05/21 05:22:40 richard Exp $ |
2 | | | 2 | |
3 | .include "../../lang/python/pyversion.mk" | | 3 | .include "../../lang/python/pyversion.mk" |
4 | | | 4 | |
5 | # Packages that are a non-egg distutils extension should set | | 5 | # Packages that are a non-egg distutils extension should set |
6 | # PYDISTUTILSPKG=YES and include this mk file. | | 6 | # PYDISTUTILSPKG=YES and include this mk file. |
7 | | | 7 | |
8 | # This mk fragment is included to handle packages that create | | 8 | # This mk fragment is included to handle packages that create |
9 | # extensions to python, which by definition are those that place files | | 9 | # extensions to python, which by definition are those that place files |
10 | # in ${PYSITELIB}. Extensions can be implemented via setuptools as | | 10 | # in ${PYSITELIB}. Extensions can be implemented via setuptools as |
11 | # eggs (see egg.mk), via distutils (confusing, with an egg-info file, | | 11 | # eggs (see egg.mk), via distutils (confusing, with an egg-info file, |
12 | # even though they are not eggs), or via more ad hocs methods. | | 12 | # even though they are not eggs), or via more ad hocs methods. |
13 | | | 13 | |
14 | .if defined(PYDISTUTILSPKG) | | 14 | .if defined(PYDISTUTILSPKG) |
| @@ -18,30 +18,31 @@ PYSETUP?= setup.py | | | @@ -18,30 +18,31 @@ PYSETUP?= setup.py |
18 | PYSETUPBUILDTARGET?= build | | 18 | PYSETUPBUILDTARGET?= build |
19 | PYSETUPBUILDARGS?= #empty | | 19 | PYSETUPBUILDARGS?= #empty |
20 | PYSETUPARGS?= #empty | | 20 | PYSETUPARGS?= #empty |
21 | PYSETUPINSTALLARGS?= #empty | | 21 | PYSETUPINSTALLARGS?= #empty |
22 | PYSETUPOPTARGS?= -c -O1 | | 22 | PYSETUPOPTARGS?= -c -O1 |
23 | _PYSETUPINSTALLARGS= ${PYSETUPINSTALLARGS} ${PYSETUPOPTARGS} ${_PYSETUPTOOLSINSTALLARGS} | | 23 | _PYSETUPINSTALLARGS= ${PYSETUPINSTALLARGS} ${PYSETUPOPTARGS} ${_PYSETUPTOOLSINSTALLARGS} |
24 | _PYSETUPINSTALLARGS+= --root=${DESTDIR:Q} | | 24 | _PYSETUPINSTALLARGS+= --root=${DESTDIR:Q} |
25 | PY_PATCHPLIST?= yes | | 25 | PY_PATCHPLIST?= yes |
26 | PYSETUPINSTALLARGS?= #empty | | 26 | PYSETUPINSTALLARGS?= #empty |
27 | PYSETUPTESTTARGET?= test | | 27 | PYSETUPTESTTARGET?= test |
28 | PYSETUPTESTARGS?= #empty | | 28 | PYSETUPTESTARGS?= #empty |
29 | PYSETUPSUBDIR?= #empty | | 29 | PYSETUPSUBDIR?= #empty |
30 | | | 30 | |
31 | pre-patch: fixup-python-writeable-source | | 31 | post-install: fixup-python-writeable-source |
32 | .PHONY: fixup-python-writeable-source | | 32 | .PHONY: fixup-python-writeable-source |
33 | fixup-python-writeable-source: | | 33 | fixup-python-writeable-source: |
34 | ${FIND} ${WRKSRC} -type f -exec ${CHMOD} go-w {} \; | | 34 | ${FIND} ${DESTDIR} -type f \( -perm -g+w -o -perm -o+w \) \ |
| | | 35 | -exec ${CHMOD} go-w '{}' + |
35 | | | 36 | |
36 | do-build: | | 37 | do-build: |
37 | (cd ${WRKSRC}/${PYSETUPSUBDIR} && ${SETENV} ${MAKE_ENV} ${PYTHONBIN} \ | | 38 | (cd ${WRKSRC}/${PYSETUPSUBDIR} && ${SETENV} ${MAKE_ENV} ${PYTHONBIN} \ |
38 | ${PYSETUP} ${PYSETUPARGS} ${PYSETUPBUILDTARGET} ${PYSETUPBUILDARGS}) | | 39 | ${PYSETUP} ${PYSETUPARGS} ${PYSETUPBUILDTARGET} ${PYSETUPBUILDARGS}) |
39 | | | 40 | |
40 | do-install: | | 41 | do-install: |
41 | (cd ${WRKSRC}/${PYSETUPSUBDIR} && ${SETENV} ${INSTALL_ENV} ${MAKE_ENV} \ | | 42 | (cd ${WRKSRC}/${PYSETUPSUBDIR} && ${SETENV} ${INSTALL_ENV} ${MAKE_ENV} \ |
42 | ${PYTHONBIN} ${PYSETUP} ${PYSETUPARGS} "install" ${_PYSETUPINSTALLARGS}) | | 43 | ${PYTHONBIN} ${PYSETUP} ${PYSETUPARGS} "install" ${_PYSETUPINSTALLARGS}) |
43 | .if !target(do-test) && !(defined(TEST_TARGET) && !empty(TEST_TARGET)) | | 44 | .if !target(do-test) && !(defined(TEST_TARGET) && !empty(TEST_TARGET)) |
44 | do-test: | | 45 | do-test: |
45 | (cd ${WRKSRC}/${PYSETUPSUBDIR} && ${SETENV} ${MAKE_ENV} ${PYTHONBIN} \ | | 46 | (cd ${WRKSRC}/${PYSETUPSUBDIR} && ${SETENV} ${MAKE_ENV} ${PYTHONBIN} \ |
46 | ${PYSETUP} ${PYSETUPARGS} ${PYSETUPTESTTARGET} ${PYSETUPTESTARGS}) | | 47 | ${PYSETUP} ${PYSETUPARGS} ${PYSETUPTESTTARGET} ${PYSETUPTESTARGS}) |
47 | .endif | | 48 | .endif |