Ticket #51682: Portfile.diff

File Portfile.diff, 4.3 KB (added by amake (Aaron Madlon-Kay), 8 years ago)
  • lang/jython/Portfile

    diff --git a/lang/jython/Portfile b/lang/jython/Portfile
    index d16804b..7f67e5a 100644
    a b  
    33PortSystem          1.0
    44
    55name                jython
    6 version             2.5.2
     6version             2.7.0
    77categories          lang python java
    88platforms           darwin
    99maintainers         nomaintainer
    long_description \ 
    1414    100% Pure Java, and seamlessly integrated with the \
    1515    Java platform. It thus allows you to run Python on any \
    1616    Java platform.
     17license             PSF
    1718
    1819homepage            http://www.jython.org/
    19 master_sites        sourceforge:project/jython/jython/${version}
    20 fetch.type          svn
    21 set und_vers        [string map {. _} ${version}]
    22 svn.url             https://svn.code.sf.net/p/jython/svn/tags/Release_${und_vers}/jython
    23 distname            jython
     20master_sites        http://search.maven.org/remotecontent?filepath=org/python/jython-installer/${version}
     21fetch.type          hg
     22hg.url              https://hg.python.org/jython
     23hg.tag              v${version}
    2424
    2525depends_build       bin:ant:apache-ant
    2626depends_lib         bin:java:kaffe
    depends_lib bin:java:kaffe 
    2828use_configure       no
    2929build.cmd           ant
    3030build.target        developer-build
     31set java_ver        1.7
     32set have_java       [catch { exec /usr/libexec/java_home -F -v ${java_ver} } java_home ]
     33build.env           JAVA_HOME=${java_home}
    3134
    32 destroot    {
    33     move ${worksrcpath}/dist/jython-dev.jar ${worksrcpath}/dist/jython.jar
    34    
    35     xinstall -m 755 ${worksrcpath}/dist/bin/jython ${destroot}${prefix}/bin/
    36     reinplace "s|JYTHON_HOME_1=`dirname \"\$PRG\"`|JYTHON_HOME_1=${prefix}/share/java/${name}|" ${destroot}${prefix}/bin/jython
     35pre-fetch {
     36    if {![variant_isset installer] && ${have_java} == 1} {
     37       return -code error "Java ${java_ver} is required to build from source"
     38    }
     39}
    3740
     41set bin_name        jython.py
     42
     43destroot {
    3844    xinstall -m 755 -d ${destroot}${prefix}/share/java/
    3945    copy ${worksrcpath}/dist \
    4046        ${destroot}${prefix}/share/java/${name}
    4147}
     48
    4249post-destroot {
    43     xinstall -m 777 -d ${destroot}${prefix}/share/java/${name}/cachedir/packages
    44     system "touch ${destroot}${prefix}/share/java/${name}/cachedir/packages/blank"
     50    set fp [open ${destroot}${prefix}/bin/${name} w]
     51    puts $fp "#!/bin/sh"
     52    puts $fp "${prefix}/share/java/${name}/bin/${bin_name} \\"
     53    puts $fp "  -Dpython.cachedir=\"\$HOME/.jython_cachedir\" \"\$@\""
     54    close $fp
     55    system "chmod +x ${destroot}${prefix}/bin/${name}"
    4556}
    4657
    4758variant installer description {Use installer, rather than building from source} {
    4859    fetch.type      standard
    49     distname        ${name}_installer-${version}
    50     worksrcdir     
     60    distname        ${name}-installer-${version}
     61    worksrcdir
    5162    extract.suffix  .jar
    5263    distfiles       ${distname}${extract.suffix}
    5364    extract.cmd     cp
    variant installer description {Use installer, rather than building from source} 
    5566    extract.pre_args
    5667    extract.post_args ${worksrcpath}
    5768    depends_build-delete bin:ant:apache-ant
    58     checksums           md5     7c7d9abd8985df480edeacd27ed9dcd5 \
    59                         sha1    d4534a691edf40aa1d51723dfe3e22db1e39b432 \
    60                         rmd160  898f92c07a44beb76c1a51cbb5ad8c0a874f06bd
     69    checksums           rmd160  4f9cf193cc9a41b1fc603d02932778d3fbeb3e11 \
     70                        sha256  b44352ece72382268a60e2848741c96609a91d796bb9a9c6ebeff62f0c12c9cf
    6171
    6272    pre-build {
    6373        xinstall -m 755 -d ${destroot}${prefix}/share/java/${name}
    6474    }
    6575
    6676    build.cmd       java
    67     build.target   
     77    build.target
     78    build.env
    6879    build.args      -jar ${distname}${extract.suffix}
    6980    build.post_args -s -d ${destroot}${prefix}/share/java/${name}
    70     destroot        {
    71         reinplace -E "s|^JYTHON_HOME_FALLBACK=.*|JYTHON_HOME_FALLBACK=\"${prefix}/share/java/${name}\"|" ${destroot}${prefix}/share/java/${name}/jython
    72         move ${destroot}${prefix}/share/java/${name}/jython ${destroot}${prefix}/bin/
    73     }
     81
     82    set bin_name    jython
     83
     84    destroot {}
    7485}
     86
    7587default_variants +installer
    7688
    77 livecheck.type  sourceforge
     89livecheck.type      regex
     90livecheck.url       ${homepage}downloads.html
     91livecheck.regex     "Jython (\\d+(?:\\.\\d+)*)"