1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-07 06:40:06 +00:00

lang/jython: update to 2.7.0

- update to 2.7.0
- change MASTER_SITES to use https and modern mirror as suggested by [1]
- Jython uses two licenses, indicate that in the port. Extract the licenses from
  the jar earlier so ports framework can find them
- the port complains when trying to build with openjdk6, so set JAVA_VERSION
  to 1.7+
- mark NO_ARCH
- null the PATH for installer invocation. If installer finds python2.7 in PATH
  it installs python wrapper script instead of bash one. [2]
- exclude "ensurepip" module from the installation as it doesn't build on FreeBSD
- change kinda dirty and not obvious replacement of "-cl"(asspath) to addition
  to JAVA_OPTS. This hack is needed to place jython cachedir into user's home
  directory, as it needs to be writable by the user invoking jython
- write comments to not obvious parts of the installation
- wrapper script is now placed in bin/ directory in JYTHON_PREFIX rather then
  in root, fix that
- Jython uses *$py.class files as an analog for *.pyc ones in plain Python,
  installer puts pre-compiled *$py.class files into the STAGEDIR. We need to
  recompile that because, after installation:
  1) If we invoke Jython as user - it can't use the *$py.class files as they
     have different source path inside, slowing down the startup;
  2) If we invoke jython as root - it will recompile the *$py.class files
     breaking the de-installation process of the package. Compilation phase
     always have non-portrelated errors, so we need to ignore it's exit code
- Don't ignore the exit code of symlink installation as we don't expect that to fail

[1] https://central.maven.org/
[2] https://hg.python.org/jython/file/tip/installer/src/java/org/python/util/install/StartScriptGenerator.java#l22

PR:		204231
Submitted by:	Sergey Kozlov <kozlov.sergey.404@gmail.com>
This commit is contained in:
Ruslan Makhmatkhanov 2015-11-20 22:14:01 +00:00
parent e954142267
commit ea1c2647d9
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=402105
3 changed files with 1824 additions and 100 deletions

View File

