Subject: [sup-talk] sup on opensolaris

From: [email-masked] (Tomas Carnecky)
Date: Thu, 30 Jul 2009 20:31:12 +0200

Kids, don't try this at home, it kills kittens! Well, not directly,  
but trying to get sup running will drive you so mad you will try to  
kill everything that moves. In other words: it doesn't work and the  
fact that I'm trying this on opensolaris doesn't make it any easier.

The biggest issue is that the ruby binary from the package manager is  
linked against the ancient solaris curses.so but ruby-ncurses needs  
ncurses.so (which, to make the issue even more complicated, is in /usr/ 
gnu/lib). When both libraries are liked into one application, they  
don't play along well (=segfaults). I had to compile ruby from source  
and make sure it's not liked with curses.so, and also patch ruby- 
ncurses slightly. I then managed to get sup to start up and read my  
mails. However, there is one issue left that I'm not able to fix:  
Ncurses.field.field_buffer() is returning garbage, and that makes is  
impossible to write mails, search and set tags etc. The problem is  
somewhere inside sup, as the ruby-ncurses example form2.rb is working  
just fine (maybe it has something to do with encoding/locale?).

I have an ugly patch for lib/sup/textfield.rb that uses its own string  
buffer instead of relying on field_buffer(). It's not perfect, but it  
at least allows me to write emails and assign tags.

Other issues:
  - strftime("%P") is a GNU extension, I work around this by using  
strftime("%p").downcase.
  - Iconv.iconv(target + "//IGNORE", charset, text + " ") <- the "// 
IGNORE" is causing an InvalidEncoding exception, removing it didn't  
seem to cause any regressions

tom

---

From: [email-masked] (William Morgan)
Date: Fri, 31 Jul 2009 08:56:52 -0700

Hi Tom,

Thanks for the report! It's nice to have another system "supported", at
least technically.

Reformatted excerpts from Tomas Carnecky's message of 2009-07-30:
> However, there is one issue left that I'm not able to fix:

The ncurses field stuff is some hellish bullshit that I hate with all my
heart. It may very well be a locale problem... I really don't want to
debug it.

> at least allows me to write emails and assign tags.

If it's not too much work to clean up, I'd be interested in this patch.
The field buffer stuff is broken in weird ways anyways (the history
never seems to be quite right), and anything that reduces the reliance
on ncurses is always the right approach.

>   - strftime("%P") is a GNU extension, I work around this by using  

Submit a patch! I'm fine with this.

> seem to cause any regressions

Hm, this is a trickier one. Allegedly the //IGNORE reduces the
exceptions thrown by Iconv, but since we're catching them all anyways,
we might be able to get away with removing this. Or we could
special-case it to your arch.
-- 
William <wmorgan-sup at masanjin.net>

---

From: [email-masked] (Ben Walton)
Date: Fri, 31 Jul 2009 12:59:16 -0400

> Thanks for the report! It's nice to have another system "supported", at

I'm the ruby maintainer for OpenCSW, which provides binary packages
for solaris 8+ linked against a modern curses.  Everything lives in
/opt/csw/, so it's self contained except where linking to system
stuff.

I _think_ this should all work on opensolaris (but I don't use it) if
you're interested in trying it.  That won't help things like %P (%z is
another common offender I come across), but it may make part of your
life easier.

You'll get a modern libiconv too, although the version in opensolaris
shouldn't be that old?

http://www.opencsw.org/

HTH
-Ben
-- 
Ben Walton
Systems Programmer - CHASS
University of Toronto
C:416.407.5610 | W:416.978.4302

GPG Key Id: 8E89F6D2; Key Server: pgp.mit.edu
Contact me to arrange for a CAcert assurance meeting.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://rubyforge.org/pipermail/sup-talk/attachments/20090731/84805c4a/attachment.bin>