[libvoikko] No OSX support in libvoikko.py?

Sjur Moshagen sjurnm at mac.com
Thu Jan 7 16:30:31 EET 2016


I am trying to build LO-voikko using the newest codebase in master (ie the 5.0 release), and noticed the following codeblock:

class Voikko(object):
	def __getLib():
		if os.name == 'nt':
			fileName = "libvoikko-1.dll"
		else:
			fileName = "libvoikko.so.1"
		if Voikko._sharedLibrarySearchPath is not None:
			try:
				return CDLL(Voikko._sharedLibrarySearchPath + os.sep + fileName)
			except:
				pass
		return CDLL(fileName)
	__getLib = staticmethod(__getLib)

AFAICS, there is no support for OSX in there, as the filename suffix for dynamic libraries on OSX is .dylib. Would the following code be working?

class Voikko(object):
	def __getLib():
		if os.name == 'nt':
			fileName = "libvoikko-1.dll"
		elif sys.platform == 'darwin':
			fileName = "libvoikko.1.dylib"
		else:
			fileName = "libvoikko.so.1"
		if Voikko._sharedLibrarySearchPath is not None:
			try:
				return CDLL(Voikko._sharedLibrarySearchPath + os.sep + fileName)
			except:
				pass
		return CDLL(fileName)
	__getLib = staticmethod(__getLib)

Also, since this is all using a dynamic library, should I also include dynamic libraries for all dependencies, like:

libarchive.14.dylib
libhfstospell.4.dylib
libtinyxml2.2.2.0.dylib

?

Or should these be statically linked to libvoikko?

Sjur



More information about the Libvoikko mailing list