The analitza QML plugin (libanalitzadeclarativeplugin) is being built as a shared library. It should be built as bundles (MODULE) in the CMakeLists.txt file. Reproducible: Always Actual Results: When built as SHARED as in the current code, libanalitzadeclarativeplugin.dylib gets installed to $PREFIX/share/qt5/qml/org/kde/analitza, but is given an install_name of $PREFIX/lib/libanalitzadeclarativeplugin.dylib. This mismatch can cause problems. It is also given a compatibility_version of 0.0.0. Expected Results: Since the plugin is not supposed to be a linkable library, it should be built as MODULE in CMakeLists.txt. This also corrects the install_name/install location mismatch. The change should not have any effect on non-OS X systems --- 8< --- 8< --- 8< --- 8< --- 8< --- 8< --- --- analitza-14.12.1-orig/declarative/CMakeLists.txt 2015-01-05 14:24:31.000000000 -0600 +++ analitza-14.12.1/declarative/CMakeLists.txt 2015-01-28 05:49:24.000000000 -0600 @@ -5,7 +5,7 @@ ${CMAKE_BINARY_DIR} ) -add_library(analitzadeclarativeplugin SHARED analitzadeclarativeplugin.cpp graph2dmobile.cpp analitzawrapper.cpp) +add_library(analitzadeclarativeplugin MODULE analitzadeclarativeplugin.cpp graph2dmobile.cpp analitzawrapper.cpp) target_link_libraries(analitzadeclarativeplugin Qt5::Core Qt5::Gui Qt5::Qml Qt5::Quick --- 8< --- 8< --- 8< --- 8< --- 8< --- 8< --- 8< ---
IIRC this was done because Qt really needs the lib* prefix. Can you give it a try to your change and tell me if it worked for you? Thanks!
Yes, with the proposed change, the file is installed as analitzadeclarativeplugin.so (no lib prefix). However, I don't know how to go about testing whether it works or not with the non-prefix name.
Created attachment 90903 [details] patch The change you pasted won't work, I'll attach a new one. You can test it by running kalgebramobile. It's especially interesting sorting out this one, because many QML modules in KDE are using SHARED instead of module, this will mean we need to change them out.
WIth no patch: libanalitzadeclarativeplugin.dylib; shared lib With my patch: analitzadeclarativeplugin.so; module With attachment 90903 [details]: libanalitzadeclarativeplugin.so; module kalgebra fails with this error: nieder $ /sw/Applications/KF5/kalgebramobile.app/Contents/MacOS/kalgebramobile QQmlApplicationEngine failed to load component file:///widgets/KAlgebraMobile.qml:-1 File not found $ ls -l /sw/lib/qt5-mac/share/kalgebramobile/plugins/widgets/KAlgebraMobile.qml -rw-r--r-- 1 root admin 2224 Nov 12 19:59 /sw/lib/qt5-mac/share/kalgebramobile/plugins/widgets/KAlgebraMobile.qml So I seem to also have the unrelated issue with finding .qml modules...
Yes, looks like a different problem. You'll have to see why this returns empty: QStandardPaths::locate(QStandardPaths::DataLocation, "plugins", QStandardPaths::LocateDirectory); Do you get this problem with all alternatives?
If you can provide the information requested in comment #5, please add it.
Sorry about the delay. Life intruded. Unfortunately, I'm not a programmer, so I can't write the little program to check QStandardPaths::locate(QStandardPaths::DataLocation, "plugins", QStandardPaths::LocateDirectory). But if the code is provided, I should be able to compile it, run it, and provide the necessary feedback.
Ok, you can also use the "qtpaths" tool provided by Qt, it should be something like: $ qtpaths --locate-dirs GenericDataLocation kalgebramobile/plugins /home/kde-devel/kde5/share/kalgebramobile/plugins
$ qtpaths --locate-dirs GenericDataLocation kalgebramobile $ qtpaths --locate-dirs GenericDataLocation /sw/Applications/KF5/kalgebramobile.app/Contents/MacOS/kalgebramobile $ qtpaths --locate-dirs GenericDataLocation /sw/Applications/KF5/kalgebramobile.app/Contents/MacOS/kalgebramobile/plugins (and to make sure qtpaths is actually working)... $ qtpaths --display GenericDataLocation Application Support $ qtpaths --paths GenericDataLocation /Users/nieder/Library/Application Support:/Library/Application Support For kalgebramobile (comment 4), the app failed to start up a GUI and gave the "QQmlApplicationEngine failed to load component" error regardless of how the analitzadeclarativeplugin was built (kalgebramobile was rebuilt after each rebuild of analitza to make sure it was looking for the new analitzadeclarativeplugin file). The app process runs, it just doesn't display anything.
So the problem seems to be that files are being installed in the wrong path. You are installing the file into: /sw/lib/qt5-mac/share/kalgebramobile/plugins/widgets/KAlgebraMobile.qml But then QStandardPaths reports it should be in /sw/Applications/KF5/kalgebramobile.app/Contents/MacOS/kalgebramobile/plugins/widgets/KAlgebraMobile.qml Now this should be figured out at CMake level.
Unfortunately, the path /sw/Applications/KF5/kalgebramobile.app/Contents/MacOS/kalgebramobile/plugins/widgets can't exist with the current layout because the actual runtime executable inside the .app bundle is /sw/Applications/KF5/kalgebramobile.app/Contents/MacOS/kalgebramobile (file/directory collision). I renamed the executable to kalgebramobile-bin and then copied KAlgebraMobile.qml into each of the following directories with no change in the results. /sw/Applications/KF5/kalgebramobile.app/Contents/MacOS /sw/Applications/KF5/kalgebramobile.app/Contents/MacOS/kalgebramobile /sw/Applications/KF5/kalgebramobile.app/Contents/MacOS/kalgebramobile/widgets /sw/Applications/KF5/kalgebramobile.app/Contents/MacOS/kalgebramobile/plugins/widgets /sw/Applications/KF5/kalgebramobile.app/Contents/MacOS/widgets /sw/Applications/KF5/kalgebramobile.app/Contents/MacOS/plugins/widgets I also copied the executable to /sw/lib/qt5-mac/bin so it would be in the same directory tree as KAlgebraMobile.qml, but again, no change.
Well, maybe you want to get in touch with the kde-mac guys. I'd love to find solution to that, but it's clearly something not KAlgebra-specific. Feel free to CC me.
Thank you for the bug report. As this report hasn't seen any changes in 5 years or more, we ask if you can please confirm that the issue still persists. If this bug is no longer persisting or relevant please change the status to resolved.