Hello Hendrik,
I am trying to package Molsketch for Fedora, but I can't get the latest version to compile on F25.
The build exits with this error message:
/usr/include/qt5/QtCore/qmetatype.h:1376:33: error: invalid application of 'sizeof' to incomplete type 'QGraphicsScene' Q_STATIC_ASSERT_X(sizeof(T), "Type argument of Q_DECLARE_METATYPE(T*) must be fully defined"); ^ /usr/include/qt5/QtCore/qglobal.h:746:66: note: in definition of macro 'Q_STATIC_ASSERT_X' #define Q_STATIC_ASSERT_X(Condition, Message) static_assert(bool(Condition), Message) ^~~~~~~~~ libmolsketch/src/CMakeFiles/molsketch_LIB.dir/build.make:644: recipe for target 'libmolsketch/src/CMakeFiles/molsketch_LIB.dir/fileio.cpp.o' failed make[2]: *** [libmolsketch/src/CMakeFiles/molsketch_LIB.dir/fileio.cpp.o] Error 1
I believe it might have to do with some Qt5 "peculiarities":
http://doc.qt.io/qt-5/custom-types.html
I am attaching the build logs from a Mock chroot on my system and you can find my spec file here:
https://paste.fedoraproject.org/paste/tW7urB0eercUexPMR62S2Q
Please let me know if I can do anything else to help.
Best regards
Alexander Ploumistos
Hi Alexander,
sorry for my belated response, for some reason I must have missed the sourceforge email notification (spam filter, I guess).
I'll look into it after publishing version 0.5.0, in which the build will change quite a bit. If that's possible, I would kindly ask you to try again with 0.5.0, just to be sure.
Kind regards,
Hendrik
Sure, no worries. I'll start afresh with 0.5.0 and we'll see from there.
Hi Alexander,
first of all -- as I missed that the last time around -- let me thank you for undertaking the effort of building binary packages for Fedora.
Now taking a quick glance at the application.log you attached, it seems that CMake did not find Qt5. It reads:
My apologies for that, but that statement is not quite accurate anymore -- I've been somewhat lazy in keeping Qt4 support and it probably won't build (it is quite a hassle to support the whole matrix of Qt4/5, Windows, Linux, Mac, qmake, and CMake). I'm just uploading 0.5.0 and both CMake and qmake should work; Qt5 will be required, however. Personally, I prefer using qmake (at least for now).
Sorry for that; please let me know if you need me to re-instate the Qt4 support. As I'm also making more use of newer C++11 and 14 features, I felt that transition had to come eventually (maybe I was wrong). If the problem is more that your CMake does not find your Qt5 installation, I would suggest trying qmake (Molsketch relies on the CMake scripts to find its Qt version, so I don't really have any good proposal there).
Hope that helps and kind regards,
Hendrik
Hello Hendrik,
After a bit of trial and error, amending the spec file along the way, I got to this error:
I have attached the complete build log.
Any ideas? Am I missing a dependency perhaps or is that due to code incompatibility with the latest gcc?
Thanks
Alexander
Hi Alexander,
that seems to be due to sloppiness on my part. In obabeliface.cpp, the argument of qInfo() is not a string literal (but, instead, a string compiled from a list of strings), which is regarded as a security risk by gcc if the -Werror=format-security option is enabled. To my surprise, I couldn't quite reproduce that, but I've replaced that line (obabeliface.cpp, 367) with
which should not cause that problem. Please try downloading the updated version 0.5.0 or applying an appropriate patch to your version and let me know if that works.
Cheers,
Hendrik
That did help and compilation failed a lot further down the road, see build.log. I have used the same spec file.
There were a lot of output, but I think the problem was during this stage:
[ 71%] Linking CXX shared library libmolsketch-qt5.so
It was followed by a lot of messages like these:
Sorry, for the delay -- SourceForge was apparently down the last couple of days. From looking at your build.log, it appears that you are first building using qmake and then again using CMake. Might it be that, during the linking after the CMake build, somehow this produces the duplicate definition error? It seems that the qmake build by itself is successful. On my machine, both qmake and CMake seem to work (separately, that is ;-) ).
Last edit: Hendrik Vennekate 2017-09-28
Thanks, that was my bad, I had left a "
#%cmake .
" commented out in the %build section which got activated.It took a few /usr/local → /usr and /lib* → /usr/lib* substitutions and in the end I managed to get it to build.
Now I need to whip the spec file into shape and declare all the files, documentation and license.
I also found this spec file from openSUSE, which contains far more Qt5 dependencies than mine and I would like to ask another of our packagers, who knows a lot more about Qt than I do, to take a look at mine. They have also created libmolsketch and molsketch-devel subpackages, which seems a bit weird. I will need to check about these too.
There is also a policy in Fedora against bundled libraries, but as far as I can tell, libmolsketch and libobabeliface are private to molsketch, so I won't need to do anything about them, correct?
I have to be at a conference for the next three days, so I won't have much time to deal with all of the above. I will try to fix the spec file by Sunday night and take things from there.
Have a nice weekend,
Alexander
Glad to hear that that the build is now working and thanks for the feedback.
In the qmake build, you can set the MSK_PREFIX like so:
(the docs seem not to have been updated, but it says it during the build)
In CMake, you can set the paths like so:
Again, the docs are not up to date, but it says it during the initial cmake call.
As for OpenSuSE: While I use it, I'm not involved in the packaging, but in https://sourceforge.net/p/molsketch/bugs/12/ (Bug #12), Aliaksei Padvalski reported about building for it (not sure if he's still active, though). From my understanding, they usually package a "-devel" package with mainly the headers for development. The idea with libmolsketch was indeed (and still is) to eventually make the core of Molsketch available to others, for instance as a Calligra plugin or the like, but that will take a while, so for now I would concur, that it's really one "unit" (the binary and the lib -- call it "package", if you like ;) ).
Best wishes and have a nice weekend,
Hendrik
Oh, I think you can close the ticket.
Will do, thanks.