Update lang/seed7 to version 05.20160430
[dports.git] / lang / jython / Makefile
1 # Created by: Hye-Shik Chang <perky@python.or.kr>
2 # $FreeBSD$
3
4 PORTNAME=       jython
5 PORTVERSION=    2.7.0
6 CATEGORIES=     lang python java
7 MASTER_SITES=   https://repo1.maven.org/maven2/org/python/jython-installer/${PORTVERSION}/ \
8                 http://repo1.maven.org/maven2/org/python/jython-installer/${PORTVERSION}/
9 DISTNAME=       jython-installer-${PORTVERSION}
10 EXTRACT_SUFX=   .jar
11
12 MAINTAINER=     python@FreeBSD.org
13 COMMENT=        Implementation of Python Interpreter in Pure Java
14
15 LICENSE=        PSFL APACHE20
16 LICENSE_COMB=   multi
17 LICENSE_FILE_PSFL=      ${WRKDIR}/LICENSE.txt
18 LICENSE_FILE_APACHE20=  ${WRKDIR}/LICENSE_Apache.txt
19
20 BUILD_DEPENDS=  bash:shells/bash
21 RUN_DEPENDS=    bash:shells/bash
22
23 # Extract only license files
24 EXTRACT_AFTER_ARGS=     --no-same-owner --no-same-permissions \
25                         LICENSE.txt LICENSE_Apache.txt
26 USE_JAVA=       yes
27 JAVA_VERSION=   1.7+
28 NO_BUILD=       yes
29 NO_ARCH=        yes
30 REINPLACE_ARGS= -i ""
31
32 INST_TARGET?=   lib/jython
33 JYTHON_PREFIX=  ${PREFIX}/${INST_TARGET}
34 PLIST_SUB+=     JYTHON_DIR=${INST_TARGET}
35
36 # Do tons of backflips so that the cachedir is put into the user's home
37 # directory (it's irritating to not be able to cache stuff if you're
38 # not root).  Furthermore, don't leave a cachedir around from either a
39 # port install or a package install, but do cache the *.py files in Lib
40 # during a port install or a package install.
41 do-install:
42 # Null the PATH so installer won't find the python2.7 executable
43 # and won't build a python launcher instead of bash one
44         cd ${DISTDIR} && PATH="" ${JAVA} \
45                 -jar ${DISTNAME}${EXTRACT_SUFX} \
46                 --silent -d ${STAGEDIR}${JYTHON_PREFIX} -t standard -e ensurepip
47 # Place python.cachedir in user's home directory by default
48         ${REINPLACE_CMD} \
49                 's|\"$$JAVA_OPTS|\"-Dpython.cachedir=$${HOME}/.jython-cachedir $$JAVA_OPTS|g' \
50                 ${STAGEDIR}${JYTHON_PREFIX}/bin/jython
51 # Teach bin/jython script to solve symlinks the right way
52         ${REINPLACE_CMD} \
53                 's,if expr "$$link" : '\''/'\'' > /dev/null; then,if expr "$$link" : '\''^/'\'' > /dev/null; then,' \
54                 ${STAGEDIR}${JYTHON_PREFIX}/bin/jython
55 # Delete python.cachedir entry from Jython's registry file
56         ${REINPLACE_CMD} 's/^python\.cachedir/#&/g' \
57                 ${STAGEDIR}${JYTHON_PREFIX}/registry
58 # Compile all the *.py files to *$py.class files, override HOME and user.home to place
59 # .jython-cachedir and .jline-jython.history in WRKDIR
60         -HOME=${WRKDIR} JAVA_OPTS="-Duser.home=${WRKDIR}" \
61                 ${STAGEDIR}${JYTHON_PREFIX}/bin/jython \
62                 -m compileall -d ${JYTHON_PREFIX} ${STAGEDIR}${JYTHON_PREFIX}
63
64 # Install symbolic links for convenience.
65         ${LN} -sf ${JYTHON_PREFIX}/bin/jython ${STAGEDIR}${PREFIX}/bin/jython
66         ${LN} -sf ${JYTHON_PREFIX}/registry ${STAGEDIR}${PREFIX}/etc/jython.reg
67
68 .include <bsd.port.mk>