[53457] trunk/dports/ruby/rb-ncurses-ruby

blb at macports.org blb at macports.org
Mon Jul 6 02:03:36 PDT 2009


Revision: 53457
          http://trac.macports.org/changeset/53457
Author:   blb at macports.org
Date:     2009-07-06 02:03:36 -0700 (Mon, 06 Jul 2009)
Log Message:
-----------
ruby/rb-ncurses-ruby - modify install to be a gem-based one (built manually) with symlinks to the older location; this lets programs using gem or basic require find it

Modified Paths:
--------------
    trunk/dports/ruby/rb-ncurses-ruby/Portfile

Added Paths:
-----------
    trunk/dports/ruby/rb-ncurses-ruby/files/
    trunk/dports/ruby/rb-ncurses-ruby/files/ncurses-ruby.gemspec

Modified: trunk/dports/ruby/rb-ncurses-ruby/Portfile
===================================================================
--- trunk/dports/ruby/rb-ncurses-ruby/Portfile	2009-07-06 08:53:06 UTC (rev 53456)
+++ trunk/dports/ruby/rb-ncurses-ruby/Portfile	2009-07-06 09:03:36 UTC (rev 53457)
@@ -3,7 +3,8 @@
 PortSystem          1.0
 PortGroup           ruby 1.0
 set myname          ncurses-ruby
-ruby.setup          ${myname} 1.2.3 extconf.rb {COPYING Changes README TODO}
+ruby.setup          ${myname} 1.2.3 fetch
+revision            1
 categories-append   devel
 maintainers         nomaintainer
 description         Ruby access to ncurses functionality
@@ -24,5 +25,40 @@
                     sha1    156e6e663fc3ecae9b48da8e1227427e583c489a \
                     rmd160  daad8a5044238755c1e79fc2c327e7dfe219733e
 
-depends_lib-append  port:ncurses
+depends_lib-append  port:ncurses port:rb-rubygems
 
+# Do a fake gem-like install by first generating a gem, then install it
+
+# Use gemspec from pkgsrc
+# http://cvsweb.netbsd.org/bsdweb.cgi/pkgsrc/devel/ruby-ncurses/files/gemspec
+post-extract {
+   copy ${filespath}/${myname}.gemspec ${worksrcpath}
+}
+
+use_configure       no
+
+build {
+   system "cd ${worksrcpath} && ${ruby.gem} build ${myname}.gemspec"
+}
+
+destroot {
+   # This is basically just copied from the ruby portgroup, with a 
+   # change to the gem location since we just built it
+   xinstall -d -m 0755 ${destroot}${prefix}/lib/ruby/gems/${ruby.version}
+   system "cd ${worksrcpath} && ${ruby.gem} install --local --force --install-dir ${destroot}${prefix}/lib/ruby/gems/${ruby.version} ${worksrcpath}/ncurses-${version}.gem"
+   set binDir ${destroot}${prefix}/lib/ruby/gems/${ruby.version}/bin
+   if {[file isdirectory $binDir]} {
+      foreach file [readdir $binDir] {
+         file copy [file join $binDir $file] ${destroot}${prefix}/bin
+      }
+   }
+   # symlink to the vendor location so software expecting a non-gem
+   # install can still find it
+   set rubyarch [exec /mp/bin/ruby -rrbconfig -e "puts Config::CONFIG\['sitearch'\]"]
+   file mkdir ${destroot}${ruby.lib}/${rubyarch}
+   set ruby.gemdir ${prefix}/lib/ruby/gems/${ruby.version}/gems
+   ln -s ${ruby.gemdir}/ncurses-${version}/lib/ncurses.rb ${destroot}${ruby.lib}
+   ln -s ${ruby.gemdir}/ncurses-${version}/lib/ncurses_bin.bundle \
+      ${destroot}${ruby.lib}/${rubyarch}
+}
+

Added: trunk/dports/ruby/rb-ncurses-ruby/files/ncurses-ruby.gemspec
===================================================================
--- trunk/dports/ruby/rb-ncurses-ruby/files/ncurses-ruby.gemspec	                        (rev 0)
+++ trunk/dports/ruby/rb-ncurses-ruby/files/ncurses-ruby.gemspec	2009-07-06 09:03:36 UTC (rev 53457)
@@ -0,0 +1,25 @@
+require "rubygems"
+
+PLUGIN   = "ncurses"
+NAME     = "ncurses"
+VERSION  = "1.2.3"
+AUTHOR   = "Tobias Peters"
+EMAIL    = "t-peters at users.berlios.de"
+HOMEPAGE = "http://ncurses-ruby.berlios.de/"
+SUMMARY  = "This wrapper provides access to the functions, macros, global variables and constants of the ncurses library.  These are mapped to a Ruby Module named \"Ncurses\":  Functions and external variables are implemented as singleton functions of the Module Ncurses."
+
+spec = Gem::Specification.new do |s|
+  s.name          = NAME
+  s.email         = EMAIL
+  s.author        = AUTHOR
+  s.version       = VERSION
+  s.summary       = SUMMARY
+  s.platform      = Gem::Platform::RUBY
+  s.has_rdoc      = false
+  s.homepage      = HOMEPAGE
+  s.description   = SUMMARY
+  s.autorequire   = PLUGIN
+  s.require_paths = ["lib"]
+  s.files = Dir.glob("[A-Z]*") + Dir.glob("*.{c,h,rb}") + Dir.glob("{examples,lib}/**/*")
+  s.extensions    = "extconf.rb"
+end
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20090706/8b60f3a9/attachment.html>


More information about the macports-changes mailing list