1 | # $Id: Portfile 57864 2009-09-17 19:38:15Z blb@macports.org $ |
---|
2 | |
---|
3 | PortSystem 1.0 |
---|
4 | PortGroup ruby 1.0 |
---|
5 | set myname ncurses-ruby |
---|
6 | ruby.setup ${myname} 1.2.3 fetch |
---|
7 | revision 1 |
---|
8 | categories-append devel |
---|
9 | maintainers nomaintainer |
---|
10 | description Ruby access to ncurses functionality |
---|
11 | long_description \ |
---|
12 | ncurses-ruby is an extension module that makes the functions and \ |
---|
13 | constants of the FSF's ncurses library accessible from the ruby \ |
---|
14 | programming language |
---|
15 | |
---|
16 | platforms darwin |
---|
17 | |
---|
18 | homepage http://developer.berlios.de/projects/ncurses-ruby |
---|
19 | master_sites http://download.berlios.de/${myname}/ \ |
---|
20 | http://download2.berlios.de/${myname}/ |
---|
21 | distname ${myname}-${version} |
---|
22 | use_bzip2 yes |
---|
23 | |
---|
24 | checksums md5 e00bc593fc0dbc6e311e3b6836bb5801 \ |
---|
25 | sha1 156e6e663fc3ecae9b48da8e1227427e583c489a \ |
---|
26 | rmd160 daad8a5044238755c1e79fc2c327e7dfe219733e |
---|
27 | |
---|
28 | depends_lib-append port:ncurses port:rb-rubygems |
---|
29 | |
---|
30 | patchfiles patch-extconf.rb |
---|
31 | |
---|
32 | # Do a fake gem-like install by first generating a gem, then install it |
---|
33 | |
---|
34 | # Use gemspec from pkgsrc |
---|
35 | # http://cvsweb.netbsd.org/bsdweb.cgi/pkgsrc/devel/ruby-ncurses/files/gemspec |
---|
36 | post-extract { |
---|
37 | copy ${filespath}/${myname}.gemspec ${worksrcpath} |
---|
38 | } |
---|
39 | |
---|
40 | use_configure no |
---|
41 | |
---|
42 | build { |
---|
43 | system "cd ${worksrcpath} && ${ruby.gem} build ${myname}.gemspec" |
---|
44 | } |
---|
45 | |
---|
46 | destroot { |
---|
47 | # This is basically just copied from the ruby portgroup, with a |
---|
48 | # change to the gem location since we just built it |
---|
49 | xinstall -d -m 0755 ${destroot}${prefix}/lib/ruby/gems/${ruby.version} |
---|
50 | system "cd ${worksrcpath} && ${ruby.gem} install --local --force --install-dir ${destroot}${prefix}/lib/ruby/gems/${ruby.version} ${worksrcpath}/ncurses-${version}.gem" |
---|
51 | set binDir ${destroot}${prefix}/lib/ruby/gems/${ruby.version}/bin |
---|
52 | if {[file isdirectory $binDir]} { |
---|
53 | foreach file [readdir $binDir] { |
---|
54 | file copy [file join $binDir $file] ${destroot}${prefix}/bin |
---|
55 | } |
---|
56 | } |
---|
57 | # symlink to the vendor location so software expecting a non-gem |
---|
58 | # install can still find it |
---|
59 | set rubyarch [exec ${prefix}/bin/ruby -rrbconfig -e "puts Config::CONFIG\['sitearch'\]"] |
---|
60 | file mkdir ${destroot}${ruby.lib}/${rubyarch} |
---|
61 | set ruby.gemdir ${prefix}/lib/ruby/gems/${ruby.version}/gems |
---|
62 | ln -s ${ruby.gemdir}/ncurses-${version}/lib/ncurses.rb ${destroot}${ruby.lib} |
---|
63 | ln -s ${ruby.gemdir}/ncurses-${version}/lib/ncurses_bin.bundle \ |
---|
64 | ${destroot}${ruby.lib}/${rubyarch} |
---|
65 | } |
---|
66 | |
---|