You are not logged in.

#1 2021-08-19 17:20:53

followait
Banned
Registered: 2019-11-01
Posts: 58

[SOLVED] WARNING: Package contains reference to $pkgdir

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

#2 2021-08-19 17:36:19

loqs
Member
Registered: 2014-03-06
Posts: 17,315

Re: [SOLVED] WARNING: Package contains reference to $pkgdir

What if you followed CMake_package_guidelines#Template so  -DCMAKE_INSTALL_PREFIX='/usr' and in package() DESTDIR="$pkgdir" ninja -C build install

Offline

#3 2021-08-19 17:56:49

followait
Banned
Registered: 2019-11-01
Posts: 58

Re: [SOLVED] WARNING: Package contains reference to $pkgdir

loqs wrote:

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

Board footer

Powered by FluxBB