Free Pascal 软件包指南
Arch 软件包指南
32 位 – CLR – CMake – 交叉 – DKMS – Eclipse – Electron – 字体 – Free Pascal – GNOME – Go – Haskell – Java – KDE – 内核模块 – Lisp – Meson – MinGW – Node.js – 非自由 – OCaml – Perl – PHP – Python – R – Ruby – Rust - 安全 – Shell – VCS – Web – Wine
本页面介绍如何为使用 PKGBUILDs 为使用 Free Pascal 编译器 (FPC) 构建的软件编写。为 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 系统,始终将
!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
中