source: trunk/dports/lang/jython/Portfile

Last change on this file was 151154, checked in by cal@…, 16 months ago

jython: Fix issue while upgrading from 2.5.2

Closes #51981

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 2.9 KB
Line 
1# $Id: Portfile 151154 2016-08-08 22:33:06Z ryandesign@macports.org $
2
3PortSystem          1.0
4
5name                jython
6version             2.7.0
7revision            1
8categories          lang python java
9platforms           darwin
10maintainers         nomaintainer
11description         Python implementation in pure Java
12long_description    \
13    Jython is an implementation of the high-level, \
14    dynamic, object-oriented language Python written in \
15    100% Pure Java, and seamlessly integrated with the \
16    Java platform. It thus allows you to run Python on any \
17    Java platform.
18license             PSF
19
20homepage            http://www.jython.org/
21master_sites        http://search.maven.org/remotecontent?filepath=org/python/jython-installer/${version}
22fetch.type          hg
23hg.url              https://hg.python.org/jython
24hg.tag              v${version}
25
26depends_build       bin:ant:apache-ant
27depends_lib         bin:java:kaffe
28
29use_configure       no
30build.cmd           ant
31build.target        developer-build
32set java_ver        1.7
33set have_java       [catch { exec /usr/libexec/java_home -F -v ${java_ver} } java_home ]
34build.env           JAVA_HOME=${java_home}
35
36pre-fetch {
37    if {![variant_isset installer] && ${have_java} == 1} {
38       return -code error "Java ${java_ver} is required to build from source"
39    }
40}
41
42set bin_name        jython.py
43
44destroot {
45    xinstall -m 755 -d ${destroot}${prefix}/share/java/
46    copy ${worksrcpath}/dist \
47        ${destroot}${prefix}/share/java/${name}
48}
49
50post-destroot {
51    set fp [open ${destroot}${prefix}/bin/${name} w]
52    puts $fp "#!/bin/sh"
53    puts $fp "${prefix}/share/java/${name}/bin/${bin_name} \\"
54    puts $fp "  -Dpython.cachedir=\"\$HOME/.jython_cachedir\" \"\$@\""
55    close $fp
56    system "chmod +x ${destroot}${prefix}/bin/${name}"
57}
58
59pre-activate {
60    # Delete cache files left over from old installation
61    file delete -force -- ${prefix}/share/java/${name}/cachedir
62}
63
64variant installer description {Use installer, rather than building from source} {
65    fetch.type      standard
66    distname        ${name}-installer-${version}
67    worksrcdir
68    extract.suffix  .jar
69    distfiles       ${distname}${extract.suffix}
70    extract.cmd     cp
71    extract.args    ${worksrcpath}
72    extract.pre_args
73    extract.post_args ${worksrcpath}
74    depends_build-delete bin:ant:apache-ant
75    checksums           rmd160  4f9cf193cc9a41b1fc603d02932778d3fbeb3e11 \
76                        sha256  b44352ece72382268a60e2848741c96609a91d796bb9a9c6ebeff62f0c12c9cf
77
78    pre-build {
79        xinstall -m 755 -d ${destroot}${prefix}/share/java/${name}
80    }
81
82    build.cmd       java
83    build.target
84    build.env
85    build.args      -jar ${distname}${extract.suffix}
86    build.post_args -s -d ${destroot}${prefix}/share/java/${name}
87
88    set bin_name    jython
89
90    destroot {}
91}
92
93default_variants +installer
94
95livecheck.type      regex
96livecheck.url       ${homepage}downloads.html
97livecheck.regex     "Jython (\\d+(?:\\.\\d+)*)"
Note: See TracBrowser for help on using the repository browser.