Code Monkey home page Code Monkey logo

ncurses-ruby's People

Contributors

crowell avatar eclubb avatar elliottcable avatar jeremyevans avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ncurses-ruby's Issues

eclubb (or another actual maintainer) should own the gem

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?

Can haz recent release w/ wide-char support on rubygems.org?

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:

  • ncursesw 1.2.4.3 doesn't install on Ruby 1.8
  • ncurses-ruby 1.2.1 does install on Ruby 1.8. But it doesn't link to libncursesw.so, which means no wide-char support.
  • The old repository of ncurses-ruby does have a 1.3.1 release(highest version of all) here saying that it does link against libncursesw since 1.3.0. It's not released on rubygems.org but some Linux distros(including Archlinux, Ubuntu and Fedora) actually use this release as the canonical ruby-ncurses binding library.

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:

  • releases on rubygems.org thus is gem i installable
  • supports wide-char
  • installs nicely without the error here: sup-heliotrope/sup#18

How to install?

git clone https://github.com/eclubb/ncurses-ruby.git
cd ncurses-ruby/
ls
COPYING         THANKS          lib
Changelog.md        TODO            ncurses-ruby.gemspec
LICENSE.txt     examples
README.md       ext
gem ncurses-ruby.gemspec

image

Thanks !

All examples fail with `symbol not found in flat namespace (_current_item)`

<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>'

Compilation error on Alpine Linux

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

Error while compiling on OSX 10.8.4 with Ruby 2.0-p195

$ 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.

Segfault with ncurses 5, rain example

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]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.