You are not logged in.
PKGBUILD
...
build()
{
cd "${srcdir}/cppjieba"
cmake -S . \
-B out \
-G Ninja \
-D CMAKE_BUILD_TYPE=Release \
-D CMAKE_INSTALL_PREFIX=${pkgdir}/usr/local
cmake --build out
}
...
In CMakeLists.txt, configure_file is used to configure a file to reference a file in ${CMAKE_INSTALL_PREFIX}/shared, with CMAKE_INSTALL_FULL_DATADIR
In PKGBUILD
CMAKE_INSTALL_PREFIX=${pkgdir}/usr/local
so that after installation of the pkg, the file in ${pkgdir}/usr/local/shared is referenced, instead of in /usr/local/shared
How to fix it?
Do I have to use CMAKE_INSTALL_PREFIX/shared instead of CMAKE_INSTALL_FULL_DATADIR, and with the help of DESTDIR? Any better way?
Last edited by followait (2021-08-19 17:57:11)
Offline
What if you followed CMake_package_guidelines#Template so -DCMAKE_INSTALL_PREFIX='/usr' and in package() DESTDIR="$pkgdir" ninja -C build install
Offline
What if you followed CMake_package_guidelines#Template so -DCMAKE_INSTALL_PREFIX='/usr' and in package() DESTDIR="$pkgdir" ninja -C build install
Great, it solved the problem without modifying the project, thanks very much.
package()
{
cd "$pkgname"
DESTDIR="$pkgdir" cmake --install out
}
Last edited by followait (2021-08-19 17:57:55)
Offline