eclubb / ncurses-ruby Goto Github PK
View Code? Open in Web Editor NEWA Ruby module for accessing the ncurses library
Home Page: https://github.com/eclubb/ncurses-ruby
License: Other
A Ruby module for accessing the ncurses library
Home Page: https://github.com/eclubb/ncurses-ruby
License: Other
Heyo.
I'm the owner of the ncurses gem on RubyGems. That's only because at the time it was only available from berlios.de, and I wanted to get it into the main gem source. This seems to be where the current development is happening. @eclubb, can I hand you the keys?
Hi, I'm one of the contributors of sup project and we're just sorting things out to bring sup back to life.
We have this problem that:
libncursesw.so
, which means no wide-char support.Point is, this repository on Github seems the most maintained and emails to the original maintainer just got bounced with a "no such address". So I'm just asking the question here: may I have a ncurses - ruby binding that:
gem i
installable<internal:/Users/ba/.local/share/chruby/rubies/ruby-3.1.2/lib/ruby/site_ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:85:in `require': dlopen(/Users/ba/.local/share/chruby/gems/ruby/3.1.2/gems/ncurses-ruby-1.2.5/lib/ncurses.bundle, 0x0009): symbol not found in flat namespace (_current_item) - /Users/ba/.local/share/chruby/gems/ruby/3.1.2/gems/ncurses-ruby-1.2.5/lib/ncurses.bundle (LoadError)
from <internal:/Users/ba/.local/share/chruby/rubies/ruby-3.1.2/lib/ruby/site_ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
from /Users/ba/.local/share/chruby/gems/ruby/3.1.2/gems/ncurses-ruby-1.2.5/lib/ncurses.rb:22:in `<top (required)>'
from <internal:/Users/ba/.local/share/chruby/rubies/ruby-3.1.2/lib/ruby/site_ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:160:in `require'
from <internal:/Users/ba/.local/share/chruby/rubies/ruby-3.1.2/lib/ruby/site_ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:160:in `rescue in require'
from <internal:/Users/ba/.local/share/chruby/rubies/ruby-3.1.2/lib/ruby/site_ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:149:in `require'
from test_scanw.rb:12:in `<main>'
<internal:/Users/ba/.local/share/chruby/rubies/ruby-3.1.2/lib/ruby/site_ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:85:in `require': cannot load such file -- ncurses (LoadError)
from <internal:/Users/ba/.local/share/chruby/rubies/ruby-3.1.2/lib/ruby/site_ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
from test_scanw.rb:12:in `<main>'
When I attempt to install ncurses-ruby
in a ruby:2.4-alpine
Docker container there is a compilation error.
See the following Python issues which report similar problem and a solution.
$ docker run ruby:2.4-alpine sh -c "apk --update add build-base ruby-dev ncurses-dev && gem install ncurses-ruby"
...
Building native extensions. This could take a while...
ERROR: Error installing ncurses-ruby:
ERROR: Failed to build gem native extension.
current directory: /usr/local/bundle/gems/ncurses-ruby-1.2.4/ext/ncurses
/usr/local/bin/ruby -r ./siteconf20170625-10-1wvefbh.rb extconf.rb
checking for unistd.h... yes
checking for ncurses.h... yes
checking for wmove() in -lncurses... yes
checking for newscr()... yes
checking for TABSIZE()... yes
checking for ESCDELAY()... yes
checking for keybound()... yes
checking for curses_version()... yes
checking for tigetstr()... yes
checking for getwin()... yes
checking for putwin()... yes
checking for ungetmouse()... yes
checking for mousemask()... yes
checking for wenclose()... yes
checking for mouseinterval()... yes
checking for wmouse_trafo()... yes
checking for mcprint()... yes
checking for has_key()... yes
checking for delscreen()... yes
checking for define_key()... yes
checking for keyok()... yes
checking for resizeterm()... yes
checking for use_default_colors()... yes
checking for use_extended_names()... yes
checking for wresize()... yes
checking for attr_on()... yes
checking for attr_off()... yes
checking for attr_set()... yes
checking for chgat()... yes
checking for color_set()... yes
checking for filter()... yes
checking for intrflush()... yes
checking for mvchgat()... yes
checking for mvhline()... yes
checking for mvvline()... yes
checking for mvwchgat()... yes
checking for mvwhline()... yes
checking for mvwvline()... yes
checking for noqiflush()... yes
checking for putp()... yes
checking for qiflush()... yes
checking for scr_dump()... yes
checking for scr_init()... yes
checking for scr_restore()... yes
checking for scr_set()... yes
checking for slk_attr_off()... yes
checking for slk_attr_on()... yes
checking for slk_attr()... yes
checking for slk_attr_set()... yes
checking for slk_color()... yes
checking for tigetflag()... yes
checking for tigetnum()... yes
checking for use_env()... yes
checking for vidattr()... yes
checking for vid_attr()... yes
checking for wattr_on()... yes
checking for wattr_off()... yes
checking for wattr_set()... yes
checking for wchgat()... yes
checking for wcolor_set()... yes
checking for getattrs()... yes
checking which debugging functions to wrap...
checking for _tracef()... no
checking for _tracedump()... no
checking for _nc_tracebits()... no
checking for _traceattr()... no
checking for _traceattr2()... no
checking for _tracechar()... no
checking for _tracechtype()... no
checking for _tracechtype2()... no
checking for _tracemouse()... no
checking for other functions that appeared after ncurses version 5.0...
checking for assume_default_colors()... yes
checking for attr_get()... yes
checking for the panel library...
checking for panel.h... yes
checking for panel_hidden() in -lpanel... yes
checking for the form library...
checking for form.h... yes
checking for new_form() in -lform... yes
checking for the menu library...
checking for menu.h... yes
checking for new_menu() in -lmenu... yes
creating Makefile
current directory: /usr/local/bundle/gems/ncurses-ruby-1.2.4/ext/ncurses
make "DESTDIR=" clean
current directory: /usr/local/bundle/gems/ncurses-ruby-1.2.4/ext/ncurses
make "DESTDIR="
compiling form_wrap.c
In file included from /usr/include/fortify/stdio.h:23:0,
from /usr/include/curses.h:164,
from /usr/include/form.h:39,
from form_wrap.h:26,
from form_wrap.c:30:
/usr/include/fortify/string.h:142:1: error: 'mempcpy' undeclared here (not in a function)
_FORTIFY_FN(mempcpy) void *mempcpy(void *__d, const void *__s, size_t __n)
^
In file included from /usr/local/include/ruby-2.4.0/ruby/defines.h:120:0,
from /usr/local/include/ruby-2.4.0/ruby/ruby.h:36,
from /usr/local/include/ruby-2.4.0/ruby.h:33,
from form_wrap.h:27,
from form_wrap.c:30:
/usr/include/fortify/string.h: In function 'mempcpy':
/usr/include/fortify/string.h:149:9: error: called object '__orig_mempcpy' is not a function or function pointer
return __orig_mempcpy(__d, __s, __n);
^
In file included from /usr/include/fortify/stdio.h:23:0,
from /usr/include/curses.h:164,
from /usr/include/form.h:39,
from form_wrap.h:26,
from form_wrap.c:30:
/usr/include/fortify/string.h:142:1: note: declared here
_FORTIFY_FN(mempcpy) void *mempcpy(void *__d, const void *__s, size_t __n)
^
form_wrap.c: At top level:
cc1: warning: unrecognized command line option '-Wno-self-assign'
cc1: warning: unrecognized command line option '-Wno-constant-logical-operand'
cc1: warning: unrecognized command line option '-Wno-parentheses-equality'
cc1: warning: unrecognized command line option '-Wno-tautological-compare'
Makefile:241: recipe for target 'form_wrap.o' failed
make: *** [form_wrap.o] Error 1
make failed, exit code 2
Gem files will remain installed in /usr/local/bundle/gems/ncurses-ruby-1.2.4 for inspection.
Results logged to /usr/local/bundle/extensions/x86_64-linux/2.4.0/ncurses-ruby-1.2.4/gem_make.out
$ make
compiling form_wrap.c
In file included from form_wrap.c:31:
ncurses_wrap.h:76:1: warning: "NCURSES_OPAQUE" redefined
In file included from /usr/include/form.h:38,
from form_wrap.h:26,
from form_wrap.c:30:
/usr/include/curses.h:109:1: warning: this is the location of the previous definition
form_wrap.c: In function ‘make_arg’:
form_wrap.c:1133: warning: format not a string literal and no format arguments
compiling menu_wrap.c
In file included from menu_wrap.c:27:
ncurses_wrap.h:76:1: warning: "NCURSES_OPAQUE" redefined
In file included from /usr/include/menu.h:42,
from menu_wrap.h:27,
from menu_wrap.c:26:
/usr/include/curses.h:109:1: warning: this is the location of the previous definition
compiling ncurses_wrap.c
ncurses_wrap.c: In function ‘rbncurshelper_nonblocking_wgetch’:
ncurses_wrap.c:807: error: variable ‘tz’ has initializer but incomplete type
ncurses_wrap.c:807: warning: excess elements in struct initializer
ncurses_wrap.c:807: warning: (near initialization for ‘tz’)
ncurses_wrap.c:807: warning: excess elements in struct initializer
ncurses_wrap.c:807: warning: (near initialization for ‘tz’)
ncurses_wrap.c:807: error: storage size of ‘tz’ isn’t known
ncurses_wrap.c:831: warning: ‘rb_thread_select’ is deprecated (declared at /Users/nixpulvis/.rbenv/versions/2.0.0-p195/include/ruby-2.0.0/ruby/intern.h:412)
make: *** [ncurses_wrap.o] Error 1
Code was cloned from here on Github with 074ab54 as HEAD.
Hi All,
Thanks for a great library. I'm writing a console for a tool of mine that runs on high performance computers. I've built ncurses 5 and ruby 2.1.5 using the GCC. Installing ncurses-ruby with gem runs fine. Unfortunately when I try the rain.rb
example I get a segfault with the stack trace below. There seems to be a problem with getc
[BUG] Segmentation fault at 0x000000d
e6aaf98
ruby 2.1.0p0 (2013-12-25 revision 44422) [x86_64-linux]
-- Control frame information -----------------------------------------------
c:0003 p:---- s:0009 e:000008 CFUNC :getch
c:0002 p:0274 s:0006 E:000138 EVAL /home1/02582/highcock/work/ToolsNew/lib/ruby/gems/2.1.0/gems/ncurses-ruby-1.2.4/examples/rain.rb:200 [
FINISH]
c:0001 p:0000 s:0002 E:000fd8 TOP [FINISH]
/home1/02582/highcock/work/ToolsNew/lib/ruby/gems/2.1.0/gems/ncurses-ruby-1.2.4/examples/rain.rb:200:in `<main>'
/home1/02582/highcock/work/ToolsNew/lib/ruby/gems/2.1.0/gems/ncurses-ruby-1.2.4/examples/rain.rb:200:in `getch'
-- C level backtrace information -------------------------------------------
ruby(+0x171a6a) [0x2b92d6478a6a]
ruby(+0x171b45) [0x2b92d6478b45]
ruby(+0x1cab4e) [0x2b92d64d1b4e]
ruby(rb_bug+0x108) [0x2b92d64d1cf5]
ruby(+0xea6ee) [0x2b92d63f16ee]
/lib64/libpthread.so.0(+0x300100f7e0) [0x2b92d69ff7e0]
/home1/02582/highcock/work/ToolsNew/lib/libncurses.so.5(is_wintouched+0x13) [0x2b92defccca3]
/home1/02582/highcock/work/ToolsNew/lib/libncurses.so.5(wgetnstr+0xa9) [0x2b92defc5d59] ncurses_wrap.c:2324
/home1/02582/highcock/work/ToolsNew/lib/libncurses.so.5(_nc_wgetch+0x96c) [0x2b92defc5a9c] ncurses_wrap.c:2288
/home1/02582/highcock/work/ToolsNew/lib/libncurses.so.5(wgetch+0x27) [0x2b92defc5bb7] ncurses_wrap.c:2304
/home1/02582/highcock/work/ToolsNew/lib/ruby/gems/2.1.0/extensions/x86_64-linux/2.1.0-static/ncurses-ruby-1.2.4/ncurses.so(+0x10b1b) [0x2b9
2de779b1b] ncurses_wrap.c:817
/home1/02582/highcock/work/ToolsNew/lib/ruby/gems/2.1.0/extensions/x86_64-linux/2.1.0-static/ncurses-ruby-1.2.4/ncurses.so(+0x10b63) [0x2b9
2de779b63] ncurses_wrap.c:839
ruby(+0x1580dd) [0x2b92d645f0dd]
ruby(+0x158cbd) [0x2b92d645fcbd]
ruby(+0x158dfd) [0x2b92d645fdfd]
ruby(+0x159976) [0x2b92d6460976]
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.