PKGBUILDs/extra/fpc/PKGBUILD

76 lines
3 KiB
Bash
Raw Normal View History

2016-01-10 00:18:08 +00:00
# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>
2018-04-12 19:02:56 +00:00
# Maintainer: BlackIkeEagle <ike DOT devolder AT gmail DOT com>
2016-01-10 00:18:08 +00:00
# Contributor: Valeriy Lyasotskiy <onestep@ukr.net>
# Contributor: Jan Willemson <janwil@hot.ee>
# Contributor: Hugo Ideler <hugoideler@dse.nl>
# Original PKGBUILD: Andre Naumann <anaumann@SPARCed.org>
# See http://bbs.archlinux.org/viewtopic.php?t=9318&highlight=fpc
# ALARM: Kevin Mihelich <kevin@archlinuxarm.org>
2022-01-10 01:01:30 +00:00
# - link ppcarm/ppca64 to /usr/bin
2016-02-26 06:37:58 +00:00
# - build for armhf on v6/v7
2022-01-21 19:35:38 +00:00
# - comment adding lto to cflags
2016-01-10 00:18:08 +00:00
pkgname=fpc
2021-06-02 12:56:10 +00:00
pkgver=3.2.2
2024-05-02 18:23:05 +00:00
pkgrel=11
2018-08-15 23:20:25 +00:00
pkgdesc="Free Pascal Compiler, Turbo Pascal 7.0 and Delphi compatible."
2017-11-28 13:37:03 +00:00
arch=('x86_64')
2016-01-10 00:18:08 +00:00
url="http://www.freepascal.org/"
license=('GPL' 'LGPL' 'custom')
backup=("etc/fpc.cfg")
2018-06-14 23:25:19 +00:00
depends=('ncurses' 'zlib' 'expat' 'binutils' 'make')
2016-01-10 00:18:08 +00:00
makedepends=(fpc)
2023-05-07 16:29:20 +00:00
options=(zipman libtool staticlibs !lto)
2017-02-16 13:34:53 +00:00
validpgpkeys=('F40ADB902B24264AA42E50BF92EDB04BFF325CF3')
2024-03-13 12:58:57 +00:00
source=("https://downloads.sourceforge.net/project/freepascal/Source/${pkgver}/fpcbuild-${pkgver}.tar.gz"
honor_SOURCE_DATE_EPOCH_in_date.patch
prevent_date_in_fpcdocs.patch)
sha512sums=('75889bb54adc70a6e2cbd291476b9b12d61c8f943a05b7d16d2024de3215c935465ff43b1400c412e128e260c7f49a9c66e35c21f86cb866e671b5b60a282d82'
'a2261628760e85fc0a8f427b56b6054b9bd2b3641bd5c1a9e757a4d0c307162c8cce84c4623789606bddf14f4a010fd6f3020c38928d8e8825b05e6f7e390fa1'
'26c036ba37982881ce9ae318e32b0ccdda54a6e477dbb54953b2f64dec2ff5a484282558da821d8ec43d7616593d8482813b42623acc7b4655f739b82aa3834f')
prepare() {
cd "${srcdir}"/fpcbuild-${pkgver}
2024-05-02 18:23:05 +00:00
patch -Np1 -i "${srcdir}"/honor_SOURCE_DATE_EPOCH_in_date.patch
patch -Np1 -i "${srcdir}"/prevent_date_in_fpcdocs.patch
2024-03-13 12:58:57 +00:00
}
2016-01-10 00:18:08 +00:00
build() {
2022-01-24 21:55:44 +00:00
cd "${srcdir}"/fpcbuild-${pkgver}
2022-01-21 19:35:38 +00:00
#export CFLAGS="$CFLAGS -ffat-lto-objects"
2023-05-07 16:29:20 +00:00
[[ $CARCH == "armv7h" ]] && EXTRA="OPT=-dFPC_ARMHF"
2016-01-10 00:18:08 +00:00
pushd fpcsrc/compiler
fpcmake -Tall
popd
2023-05-07 16:29:20 +00:00
make build ${EXTRA}
2016-01-10 00:18:08 +00:00
}
package() {
2022-01-24 21:55:44 +00:00
cd "${srcdir}"/fpcbuild-${pkgver}
2016-01-10 00:18:08 +00:00
2022-01-24 21:55:44 +00:00
export HOME="${srcdir}"
2016-01-10 00:18:08 +00:00
2024-03-13 12:58:57 +00:00
make -j1 PREFIX="${pkgdir}"/usr NO_MAN_COMPRESS=1 install
2016-01-10 00:18:08 +00:00
2022-01-24 21:55:44 +00:00
export PATH="${pkgdir}"/usr/bin:$PATH
2016-01-10 00:18:08 +00:00
2022-01-24 21:55:44 +00:00
install -Dm0644 fpcsrc/rtl/COPYING.FPC "${pkgdir}"/usr/share/licenses/${pkgname}/COPYING.FPC
2016-01-10 00:18:08 +00:00
2022-01-24 21:55:44 +00:00
[ "$CARCH" = "x86_64" ] && ln -s /usr/lib/fpc/${pkgver}/ppcx64 "${pkgdir}"/usr/bin/
[ "$CARCH" = "arm" -o "$CARCH" = "armv6h" -o "$CARCH" = "armv7h" ] && ln -s /usr/lib/fpc/${pkgver}/ppcarm "${pkgdir}"/usr/bin/
[ "$CARCH" = "aarch64" ] && ln -s /usr/lib/fpc/${pkgver}/ppca64 "${pkgdir}"/usr/bin/
2016-01-10 00:18:08 +00:00
2022-01-24 21:55:44 +00:00
mkdir -p "${pkgdir}"/etc
"${pkgdir}"/usr/lib/fpc/${pkgver}/samplecfg "${pkgdir}"/usr/lib/fpc/${pkgver} "${pkgdir}"/etc
"${pkgdir}"/usr/lib/fpc/${pkgver}/samplecfg "/usr/lib/fpc/${pkgver}" "${pkgdir}"/etc
cp "${srcdir}/.fp/fp."{cfg,ini} "${pkgdir}/usr/lib/fpc/${pkgver}/ide/text/"
2016-01-10 00:18:08 +00:00
# use -fPIC by default
2022-01-24 21:55:44 +00:00
echo -e "#ifdef cpux86_64\n# for x86_64 use -fPIC by default\n-Cg\n#endif" >> "${pkgdir}/etc/fpc.cfg"
2016-01-10 00:18:08 +00:00
2022-01-24 21:55:44 +00:00
mv "${pkgdir}"/usr/man "${pkgdir}"/usr/share/
2016-01-10 00:18:08 +00:00
2022-01-24 21:55:44 +00:00
find "${pkgdir}"/etc/ -type f -exec sed -i "s|"${pkgdir}"||g" {} \;
2016-01-10 00:18:08 +00:00
}