Aspell lib loading: use simple name for the lib and let the system work instead of trying to guess the path. Fixes problem with multi-arch aspell on Debian Jessie
This commit is contained in:
parent
13570505b1
commit
b11f66cb80
2 changed files with 22 additions and 32 deletions
|
@ -151,25 +151,8 @@ bool Aspell::init(string &reason)
|
|||
return false;
|
||||
}
|
||||
|
||||
// We first look for the aspell library in libdir, and also try to
|
||||
// be clever with ASPELL_PROG.
|
||||
vector<string> libdirs;
|
||||
libdirs.push_back(LIBDIR);
|
||||
// If not in the standard place, the aspell library has to live
|
||||
// under the same prefix as the aspell program.
|
||||
{
|
||||
string aspellPrefix = path_getfather(path_getfather(m_data->m_exec));
|
||||
// This would probably require some more tweaking on solaris/irix etc.
|
||||
string dir = sizeof(long) > 4 ? "lib64" : "lib";
|
||||
string libaspell = path_cat(aspellPrefix, dir);
|
||||
if (libaspell != LIBDIR)
|
||||
libdirs.push_back(libaspell);
|
||||
}
|
||||
|
||||
reason = "Could not open shared library ";
|
||||
for (vector<string>::iterator it = libdirs.begin();
|
||||
it != libdirs.end(); it++) {
|
||||
string libbase = path_cat(*it, "libaspell");
|
||||
string libbase("libaspell");
|
||||
string lib;
|
||||
for (unsigned int i = 0; i < nlibsuffs; i++) {
|
||||
lib = libbase + aspell_lib_suffixes[i];
|
||||
|
@ -179,7 +162,6 @@ bool Aspell::init(string &reason)
|
|||
goto found;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
found:
|
||||
if (m_data->m_handle == 0) {
|
||||
|
@ -288,13 +270,19 @@ bool Aspell::buildDict(Rcl::Db &db, string &reason)
|
|||
|
||||
// We create the dictionary by executing the aspell command:
|
||||
// aspell --lang=[lang] create master [dictApath]
|
||||
string cmdstring(m_data->m_exec);
|
||||
ExecCmd aspell;
|
||||
vector<string> args;
|
||||
args.push_back(string("--lang=")+ m_lang);
|
||||
cmdstring += string(" ") + string("--lang=") + m_lang;
|
||||
args.push_back("--encoding=utf-8");
|
||||
cmdstring += string(" ") + "--encoding=utf-8";
|
||||
args.push_back("create");
|
||||
cmdstring += string(" ") + "create";
|
||||
args.push_back("master");
|
||||
cmdstring += string(" ") + "master";
|
||||
args.push_back(dicPath());
|
||||
cmdstring += string(" ") + dicPath();
|
||||
|
||||
// Have to disable stderr, as numerous messages about bad strings are
|
||||
// printed. We'd like to keep errors about missing databases though, so
|
||||
|
@ -328,14 +316,17 @@ bool Aspell::buildDict(Rcl::Db &db, string &reason)
|
|||
}
|
||||
if (hasdict)
|
||||
reason = string(
|
||||
"\naspell dictionary creation command failed. Reason unknown.\n"
|
||||
"\naspell dictionary creation command [") +
|
||||
cmdstring + string("] failed. Reason unknown.\n"
|
||||
"Try to set aspellKeepStderr = 1 in recoll.conf, and execute \n"
|
||||
"the indexing command in a terminal to see the aspell "
|
||||
"diagnostic output.\n");
|
||||
else
|
||||
reason = string("aspell dictionary creation command failed.\n"
|
||||
reason = string("aspell dictionary creation command failed:\n") +
|
||||
cmdstring + "\n"
|
||||
"One possible reason might be missing language "
|
||||
"data files for lang = ") + m_lang;
|
||||
"data files for lang = " + m_lang +
|
||||
". Maybe try to execute the command by hand for a better diag.";
|
||||
return false;
|
||||
}
|
||||
db.termWalkClose(tit);
|
||||
|
|
|
@ -32,7 +32,6 @@ RECOLL_DATADIR = ${datadir}/recoll
|
|||
LOCALCXXFLAGS = -Wall -Wno-unused \
|
||||
$(INCICONV) $(XAPIANCXXFLAGS) $(X_CFLAGS) \
|
||||
-DRECOLL_DATADIR=\"$(RECOLL_DATADIR)\" \
|
||||
-DLIBDIR=\"$(libdir)\" \
|
||||
$(PICFLAGS) \
|
||||
@DEFS@
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue