简体   繁体   English

PKGBUILD 和 make all

[英]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:我的问题是现在一切正常,除了:

  • makepkg -i is never asking for sudo rights during build (therefore I had to add sudo in front of the make all) makepkg -i 在构建过程中从不要求 sudo 权限(因此我不得不在 make all 前面添加 sudo)
  • When asking for installing, makepkg does not recognize the size of the package. Therefore the package does also not uninstall when running packman -R packagename当要求安装时,makepkg 无法识别 package 的大小。因此运行 packman -R packagename 时 package 也不会卸载

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.

相关问题 在 make all 之前在子目录上调用 make install - Invoking make install on a subdirectory before make all 使所有项目(子目录)都可以访问文件夹中的所有文件 - Make all files in a folder accessible to all projects (subdirectories) 学习Makefile:规则在Make的所有实现中通用吗? - Learning Makefile: Are the rules universal across all implementations of Make? make:**在ubuntu16.10中的opencv安装期间所有错误2 - make: **all error 2 during opencv installation in ubuntu16.10 CMake生成的makefile不会扩展所有的`make`变量 - CMake generated makefile does not expand all `make` variables CMake:从“make install [all]”中排除自定义安装目标 - CMake: Exclude custom install target(s) from 'make install [all]' CMake 相当于“configure --prefix=DIR && make all install”是什么? - What is CMake equivalent of 'configure --prefix=DIR && make all install '? 运行'make all'时忽略CMake EXCLUDE_FROM_ALL参数 - CMake EXCLUDE_FROM_ALL argument ignored when running 'make all' 出现icqdesktop错误时如何编辑make文件(make:*** [全部]错误2)Ubuntu 18.04 64bit - how edit make file when have icqdesktop error (make: *** [all] Error 2) Ubuntu 18.04 64bit 带有 cuda9 错误的 OpenCV 安装:Makefile:160: 目标 'all' 的配方失败 make: *** [all] 错误 2 - OpenCV installation with cuda9 error: Makefile:160: recipe for target 'all' failed make: *** [all] Error 2
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM