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

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

rb-ncurses-ruby: use correct ncurses headers (#21672)

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