@ -2,54 +2,67 @@
# $FreeBSD$ # $FreeBSD$
PORTNAME= jython PORTNAME= jython
PORTVERSION= 2.5.3 PORTVERSION= 2.7.0
CATEGORIES= lang python java CATEGORIES= lang python java
MASTER_SITES= http://central.maven.org/maven2/org/python/jython-installer/${PORTVERSION}/ MASTER_SITES= https://repo1.maven.org/maven2/org/python/jython-installer/${PORTVERSION}/ \
http://repo1.maven.org/maven2/org/python/jython-installer/${PORTVERSION}/
DISTNAME= jython-installer-${PORTVERSION} DISTNAME= jython-installer-${PORTVERSION}
EXTRACT_SUFX= .jar EXTRACT_SUFX= .jar
EXTRACT_ONLY= # none
MAINTAINER= python@FreeBSD.org MAINTAINER= python@FreeBSD.org
COMMENT= Implementation of Python Interpreter in Pure Java COMMENT= Implementation of Python Interpreter in Pure Java
LICENSE= PSFL LICENSE= PSFL APACHE20
LICENSE_COMB= multi
LICENSE_FILE_PSFL= ${WRKDIR}/LICENSE.txt
LICENSE_FILE_APACHE20= ${WRKDIR}/LICENSE_Apache.txt
BUILD_DEPENDS= bash:${PORTSDIR}/shells/bash BUILD_DEPENDS= bash:${PORTSDIR}/shells/bash
RUN_DEPENDS= bash:${PORTSDIR}/shells/bash RUN_DEPENDS= bash:${PORTSDIR}/shells/bash
# Extract only license files
EXTRACT_AFTER_ARGS= --no-same-owner --no-same-permissions \
LICENSE.txt LICENSE_Apache.txt
USE_JAVA= yes USE_JAVA= yes
JAVA_VERSION= 1.6+ JAVA_VERSION= 1.7+
NO_BUILD= yes NO_BUILD= yes
NO_ARCH= yes
REINPLACE_ARGS= -i "" REINPLACE_ARGS= -i ""
INST_TARGET?= lib/jython INST_TARGET?= lib/jython
JYTHON_PREFIX= ${PREFIX}/${INST_TARGET} JYTHON_PREFIX= ${PREFIX}/${INST_TARGET}
PLIST_SUB+= JYTHON_DIR=${INST_TARGET} PLIST_SUB+= JYTHON_DIR=${INST_TARGET}
CACHEDIR_SPEC= -Dpython.cachedir=${WRKDIR}/jython-cachedir
# Do tons of backflips so that the cachedir is put into the user's home # Do tons of backflips so that the cachedir is put into the user's home
# directory (it's irritating to not be able to cache stuff if you're # directory (it's irritating to not be able to cache stuff if you're
# not root). Furthermore, don't leave a cachedir around from either a # not root). Furthermore, don't leave a cachedir around from either a
# port install or a package install, but do cache the *.py files in Lib # port install or a package install, but do cache the *.py files in Lib
# during a port install or a package install. # during a port install or a package install.
do-install: do-install:
cd ${DISTDIR} && ${JAVA} ${CACHEDIR_SPEC} \ # Null the PATH so installer won't find the python2.7 executable
# and won't build a python launcher instead of bash one
cd ${DISTDIR} && PATH="" ${JAVA} \
-jar ${DISTNAME}${EXTRACT_SUFX} \ -jar ${DISTNAME}${EXTRACT_SUFX} \
--silent -d ${STAGEDIR}${JYTHON_PREFIX} -t standard --silent -d ${STAGEDIR}${JYTHON_PREFIX} -t standard -e ensurepip
# Place python.cachedir in user's home directory by default
${REINPLACE_CMD} \ ${REINPLACE_CMD} \
's|-cl|"-Dpython.cachedir=$${HOME}/.jython-cachedir" -cl|g ; \ 's|\"$$JAVA_OPTS|\"-Dpython.cachedir=$${HOME}/.jython-cachedir $$JAVA_OPTS|g' \
s|${STAGEDIR}||' \ ${STAGEDIR}${JYTHON_PREFIX}/bin/jython
${STAGEDIR}${JYTHON_PREFIX}/jython # Teach bin/jython script to solve symlinks the right way
${REINPLACE_CMD} \ ${REINPLACE_CMD} \
's,if expr "$$link" : '\''/'\'' > /dev/null; then,if expr "$$link" : '\''^/'\'' > /dev/null; then,' \ 's,if expr "$$link" : '\''/'\'' > /dev/null; then,if expr "$$link" : '\''^/'\'' > /dev/null; then,' \
${STAGEDIR}${JYTHON_PREFIX}/jython ${STAGEDIR}${JYTHON_PREFIX}/bin/jython
# Delete python.cachedir entry from Jython's registry file
${REINPLACE_CMD} 's/^python\.cachedir/#&/g' \ ${REINPLACE_CMD} 's/^python\.cachedir/#&/g' \
${STAGEDIR}${JYTHON_PREFIX}/registry ${STAGEDIR}${JYTHON_PREFIX}/registry
${STAGEDIR}${JYTHON_PREFIX}/jython ${CACHEDIR_SPEC} -c None # Compile all the *.py files to *$py.class files, override HOME and user.home to place
# .jython-cachedir and .jline-jython.history in WRKDIR
-HOME=${WRKDIR} JAVA_OPTS="-Duser.home=${WRKDIR}" \
${STAGEDIR}${JYTHON_PREFIX}/bin/jython \
-m compileall -d ${JYTHON_PREFIX} ${STAGEDIR}${JYTHON_PREFIX}
# Install symbolic links for convenience. # Install symbolic links for convenience.
-${LN} -sf ${JYTHON_PREFIX}/jython ${STAGEDIR}${PREFIX}/bin/jython ${LN} -sf ${JYTHON_PREFIX}/bin/jython ${STAGEDIR}${PREFIX}/bin/jython
-${LN} -sf ${JYTHON_PREFIX}/registry ${STAGEDIR}${PREFIX}/etc/jython.reg ${LN} -sf ${JYTHON_PREFIX}/registry ${STAGEDIR}${PREFIX}/etc/jython.reg
.include <bsd.port.mk> .include <bsd.port.mk>

View File

@ -1,2 +1,2 @@
SHA256 (jython-installer-2.5.3.jar) = 05405966cdfa57abc8e705dd6aab92b8240097ce709fb916c8a0dbcaa491f99e SHA256 (jython-installer-2.7.0.jar) = b44352ece72382268a60e2848741c96609a91d796bb9a9c6ebeff62f0c12c9cf
SIZE (jython-installer-2.5.3.jar) = 18487200 SIZE (jython-installer-2.7.0.jar) = 92889527

File diff suppressed because it is too large Load Diff