You are not logged in.
Ive ported my application from qmake to cmake. It works when I build and install locally.
But it does not work when I have updated it on the AUR...
It seems like the cmake install is not gaining root permissions?
My project repo:
https://github.com/bit-shift-io/audiobook
Install the project...
-- Install configuration: ""
-- Installing: /usr/bin/audiobook
CMake Error at cmake_install.cmake:47 (file):
file INSTALL cannot copy file
"/home/bronson/.cache/yay/audiobook-git/src/audiobook-git/build/audiobook"
to "/usr/bin/audiobook".
Last edited by DBAGibbz (2019-10-31 05:38:52)
Offline
PKGBUILDs never have root rights, the real question is why cmake wants to write to /usr/bin at all .
Are you building with yay or makepkg ?
If yay, does makepkg report the same errror ?
please post outputs from a makepkg build with --log added .
Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.
(A works at time B) && (time C > time B ) ≠ (A works at time C)
Offline
The problem is in your CMakeLists.txt where you explicitly specify to install two files to the root filesystem rather than a relative path:
# Do platform specific post target stuff
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
install(FILES res/io.bitshift.audiobook.desktop DESTINATION /usr/share/applications ) # /usr/share?
install(FILES res/io.bitshift.audiobook.svg DESTINATION /usr/share/pixmaps ) # /usr/share?
endif (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
DESTINATION
Specify the directory on disk to which a file will be installed. If a full path (with a leading slash or drive letter) is given it is used directly. If a relative path is given it is interpreted relative to the value of the CMAKE_INSTALL_PREFIX variable. The prefix can be relocated at install time using the DESTDIR mechanism explained in the CMAKE_INSTALL_PREFIX variable documentation.
EDIT: though this is also not the cause of this error, it would cause subsequent problems. This error, I believe, is due to not passing DESTDIR to the make install command in the PKGBUILD. You use INSTALL_ROOT, but I can't find this in the cmake docs (though I don't know much about cmake).
Last edited by Trilby (2019-10-30 12:54:54)
"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" - Richard Stallman
Offline
Okay thanks for the help!
I was thinking I needed to copy my files into these folders myself (hence needing root), however I realised that the package manager actually does that automatically!
Ive managed to get it working by specifying the DESTDIR="$pkgdir" and cleaning up the cmake file to relative paths.
Offline