Improve spell checker build configuration #107

Merged
SlavekB merged 5 commits from feat/add-config-spellcheckers into master 4 years ago
obache commented 4 years ago
Collaborator
  • try to detect ispell dictionary location and use it
  • try to detect aspell dictionary location
  • add ability to specify default spell checker
* try to detect ispell dictionary location and use it * try to detect aspell dictionary location * add ability to specify default spell checker
SlavekB reviewed 4 years ago
SlavekB left a comment
Owner

Here are some questions and suggestions.

Here are some questions and suggestions.
CMakeLists.txt Outdated
##### check for aspell ##########################
# we need ASPELL_DATADIR too
set ( ASPELL_DATADIR "/usr/lib/aspell" CACHE PATH "aspell data directory" )
Owner

I understand correctly that this is the default path, which may be overwritten below by the result from pspell-config --pkgdatadir?

I understand correctly that this is the default path, which may be overwritten below by the result from `pspell-config --pkgdatadir`?
obache commented 4 years ago
Poster
Collaborator

Yes sure, variable will be overritten, but cache is not.

Yes sure, variable will be overritten, but cache is not.
SlavekB marked this conversation as resolved
CMakeLists.txt Outdated
find_package( ASPELL )
if( NOT ASPELL_FOUND )
message(FATAL_ERROR "\nASPELL support are requested, but not found on your system" )
else( NOT ASPELL_FOUND )
Owner

I would prefer the condition to be reversed – not negative. So if( ASPELL_FOUND ) … do pspell-config detection and move tde_message_fatal as else( ) block.

I would prefer the condition to be reversed – not negative. So `if( ASPELL_FOUND )` … do `pspell-config` detection and move `tde_message_fatal` as `else( )` block.
obache commented 4 years ago
Poster
Collaborator

or endif () here? FATALERROR will stop processing CMake.

or `endif ()` here? `FATALERROR` will stop processing CMake.
Owner

I think Slavek is just saying to reverse the if condition and the if/else blocks order only.

I think Slavek is just saying to reverse the if condition and the if/else blocks order only.
Owner

Yes, exactly as @MicheleC says – I meant to reverse the condition and change the order of the blocks. Alternatively, your new code may not be inside else() – it may simply follow this condition.

Yes, exactly as @MicheleC says – I meant to reverse the condition and change the order of the blocks. Alternatively, your new code may not be inside `else()` – it may simply follow this condition.
Owner

Great, it looks good after adjustment.

Great, it looks good after adjustment.
SlavekB marked this conversation as resolved
obache commented 4 years ago
Poster
Collaborator

fix to change ASPELL_DATADIR cache from execute_process and prevent to override set from the command line

fix to change `ASPELL_DATADIR` cache from `execute_process` and prevent to override set from the command line
SlavekB reviewed 4 years ago
SlavekB left a comment
Owner

It looks good… just one small note.

It looks good… just one small note.
CMakeLists.txt Outdated
####" default spell checker #####################
set( DEFAULT_SPELL_CHECKER "ISPELL" CACHE STRING "default spell checker" )
if( WITH_ASPELL )
set( DEFAULT_SPELL_CHECKER "ASPELL" )
Owner

I assume this is the same case where the variable is set, but the cached value remains unchanged?

I assume this is the same case where the variable is set, but the cached value remains unchanged?
obache commented 4 years ago
Poster
Collaborator

Questionable point:
Why FreeBSD and OpenBSD want to be ASPELL by default?

If it is just beneficial for packaging, I want to drop WITH_ASPELL hunk, packager should use the new knob instead.

If it came from Operating system related issues, I want to change the condition. But it probably means that ispell will not work as expected on such platforms. ispell plugin also should be optional?

Questionable point: Why FreeBSD and OpenBSD want to be ASPELL by default? If it is just beneficial for packaging, I want to drop `WITH_ASPELL` hunk, packager should use the new knob instead. If it came from Operating system related issues, I want to change the condition. But it probably means that `ispell` will not work as expected on such platforms. `ispell` plugin also should be optional?
obache commented 4 years ago
Poster
Collaborator

Removed selecting ASPELL part, packagers should select wanted one by themselves.

Removed selecting ASPELL part, packagers should select wanted one by themselves.
Owner

Ok, that sounds like a good idea.

Maybe there we could add a check to see if the corresponding WITH_${DEFAULT_SPELL_CHECKER} is turned on and report a problem if one that is not enabled is required as default.

Note: As you mentioned earlier, it seems like a good idea to create the WITH_ISPELL option so that it can also be optional.

Ok, that sounds like a good idea. Maybe there we could add a check to see if the corresponding `WITH_${DEFAULT_SPELL_CHECKER}` is turned on and report a problem if one that is not enabled is required as default. Note: As you mentioned earlier, it seems like a good idea to create the `WITH_ISPELL` option so that it can also be optional.
Owner

I added the WITH_ISPELL option and also a check if the spell checker selected as default is enabled for the build. That solves my previous comment.

The question is whether to set WITH_ISPELL as the default ON?

I added the `WITH_ISPELL` option and also a check if the spell checker selected as default is enabled for the build. That solves my previous comment. The question is whether to set `WITH_ISPELL` as the default `ON`?
Owner

Well, I set WITH_ISPELL to ON by default so that it doesn't cause FTBFS for existing builds. And since there are no further comments or suggestions, I will move forward and merge it. Thank you all for your efforts and cooperation.

Well, I set `WITH_ISPELL` to `ON` by default so that it doesn't cause FTBFS for existing builds. And since there are no further comments or suggestions, I will move forward and merge it. Thank you all for your efforts and cooperation.
SlavekB merged commit 056d9c5d0d into master 4 years ago
SlavekB deleted branch feat/add-config-spellcheckers 4 years ago
SlavekB added this to the R14.0.9 release milestone 4 years ago
The pull request has been merged as 056d9c5d0d.
Sign in to join this conversation.
No reviewers
No Milestone
No Assignees
3 Participants
Notifications
Due Date

No due date set.

Dependencies

No dependencies set.

Reference: TDE/tdelibs#107
Loading…
There is no content yet.