Skip to content

Instantly share code, notes, and snippets.

@rkumar
Created August 24, 2010 08:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rkumar/547220 to your computer and use it in GitHub Desktop.
Save rkumar/547220 to your computer and use it in GitHub Desktop.
gemspec to create ncurses 1.2.4 gem
require "rubygems"
PLUGIN = "ncurses"
NAME = "ncurses"
VERSION = "1.2.4"
AUTHOR = "Tobias Peters"
EMAIL = "t-peters@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
# adapted by rkumar for ruby 1.9.2 ncurses (rbcurse widget library)
# save this file as ncurses.gemspec in same folder
# sudo gem build ncurses.gemspec
# sudo gem install --local ncurses-1.2.4.gem
@rkumar
Copy link
Author

rkumar commented Aug 24, 2010

In order to successfully compile on OS X Snow Leopard, please replace existing CFLAGS line with this (in extconf.rb):

$CFLAGS += ” -g -DNCURSES_OPAQUE=0″

Then run:
ruby ./extconf.rb
make
make install
gem build ncurses124.gemspec
gem install --local ncurses-1.2.4.gem

go to examples folder and run:

ruby examples.rb
ruby hello_ncurses.rb

Thanks to Ralf Papenkordt for this help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment