aboutsummaryrefslogtreecommitdiff
path: root/sysutils/dvdvideo
diff options
context:
space:
mode:
authorGanael LAPLANCHE <martymac@FreeBSD.org>2012-09-21 09:10:22 +0000
committerGanael LAPLANCHE <martymac@FreeBSD.org>2012-09-21 09:10:22 +0000
commit27d387cfe9a33a1c07ccb2efbea478ae57b5e709 (patch)
treec233b2a189975077f25f3ccb21818c5c59e3d85e /sysutils/dvdvideo
parenta508b33017bb84d62bcf75baee8a26536af1d510 (diff)
downloadports-27d387cfe9a33a1c07ccb2efbea478ae57b5e709.tar.gz
ports-27d387cfe9a33a1c07ccb2efbea478ae57b5e709.zip
Notes
Diffstat (limited to 'sysutils/dvdvideo')
-rw-r--r--sysutils/dvdvideo/Makefile21
1 files changed, 17 insertions, 4 deletions
diff --git a/sysutils/dvdvideo/Makefile b/sysutils/dvdvideo/Makefile
index 8e7e8036e7c3..b2782e65ae3f 100644
--- a/sysutils/dvdvideo/Makefile
+++ b/sysutils/dvdvideo/Makefile
@@ -33,10 +33,6 @@ DVDCSS_LIBVERSION= 3
.include <bsd.port.pre.mk>
-.if ${PYTHON_REL} >= 323
-BROKEN= bad plist with latest python
-.endif
-
.if ${PORT_OPTIONS:MDVDCSS}
LIB_DEPENDS+= dvdcss:${PORTSDIR}/multimedia/libdvdcss
.endif
@@ -45,4 +41,21 @@ post-patch:
@${REINPLACE_CMD} -E -e 's|(libdvdcss.so)\.2|\1.${DVDCSS_LIBVERSION}|' \
${WRKSRC}/dvdvideo/libdvdcss.py
+# When Python version is 3.2+ we rewrite all the filenames
+# of TMPPLIST that end with .py[co], so that they conform
+# to PEP 3147 (see http://www.python.org/dev/peps/pep-3147/)
+.if ${PYTHON_REL} >= 320
+PYMAGICTAG= ${PYTHON_CMD} -c 'import imp; print(imp.get_tag())'
+add-plist-post:
+ @${AWK} '\
+ /\.py[co]$$/ && !($$0 ~ "/" pc "/") {id = match($$0, /\/[^\/]+\.py[co]$$/); if (id != 0) {d = substr($$0, 1, RSTART - 1); dirs[d] = 1}; sub(/\.py[co]$$/, "." mt "&"); sub(/[^\/]+\.py[co]$$/, pc "/&"); print; next} \
+ /^@dirrm / {d = substr($$0, 8); if (d in dirs) {print $$0 "/" pc}; print $$0; next} \
+ {print} \
+ END {if (sp in dirs) {print "@dirrm " sp "/" pc}} \
+ ' \
+ pc="__pycache__" mt="$$(${PYMAGICTAG})" sp="${PYTHON_SITELIBDIR:S,${PYTHONBASE}/,,g}" \
+ ${TMPPLIST} > ${TMPPLIST}.pyc_tmp
+ @${MV} ${TMPPLIST}.pyc_tmp ${TMPPLIST}
+.endif
+
.include <bsd.port.post.mk>