Pistos / diakonos

Diakonos is a console text editor for the masses.
https://git.sr.ht/~pistos/diakonos
Other
137 stars 11 forks source link

Debian install fails #94

Closed xtronics closed 1 month ago

xtronics commented 1 month ago

Did


# apt-get install libncurses5-dev ruby-dev ruby-curses
# gem install diakonos

I get 

Building native extensions. This could take a while...
ERROR:  Error installing diakonos:
        ERROR: Failed to build gem native extension.

    current directory: /var/lib/gems/3.1.0/gems/curses-1.4.5/ext/curses
/usr/bin/ruby3.1 -I /usr/lib/ruby/vendor_ruby -r ./siteconf20240913-3445-6mfm7l.rb extconf.rb
checking for tgetent() in -ltinfow... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Looking at mkmf.log 
# cat /var/lib/gems/3.1.0/extensions/x86_64-linux/3.1.0/curses-1.4.5/mkmf.log
LD_LIBRARY_PATH=.:/usr/lib/x86_64-linux-gnu "x86_64-linux-gnu-gcc -o conftest -I/usr/include/x86_64-linux-gnu/ruby-3.1.0 -I/usr/include/ruby-3.1.0/ruby/backward -I/usr/include/ruby-3.1.0 -I. -Wdate-time -D_FORTIFY_SOURCE=2   -g -O2 -ffile-prefix-map=BUILDDIR=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC conftest.c  -L. -L/usr/lib/x86_64-linux-gnu -L. -Wl,-z,relro -Wl,-z,now -fstack-protector-strong -rdynamic -Wl,-export-dynamic -Wl,--no-as-needed     -lruby-3.1  -lm  -lc"
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: int main(int argc, char **argv)
4: {
5:   return !!argv[argc];
6: }
/* end */

This is on a new install of Debian 12 (bookworm)

Pistos commented 1 month ago

It sort of doesn't make sense that it tries to build native extensions, because that would be for the curses gem. if apt-get install ruby-curses already succeeded, then the curses gem should be installed already, and gem install diakonos should not try to build curses. Perhaps the local shell is not finding the Debian-installed curses gem.

Pistos commented 1 month ago

Also: check what version of the curses gem apt-get installed. The latest public version of Diakonos depends on curses gem 1.4.5, though the latest curses gem version is 1.4.6.

Pistos commented 1 month ago

See also the curses gem rdocs which describe the switches --use-system-libraries and --with-ncurses-dir= which may help here.

xtronics commented 1 month ago

This is Debian 12 (current stable - bookworm) ruby-curses 1.4.4-1+b2

Tried loading the ruby-curses from testing - it would break a large number of other dependencies - I'm looking at simply copying from a different computer - an older version out of /usr/local/bin/diakonos - probably need /etc/diakonos as well?

(this didn't work.... )

Or is there a way to get gem to request an older version of diakonos?

Pistos commented 1 month ago

You can specify a version with gem install [...], but, the better approach, I think, would be to use a Ruby manager like rvm or rbenv with your local user. Then, when you gem install diakonos, it will pull in the dependency gem locally with the Ruby manager, and not affect the system-wide Debian dependency tree.

Would you be willing to try that?

xtronics commented 1 month ago

I got it to work with

$ gem search diakonos --all $ gem install diakonos -v 0.9.10

I can wait for Debian to catch up.. trixie .. mid 2025?

Pistos commented 1 month ago

Glad you got it working. Thanks for using Diakonos.