Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot build with enchant 2.1 #3

Closed
pavbaranov opened this issue Nov 30, 2017 · 12 comments
Closed

Cannot build with enchant 2.1 #3

pavbaranov opened this issue Nov 30, 2017 · 12 comments

Comments

@pavbaranov
Copy link

I think that this is the same error as with enchant 1.6: https://github.com/manisandro/qtspell/issues/2
From console:
(...)[ 85%] Building CXX object CMakeFiles/qtspell.dir/src/Checker.cpp.o /home/pb/builds/gimagereader-qt5-git/qtspell-git/src/qtspell/src/Checker.cpp: In function 'bool QtSpell::checkLanguageInstalled(const QString&)': /home/pb/builds/gimagereader-qt5-git/qtspell-git/src/qtspell/src/Checker.cpp:60:26: error: 'instance' is not a member of 'enchant::Broker' return enchant::Broker::instance()->dict_exists(lang.toStdString()); ^~~~~~~~ /home/pb/builds/gimagereader-qt5-git/qtspell-git/src/qtspell/src/Checker.cpp: In member function 'bool QtSpell::Checker::setLanguageInternal(const QString&)': /home/pb/builds/gimagereader-qt5-git/qtspell-git/src/qtspell/src/Checker.cpp:109:32: error: 'instance' is not a member of 'enchant::Broker' m_speller = enchant::Broker::instance()->request_dict(m_lang.toStdString()); ^~~~~~~~ /home/pb/builds/gimagereader-qt5-git/qtspell-git/src/qtspell/src/Checker.cpp: In static member function 'static QList<QString> QtSpell::Checker::getLanguageList()': /home/pb/builds/gimagereader-qt5-git/qtspell-git/src/qtspell/src/Checker.cpp:162:45: error: 'instance' is not a member of 'enchant::Broker' enchant::Broker* broker = enchant::Broker::instance(); ^~~~~~~~ make[2]: *** [CMakeFiles/qtspell.dir/build.make:295: CMakeFiles/qtspell.dir/src/Checker.cpp.o] Error 1 make[1]: *** [CMakeFiles/Makefile2:169: CMakeFiles/qtspell.dir/all] Error 2 make: *** [Makefile:130: all] Error 2 ==> ERROR: A failure occurred in build(). Aborting...

@manisandro
Copy link
Owner

Mh no, this looks like a fundamental API change in enchant 2.x, I'll need to investigate further.

manisandro added a commit that referenced this issue Dec 6, 2017
@manisandro
Copy link
Owner

Fixed in bf87066, thanks for the report.

@foghawk
Copy link

foghawk commented Dec 15, 2017

Version detection doesn't appear to work correctly:

/tmp/packerbuild-1000/qtspell/qtspell/src/qtspell/src/Checker.cpp: In function ‘enchant::Broker* get_enchant_broker()’:
/tmp/packerbuild-1000/qtspell/qtspell/src/qtspell/src/Checker.cpp:44:29: error: ‘instance’ is not a member of ‘enchant::Broker’
     return enchant::Broker::instance();
                             ^~~~~~~~
make[2]: *** [CMakeFiles/qtspell.dir/build.make:295: CMakeFiles/qtspell.dir/src/Checker.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:137: CMakeFiles/qtspell.dir/all] Error 2
make: *** [Makefile:130: all] Error 2
$ pkg-config --modversion enchant
2.1.2
$ pkg-config --exists enchant-2; echo "$?"
1

I believe line 28 of CMakeLists.txt should be not PKG_CHECK_MODULES(ENCHANT enchant-2) but PKG_CHECK_MODULES(ENCHANT enchant>=2). I am not aware of any distro's providing a separate pkg-config file for enchant version 2.

I'd put in a pullreq but I haven't tested this (installing through AUR as a gIR dependency, would have to write a patch for the PKGBUILD). Maybe later.

@eli-schwartz
Copy link

eli-schwartz commented Dec 15, 2017

Popping in here after helping @foghawk debug this in the #archlinux support channel...

Specifically, I don't understand where PKG_CHECK_MODULES(ENCHANT enchant-2) is supposed to get the enchant-2.pc file (which is being specified as the MODULE) from. That's a very non-ideal way to perform version comparison that would only make sense on distros that wanted to provide parallel installs and make the old version the default.

Honestly, I'd just revert to PKG_CHECK_MODULES(ENCHANT REQUIRED enchant), no version checking at all, and then use IF(ENCHANT_VERSION VERSION_GREATER_EQUAL 2) to test which version you have...

@manisandro
Copy link
Owner

enchant-2 is the name upstream uses for the enchant-2.x pkgconfig file, see [1]. Enchant-1.x and 2.x are supposed to be side-by-side installable. I suppose if downstream packages changed this, then yes, I'll need to extend the logic to both check for enchant-2 as well as enchant with VERSION_GREATER_EQUAL 2.

[1] https://github.com/AbiWord/enchant/blob/master/Makefile.am#L9

@kbabioch
Copy link

kbabioch commented Dec 15, 2017

Still does not build for me (qtspell 0.8.3, enchant 2.1.2):

Scanning dependencies of target qtspell
[ 85%] Building CXX object CMakeFiles/qtspell.dir/src/Checker.cpp.o
/home/kbabioch/PKGBUILD/qtspell/src/qtspell/src/Checker.cpp: In function 'enchant::Broker* get_enchant_broker()':
/home/kbabioch/PKGBUILD/qtspell/src/qtspell/src/Checker.cpp:44:29: error: 'instance' is not a member of 'enchant::Broker'
     return enchant::Broker::instance();
                             ^~~~~~~~
make[2]: *** [CMakeFiles/qtspell.dir/build.make:295: CMakeFiles/qtspell.dir/src/Checker.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:169: CMakeFiles/qtspell.dir/all] Error 2
make: *** [Makefile:130: all] Error 2

Shouldn't there be a switch to override the enchant version, if autodetection fails?

@manisandro
Copy link
Owner

Looks like you need enchant-2.1.3 or newer, since that's when they introduced the -2 suffix to the pkgconfig file and libraries. I'll add some code to also handle versions older thant 2.1.3.

@manisandro
Copy link
Owner

Please try latest master.

@kbabioch
Copy link

Yes, latest master does work fine. Thank you very much.

@manisandro
Copy link
Owner

OK cool

@kbabioch
Copy link

Are you planning on making a new release, so I can properly package this for Arch Linux?

@manisandro
Copy link
Owner

Done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants