Difference between revisions of "Free Pascal package guidelines"

From ArchWiki
Jump to: navigation, search
(Package naming)
(update Pkg/AUR templates (https://github.com/lahwaacz/wiki-scripts/blob/master/update-package-templates.py))
 
(8 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
[[Category:Package development]]
 
[[Category:Package development]]
{{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 [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:
 
==== Arch Linux ====
 
==== Arch Linux ====
 
* {{Pkg|fpc}} is available in the official Arch community repository and provides a compiler targetting only your host CPU (i686 or x86_64).
 
* {{Pkg|fpc}} is available in the official Arch community repository and provides a compiler targetting only your host CPU (i686 or x86_64).
* {{AUR|fpc-multilib}} is available from the [[Arch User Repository]] which provides an x86_64 host compiler targetting both i686 and x86_64 CPU Linuxes. This will also provide the {{AUR|ppcross386}} FPC compiler driver package.
+
* {{AUR|fpc-multilib}}{{Broken package link|{{aur-mirror|fpc-multilib}}}} is available from the [[Arch User Repository]] which provides an x86_64 host compiler targetting both i686 and x86_64 CPU Linuxes. This will also provide the {{AUR|ppcross386}}{{Broken package link|{{aur-mirror|ppcross386}}}} FPC compiler driver package.
 
==== Cross compilers ====
 
==== Cross compilers ====
* {{AUR|fpc-arm-linux-rtl}} for ARM-based Linux
+
* {{AUR|fpc-arm-android-rtl}}{{Broken package link|{{aur-mirror|fpc-arm-android-rtl}}}} for ARM-based Android (beta)
* {{AUR|fpc-arm-wince-rtl}} for MS Windows CE
+
* {{AUR|fpc-arm-linux-rtl}}{{Broken package link|{{aur-mirror|fpc-arm-linux-rtl}}}} for ARM-based Linux
* {{AUR|fpc-i386-freebsd-rtl}} for 32-bit Intel FreeBSD
+
* {{AUR|fpc-arm-wince-rtl}}{{Broken package link|{{aur-mirror|fpc-arm-wince-rtl}}}} for MS Windows CE
* {{AUR|fpc-i386-win32-rtl}} for 32-bit MS Windows
+
* {{AUR|fpc-i386-android-rtl}}{{Broken package link|{{aur-mirror|fpc-i386-android-rtl}}}} for 32-bit Intel based Android (beta)
* {{AUR|fpc-powerpc-linux-rtl}} for 32-bit PowerPC-based Linux
+
* {{AUR|fpc-i386-freebsd-rtl}}{{Broken package link|{{aur-mirror|fpc-i386-freebsd-rtl}}}} for 32-bit Intel FreeBSD
* {{AUR|fpc-sparc-linux-rtl}} for SPARC-based Linux
+
* {{AUR|fpc-i386-win32-rtl}}{{Broken package link|{{aur-mirror|fpc-i386-win32-rtl}}}} for 32-bit MS Windows
* {{AUR|fpc-x86_64-win64-rtl}} for 64-bit MS Windows
+
* {{AUR|fpc-powerpc-linux-rtl}}{{Broken package link|{{aur-mirror|fpc-powerpc-linux-rtl}}}} for 32-bit PowerPC-based Linux
 +
* {{AUR|fpc-sparc-linux-rtl}}{{Broken package link|{{aur-mirror|fpc-sparc-linux-rtl}}}} for SPARC-based Linux
 +
* {{AUR|fpc-x86_64-win64-rtl}}{{Broken package link|{{aur-mirror|fpc-x86_64-win64-rtl}}}} for 64-bit MS Windows
  
 
== Free Pascal ==
 
== Free Pascal ==
Line 21: Line 23:
 
=== 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:
  _unittgt=`fpc -iSP`-`fpc -iSO`
+
  _unitdir=`fpc -iSP`-`fpc -iSO`
  _fpcvers=`fpc -iV`
+
  _fpcver=`fpc -iV`
 +
 
 
=== Packaging ===
 
=== Packaging ===
 
Please adhere to the following when making an FPC-based package:
 
Please adhere to the following when making an FPC-based package:
* always add {{Pkg|fpc}} to {{ic|makedepends}}
+
* always add {{Pkg|fpc}} to either {{ic|makedepends}} or {{ic|depends}}
* always put all compiled units (*.compiled, *.o, *.ppu, *.res, *.rst) under {{ic|/usr/lib/fpc/''$_fpcvers''/units/''$arch''-linux}}
+
* always put all compiled units (*.a, *.compiled, *.o, *.ppu, *.res, *.rst) under {{ic|/usr/lib/fpc/''$_fpcver''/units/''$arch''-linux}}
 +
* add {{ic|staticlibs}} to {{ic|options}} if installing an import library
 
==== Cross compiling ====
 
==== Cross compiling ====
* always add the corresponding cross compiler package mentioned above ({{Ic|fpc-''cpu''-''system''-rtl}} or {{AUR|fpc-multilib}} for multilib) to {{ic|depends}}
+
* always add the corresponding cross compiler package mentioned above ({{Ic|fpc-''cpu''-''system''-rtl}} or {{AUR|fpc-multilib}}{{Broken package link|{{aur-mirror|fpc-multilib}}}} for multilib) 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 (*.compiled, *.o, *.ppu, *.res, *.rst) under {{ic|/usr/lib/fpc/''$_fpcvers''/units/''$_unittgt''}} (or if multilib, {{ic|/usr/lib/fpc/''$_fpcvers''/units/i386-linux}})
+
* 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 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

Latest revision as of 10:26, 20 August 2015

Package creation guidelines

CLRCrossEclipseFree PascalGNOMEGoHaskellJavaKDEKernelLispMinGWNode.jsNonfreeOCamlPerlPHPPythonRubyVCSWebWine

This page explains on how to write PKGBUILDs for software built with the 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:

Arch Linux

Cross compilers

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, *.rst) 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 or fpc-multilibAUR[broken link: archived in aur-mirror] for multilib) to depends
  • always add !strip to options for non-Unix-based systems
  • always put all compiled units (*.a, *.compiled, *.o, *.ppu, *.res, *.rst) 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