Ticket #15170: Portfile

File Portfile, 2.4 KB (added by ameingast@…, 17 years ago)

JRuby-1.1.1 Portfile

Line 
1# $Id: Portfile 34697 2008-03-03 07:36:29Z afb@macports.org $
2
3PortSystem 1.0
4
5name              jruby
6version           1.1.1
7
8categories        lang ruby
9maintainers       ameingast@gmail.com
10platforms         darwin
11
12description       JRuby is an 100% pure-Java implementation of the Ruby \
13                  programming language.
14long_description  JRuby provides a complete set of core "builtin" classes \
15                  and syntax for the Ruby language, as well as most of the \
16                  Ruby Standard Libraries. The standard libraries are mostly \
17                  Ruby's own complement of .rb files, but a few that depend \
18                  on C language-based extensions have been reimplemented.
19homepage          http://jruby.codehaus.org/
20
21master_sites      http://dist.codehaus.org/jruby/
22distname          ${name}-src-${version}
23worksrcdir        ${name}-${version}
24use_bzip2         no
25checksums         md5 94ce5370ada712d2190666bacc6fae21
26
27depends_build     bin:ant:apache-ant
28depends_lib       bin:java:kaffe
29
30use_configure     no
31universal_variant no
32
33build.cmd         ant
34build.target      jar
35
36variant apidocs description "include API documentation" {
37  build.target  jar create-apidocs
38}
39
40variant default_ruby description "build without j prefix" {
41
42}
43
44destroot {
45    # Create the target java directory exists
46    xinstall -m 755 -d ${destroot}${prefix}/share/java/${name}
47
48    # Copy over the needed elements of our directory tree
49    file copy \
50        ${worksrcpath}/bin \
51        ${worksrcpath}/lib \
52        ${destroot}${prefix}/share/java/${name}
53
54    if { [variant_isset apidocs] } {
55      file copy ${worksrcpath}/docs ${destroot}${prefix}/share/java/${name}
56    }
57
58    # Remove extraneous bat files
59    foreach f [glob -directory ${destroot}${prefix}/share/java/${name}/bin *.bat] {
60      file delete $f
61  }
62
63  set jruby_prefix ""
64
65  if { ![variant_isset default_ruby] } {
66    set jruby_prefix "j"
67  }
68
69    foreach f { jruby jirb jrubyc jrubcli jrubysrv } {
70      regsub {^j} $f $jruby_prefix dest
71      if { ${dest} != ${f} } {
72      ln -s ${prefix}/share/java/${name}/bin/${f} ${destroot}${prefix}/bin/${dest}
73    }
74    ln -s ${prefix}/share/java/${name}/bin/${f} ${destroot}${prefix}/bin/
75  }
76
77  foreach f { gem gem_mirror gemri gemwhich rake spec testrb } {
78    ln -s ${prefix}/share/java/${name}/bin/${f} \
79          ${destroot}${prefix}/bin/${jruby_prefix}${f}
80  }
81}