silnrsi / libreoffice-linguistic-tools

LibreOffice Linguistic Tools for technical write-ups of lesser-known languages.
5 stars 2 forks source link

Linguistic Tools uses an old version of SIL Converters #23

Closed livingfield closed 1 week ago

livingfield commented 3 weeks ago

The Linguistic Tools' converter dialog does not allow selection of a Python 3 Script for conversion:

LinguisticTools

While the newer converter dialog found in the Bulk SFM converter tool that was installed with SIL Converters 5.2.6 on the same machine allows the selection of a Python 3 Script (and several more converter types).

BulkSFM

Is Linguistic Tools accessing an old SIL Converter instance used by Paratext?

jkornelsen commented 2 weeks ago

Where are the older and newer versions on your machine? The extension checks for a library known as the EC Driver in the following order, and uses the first one it finds.

/usr/local/encConverters/libecdriver.so
/usr/local/encConverters/libecdriver_64.so
/usr/encConverters/libecdriver.so
/usr/encConverters/libecdriver_64.so
/usr/local/fieldworks/libecdriver.so
/usr/local/fieldworks/libecdriver_64.so
/usr/fieldworks/libecdriver.so
/usr/fieldworks/libecdriver_64.so

If none of these are found, the extension tries to load libecdriver.so without a path, which should work if it is in the current directory, LD_LIBRARY_PATH or ldconfig.

If you want to change this for your machine and are up for a bit of hacking, unzip the .oxt file and modify pythonpath/lingt/access/sec_wrapper.py to hardcode the value of libfile. Then zip the file back up again and double-click to reinstall the extension into LibreOffice.

The EC Driver, in turn, loads the EncConverters application by embedding mono, and it should know where to look based on the LIBDIR flag when it was compiled, for example -‍DLIBDIR=/usr/lib/encConverters.

livingfield commented 2 weeks ago

There is only one copy of ECDriver.dll on this computer and it is in C:\Program Files\Common Files\SIL\ If Paratext 9.4 is installed after SIL Converters, then it overwrites ECDriver.dll with an older version.

If, however, I install SIL Converters 5.2.7 as an update ontop of the existing SIL Converters, then now Linguistic Tools displays the complete list as in the original post.

Confusingly, the Bulk SFM Converter always shows the complete list, even when Linguistic Tools shows the abbreviated list. While Paratext always shows the abbreviated list, even when SIL Converters are updated. It seems that neither the Bulk SFM Converter nor Paratext are sensitive to the install order, while the Linguistic Tools are.

jkornelsen commented 2 weeks ago

What you're describing sounds right. The Bulk SFM Converter is part of EncConverters already, so it doesn't need to go through the EC Driver to get inside. Naturally, it would show whatever update you've installed.

I don't think Paratext uses the EC Driver either. It bundles its own EncConverters build, so it would make sense that it keeps using the older version.

Both SEC and PT live in the .NET world, whereas LibreOffice does not. So, the LOLT extension requires the EC Driver to access through COM on Windows, or by embedding mono on other operating systems.

The paths I listed in the previous comment assumed you were on a Mac, which was my impression from your other issue post. On Windows, the extension searches for ECDriver.dll in the path (that is, environment variables). And C:\Program Files\Common Files\SIL\ is typically in the path.