Free Pascal package guidelines: Difference between revisions

From ArchWiki
(add zh-hans link)
(multilib too)
 
(5 intermediate revisions by 5 users not shown)
Line 5: Line 5:
{{Package guidelines}}
{{Package guidelines}}


This page explains on how to write [[PKGBUILD]]s for software built with the [http://freepascal.org Free Pascal Compiler (FPC)]. There currently exists two options for building software of Linux, as well as a handful of options for building software on other targets using FPC cross compilers:
This page explains on how to write [[PKGBUILD]]s for software built with the [https://www.freepascal.org/ Free Pascal Compiler (FPC)]. Compiling for x86_64 Arch Linux requires the {{Pkg|fpc}} package.
 
* {{Pkg|fpc}} provides a compiler targeting only your host CPU (only x86_64).


== Free Pascal ==
== Free Pascal ==
Line 17: Line 15:
=== Helpful snippets ===
=== Helpful snippets ===


* Determine FPC's version and the CPU and OS of the units to output:
Determine FPC's version and the CPU and OS of the units to output:


  _unitdir=`fpc -iSP`-`fpc -iSO`
  _unitdir=`fpc -iSP`-`fpc -iSO`
Line 27: Line 25:


* always add {{Pkg|fpc}} to either {{ic|makedepends}} or {{ic|depends}}
* always add {{Pkg|fpc}} to either {{ic|makedepends}} or {{ic|depends}}
* always put all compiled units (*.a, *.compiled, *.o, *.ppu, *.res, *.rst) under {{ic|/usr/lib/fpc/''$_fpcver''/units/''$arch''-linux}}
* always put all compiled units (*.a, *.compiled, *.o, *.ppu, *.res, *.rsj) under {{ic|/usr/lib/fpc/''$_fpcver''/units/''$arch''-linux}}
* add {{ic|staticlibs}} to {{ic|options}} if installing an import library
* add {{ic|staticlibs}} to {{ic|options}} if installing an import library


Line 34: Line 32:
* always add the corresponding cross compiler package mentioned above ({{ic|fpc-''cpu''-''system''-rtl}}) to {{ic|depends}}
* always add the corresponding cross compiler package mentioned above ({{ic|fpc-''cpu''-''system''-rtl}}) to {{ic|depends}}
* always add {{ic|!strip}} to {{ic|options}} for non-Unix-based systems
* always add {{ic|!strip}} to {{ic|options}} for non-Unix-based systems
* always put all compiled units (*.a, *.compiled, *.o, *.ppu, *.res, *.rst) under {{ic|/usr/lib/fpc/''$_fpcver''/units/''$_unitdir''}} (or if multilib, {{ic|/usr/lib/fpc/''$_fpcver''/units/i386-linux}})
* always put all compiled units (*.a, *.compiled, *.o, *.ppu, *.res, *.rsj) under {{ic|/usr/lib/fpc/''$_fpcver''/units/''$_unitdir''}} (or if multilib, {{ic|/usr/lib/fpc/''$_fpcver''/units/i386-linux}})
* always use {{ic|any}} ({{ic|x86_64}} if multilib) as the architecture
* always use {{ic|any}} ({{ic|x86_64}} if multilib) as the architecture
* add {{ic|staticlibs}} to {{ic|options}} if installing an import library
* add {{ic|staticlibs}} to {{ic|options}} if installing an import library

Latest revision as of 18:10, 3 September 2022

Arch package guidelines

32-bitCLRCMakeCrossDKMSEclipseElectronFontFree PascalGNOMEGoHaskellJavaKDEKernelLispMesonMinGWNode.jsNonfreeOCamlPerlPHPPythonRRubyRustShellVCSWebWine

This page explains on how to write PKGBUILDs for software built with the Free Pascal Compiler (FPC). Compiling for x86_64 Arch Linux requires the fpc package.

Free Pascal

Package naming

The project name alone is usually sufficient. However, in the case of cross-compiling, the package should be prefixed with fpc32- when targetting i686 Linux from multilib and named in the format of fpc-cpu-system-pkgname when targetting non-Arch Linux systems.

Helpful snippets

Determine FPC's version and the CPU and OS of the units to output:

_unitdir=`fpc -iSP`-`fpc -iSO`
_fpcver=`fpc -iV`

Packaging

Please adhere to the following when making an FPC-based package:

  • always add fpc to either makedepends or depends
  • always put all compiled units (*.a, *.compiled, *.o, *.ppu, *.res, *.rsj) under /usr/lib/fpc/$_fpcver/units/$arch-linux
  • add staticlibs to options if installing an import library

Cross compiling

  • always add the corresponding cross compiler package mentioned above (fpc-cpu-system-rtl) to depends
  • always add !strip to options for non-Unix-based systems
  • always put all compiled units (*.a, *.compiled, *.o, *.ppu, *.res, *.rsj) under /usr/lib/fpc/$_fpcver/units/$_unitdir (or if multilib, /usr/lib/fpc/$_fpcver/units/i386-linux)
  • always use any (x86_64 if multilib) as the architecture
  • add staticlibs to options if installing an import library