Ticket #20552: Portfile

File Portfile, 2.6 KB (added by rick@…, 15 years ago)

Portfile for adding nailgun variant

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