Help porting GNU TeXmacs

Hi all,
I’m attempting a port of GNU TeXmacs www.texmacs.org to Haiku. Most of the source seems to compile fine. The biggest dependencies are Qt (currently we are using Qt4 but it should work also with Qt5) and guile. This last is where i’m currently stuck: we need guile 1.6.8 or a guile 1.8, newer guiles are not compatible with TeXmacs. I’m unable to successfully compile either 1.6.8 or any 1.8.x for various different reasons. I’m trying to use the modifications in the current port of guile 2.2 (minor tweaks). Could somebody have a look and tell me how to build guile 1.8.8 (or 1.6.8) on Haiku? Thanks a lot!

Small update. By tweaking a bit the guile-1.8.8 build process I managed to have TeXmacs starting up. It crashes as soon as I try to do some complex operation but seems to work in a limited way. It would be still useful to understand how to build a proper guile-1.8.8, so help is still appreciated.

Screenshot:

VirtualBox_Haiku_05_03_2020_10_01_15

5 Likes

More progress: with various tweaks TeXmacs now work, both with Qt4 and Qt5, using guile-1.8.8. Screenshot:

VirtualBox_Haiku_05_03_2020_11_45_15

Unless I set the environment variable LC_ALL=C the program crash with an error in locale::facet::_S_create_c_locale. I can reproduce the problem with a simple C++ program

#include <iostream>
#include <locale>

int main()
{
  std::locale loc("");
  std::cout << loc.name() << std::endl;
  return 0;
}

which looks quite fine to me but which produce the same error running on Haiku. Is this normal? What is the proper way to get the user locale?

Please attach your program to a bugreport at https://dev.haiku-os.org. Looks like you have found a bug in Haiku!

The native way to get the Locale woudl be using the LocaleRoster class: https://www.haiku-os.org/docs/api/classBLocaleRoster.html
But the C++ standard APIs should be made to work as well.

Ok. I will. As far as I can understand from the stdc++ library (I’m not an expert), my code should be correct, see e.g.

http://www.cplusplus.com/reference/locale/locale/locale/

It could also be related to the following bug fix for compilation of gcc:

If you are using Qt, why not just use QLocale::system()?

This only affects one build script, not Haiku itself, so it’s unlikely to be the cause of the problem.

TeXmacs depends on Qt only for the UI backend part, we would like to keep this dependence as localised as possible (we have also an X11 backend and in the future I would like to have a Cocoa backend, and why not one for Haiku). In particular in the point I need the function, is only matter to save whatever locale the user set up. Anyway I agree that there could be other approaches to write the code which causes problems.

Looking around however I found that the C++ snipped I posted above is quite common, so I’m surprised the problem do not pop up with other programs.

I was meaning that the reason that build recipe requires LC_ALL=POSIX could be related to the bug I was experiencing. Also TeXmacs works fine if LC_ALL is set to some value. It crashes only when LC_ALL is unset which seems to be the default for Haiku. But, of course, this is only an hypothesis.