Free Pascal 包指南
外观
本页介绍如何为使用 Free Pascal Compiler (FPC) 构建的软件编写 PKGBUILD。编译 x86_64 Arch Linux 需要 fpc 包。
Free Pascal
包命名
项目名称通常已足够。但是,在交叉编译的情况下,当目标是 multilib 的 i686 Linux 时,包应以 fpc32- 为前缀,当目标是非 Arch Linux 系统时,包应命名为 fpc-cpu-system-pkgname 格式。
有用的代码片段
确定 FPC 的版本以及单元输出的 CPU 和操作系统
_unitdir=`fpc -iSP`-`fpc -iSO` _fpcver=`fpc -iV`
打包
在制作基于 FPC 的包时,请遵守以下规定
- 始终将 fpc 添加到
makedepends或depends中 - 始终将所有编译的单元 (*.a, *.compiled, *.o, *.ppu, *.res, *.rsj) 放在
/usr/lib/fpc/$_fpcver/units/$arch-linux下 - 如果安装了导入库,请将
staticlibs添加到options中
交叉编译
- 始终将上面提到的相应交叉编译器包 (
fpc-cpu-system-rtl) 添加到depends中 - 对于非 Unix-based 系统,始终将
!strip添加到options中 - 始终将所有编译的单元 (*.a, *.compiled, *.o, *.ppu, *.res, *.rsj) 放在
/usr/lib/fpc/$_fpcver/units/$_unitdir下 (或者如果 multilib,则放在/usr/lib/fpc/$_fpcver/units/i386-linux下) - 始终使用
any(multilib 时为x86_64) 作为架构 - 如果安装了导入库,请将
staticlibs添加到options中