[英]PKGBUILD with make all
I am trying to write a PKGBUILD for the AUR right now for a github project consisting of several sub applications.我现在正在尝试为 AUR 编写一个 PKGBUILD,用于一个由多个子应用程序组成的 github 项目。
So basically the CMake file of this project just runs a make to make && make install the sub applications.所以基本上这个项目的 CMake 文件只是运行一个 make 来 make && make install 子应用程序。
These are my build and package steps:这些是我的构建和 package 步骤:
build() {
cd "$srcdir/$_gitname"
[[ -d build ]] && rm -r build
mkdir build && cd build
cmake -DCMAKE_INSTALL_PREFIX=/opt/od ..
}
package() {
cd "${_gitname}/build"
sudo make all
}
My problem is now that everything works except:我的问题是现在一切正常,除了:
I cannot change the CMake file though, because the project is not mine and all the different subapplications belong together and if I try make && make install them separately I get a bunch of errors that they are depending each other.我不能更改 CMake 文件,因为该项目不是我的,所有不同的子应用程序都属于一起,如果我尝试 make && make install 它们分开我得到一堆错误,它们相互依赖。
The package function cannot install into the root hierarchy. 软件包功能无法安装到根层次结构中。 Instead, makepkg is intended to install into the pkgdir under a fakeroot, where the pkgdir replicates the actual root directory structure.
相反,makepkg旨在安装在fakeroot下的pkgdir中,其中pkgdir复制实际的根目录结构。 See ArchWiki/Creating Packages .
请参阅ArchWiki /创建软件包 。
You can do this by adding DESTDIR="$pkgdir/"
to the make options in your package function. 您可以通过在包函数的make选项中添加
DESTDIR="$pkgdir/"
来实现。
When pacman is invoked on the created package, it will copy the files over into the real root hierarchy. 在创建的程序包上调用pacman时,它将文件复制到真实的根层次结构中。
As an exmaple举个例子
package()
{
cd "$pkgname"
DESTDIR="$pkgdir" cmake --install out
}
This will install things to $pkgdir, and then packaged to zst file.这会将东西安装到 $pkgdir,然后打包到 zst 文件。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.