source: trunk/dports/ruby/rb-ncurses-ruby/Portfile @ 93727

Last change on this file since 93727 was 93727, checked in by jmr@…, 8 years ago

rb-ncurses-ruby: license

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 2.6 KB
Line 
1# $Id: Portfile 93727 2012-05-29 03:56:55Z jmr@macports.org $
2
3PortSystem          1.0
4PortGroup           ruby 1.0
5
6set myname          ncurses-ruby
7ruby.setup          ${myname} 1.2.3 fetch
8revision            1
9categories-append   devel
10license             LGPL
11maintainers         nomaintainer
12description         Ruby access to ncurses functionality
13long_description \
14   ncurses-ruby is an extension module that makes the functions and \
15   constants of the FSF's ncurses library accessible from the ruby \
16   programming language
17
18platforms           darwin
19
20homepage            http://developer.berlios.de/projects/ncurses-ruby
21master_sites        http://download.berlios.de/${myname}/ \
22                    http://download2.berlios.de/${myname}/
23distname            ${myname}-${version}
24use_bzip2           yes
25
26checksums           md5     e00bc593fc0dbc6e311e3b6836bb5801 \
27                    sha1    156e6e663fc3ecae9b48da8e1227427e583c489a \
28                    rmd160  daad8a5044238755c1e79fc2c327e7dfe219733e
29
30depends_lib-append  port:ncurses port:rb-rubygems
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
36post-extract {
37   copy ${filespath}/${myname}.gemspec ${worksrcpath}
38}
39
40patchfiles          extconf.rb.diff
41
42use_configure       no
43
44build {
45   system "cd ${worksrcpath} && ${ruby.gem} build ${myname}.gemspec -- --with-ncurses-include=${prefix}/include/ncurses"
46}
47
48destroot {
49   # This is basically just copied from the ruby portgroup, with a
50   # change to the gem location since we just built it
51   xinstall -d -m 0755 ${destroot}${prefix}/lib/ruby/gems/${ruby.version}
52   system "cd ${worksrcpath} && ${ruby.gem} install --local --force --install-dir ${destroot}${prefix}/lib/ruby/gems/${ruby.version} ${worksrcpath}/ncurses-${version}.gem -- --with-ncurses-include=${prefix}/include/ncurses"
53   set binDir ${destroot}${prefix}/lib/ruby/gems/${ruby.version}/bin
54   if {[file isdirectory $binDir]} {
55      foreach file [readdir $binDir] {
56         file copy [file join $binDir $file] ${destroot}${prefix}/bin
57      }
58   }
59   # symlink to the vendor location so software expecting a non-gem
60   # install can still find it
61   set rubyarch [exec ${prefix}/bin/ruby -rrbconfig -e "puts Config::CONFIG\['sitearch'\]"]
62   file mkdir ${destroot}${ruby.lib}/${rubyarch}
63   set ruby.gemdir ${prefix}/lib/ruby/gems/${ruby.version}/gems
64   ln -s ${ruby.gemdir}/ncurses-${version}/lib/ncurses.rb ${destroot}${ruby.lib}
65   ln -s ${ruby.gemdir}/ncurses-${version}/lib/ncurses_bin.bundle \
66      ${destroot}${ruby.lib}/${rubyarch}
67}
Note: See TracBrowser for help on using the repository browser.