Hello everyone,
I’m trying to ship a Qt plugin privately (so in /usr/share/harbour-sailfin, to comply with harbour rules) with my application, which is located in another git repository. Since I’m building with CMake, the logical thing to do for me was to use ExternalProject_Add
. See the snippet attached below
set(DEPLOY_ROOT /home/deploy/installroot/)
ExternalProject_Add(BlurhashQt
# PREFIX ${CMAKE_CURRENT_BINARY_DIR}/lib/blurhash-qt
GIT_REPOSITORY https://github.com/HenkKalkwater/BlurhashQt.git
GIT_TAG 6a0d05919a798eedeacdbc30507470b774b90f8d
CMAKE_ARGS -DBUILD_SHARED_LIBS:BOOL=ON -DENABLE_EXPORT=OFF -DCMAKE_INSTALL_LIBDIR=${DEPLOY_ROOT}usr/share/harbour-sailfin/plugins)
The repository contains a CMake project as well, so CMake will naturally try to build it in the standard CMake way, by invoking another instance of CMake on that project. Yet this will try to install the project to “/usr/local” in the build engine, which doesn’t work of course. So to “help” CMake in building to the correct location, I thought I’ll give it a hint by passing the CMake argument -DCMAKE_INSTALL_LIBDIR=${DEPLOY_ROOT}usr/share/harbour-sailfin/plugins
, where DEPLOYROOT
is /home/deploy/installroot/
. CMake will now happily install the project in the given location and they lived happily ever after.
But, they don’t, since the validator comes in and tells
Checking for unpackaged file(s): /usr/lib/rpm/check-files /home/deploy/installroot
error: Installed (but unpackaged) file(s) found:
/home/deploy/installroot/usr/share/harbour-sailfin/plugins/libblurhash-qt.so
My Spectacle file in the build directory contains
Files:
- '%{_bindir}'
- '%{_datadir}/%{name}'
- '%{_datadir}/applications/%{name}.desktop'
- '%{_datadir}/icons/hicolor/*/apps/%{name}.png'
so it should be matched by the %{_datadir}/%{name}
, right? It does work for the other library I build within my project itself with CMake. Well, when I enter the build engine and execute ls /home/deploy/installroot/usr/share/harbour-sailfin/plugins' it complains about the directory not being found, while
/installroot/usr/share/harbour-sailfin/libdoes contain
libjellyfin-qt.so`, as expected.
Full build log can be found here, due to post length limitations
Full source code of the project, as of writing, can be found here
Is there something wrong with my approach? Is it the cross compiler doing weird things? Can it be fixed?
I don’t want to copy the source of the blurhash-qt into my project, since I’m intending to reuse it some other projects of mine as well and it could potentionally be usefull to others as well (if the library would work properly ).
Side note
The lines containing
+ CXXFLAGS='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -fmessage-length=0 -march=armv7-a -mfloat-abi=hard -mfpu=neon -mthumb -Wno-psabi'
+ export CXXFLAGS
very likely explain the issue which I’d encountered earlier, when the same project I was working on still was using QMake: