PKGBUILDs/community/fpc/PKGBUILD

75 lines
2.6 KiB
Bash
Raw Normal View History

2016-01-10 00:18:08 +00:00
# $Id$
# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Contributor: Valeriy Lyasotskiy <onestep@ukr.net>
# Contributor: Jan Willemson <janwil@hot.ee>
# Contributor: Hugo Ideler <hugoideler@dse.nl>
# Contributor: BlackIkeEagle <ike DOT devolder AT gmail DOT com>
# Original PKGBUILD: Andre Naumann <anaumann@SPARCed.org>
# See http://bbs.archlinux.org/viewtopic.php?t=9318&highlight=fpc
# ALARM: Kevin Mihelich <kevin@archlinuxarm.org>
# - link ppcarm to /usr/bin
2016-02-26 06:37:58 +00:00
# - build for armhf on v6/v7
2016-01-10 00:18:08 +00:00
pkgname=fpc
2017-11-28 13:37:03 +00:00
pkgver=3.0.4
2016-01-10 00:18:08 +00:00
_gdbver=7.10
2017-02-16 13:34:53 +00:00
pkgrel=1
2016-01-10 00:18:08 +00:00
pkgdesc="The Free Pascal Compiler is a Turbo Pascal 7.0 and Delphi compatible 32bit Pascal Compiler. It comes with fully TP 7.0 compatible run-time library."
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")
depends=(ncurses zlib expat)
makedepends=(fpc)
options=(zipman staticlibs)
2017-02-16 13:34:53 +00:00
validpgpkeys=('F40ADB902B24264AA42E50BF92EDB04BFF325CF3')
2016-01-10 00:18:08 +00:00
source=(ftp://ftp.freepascal.org/pub/fpc/dist/$pkgver/source/fpcbuild-$pkgver.tar.gz
2017-11-28 13:37:03 +00:00
https://ftp.gnu.org/gnu/gdb/gdb-${_gdbver}.tar.xz{,.sig})
sha256sums=('f66514e6f2c2e4e1bccccb4d554c24b77682ed61c87811ae5dd210f421855e76'
2017-02-16 13:34:53 +00:00
'7ebdaa44f9786ce0c142da4e36797d2020c55fa091905ac5af1846b5756208a8'
2017-11-28 13:37:03 +00:00
'SKIP')
2016-01-10 00:18:08 +00:00
build() {
2017-02-16 13:34:53 +00:00
cd "$srcdir"/gdb-${_gdbver}
2016-01-10 00:18:08 +00:00
# ./configure --prefix=/usr --disable-nls --without-python --disable-werror --disable-tui
# make
# make -C gdb libgdb.a
# cp libdecnumber/libdecnumber.a gdb/
2017-02-16 13:34:53 +00:00
cd "$srcdir"/fpcbuild-$pkgver
export GDBLIBDIR="$srcdir"/gdb-${_gdbver}/gdb
2016-01-10 00:18:08 +00:00
export LIBGDBFILE=$GDBLIBDIR/libgdb.a
2016-02-26 06:37:58 +00:00
[[ $CARCH == "armv7h" || $CARCH == "armv6h" ]] && EXTRA="OPT=-dFPC_ARMHF"
2016-01-10 00:18:08 +00:00
pushd fpcsrc/compiler
fpcmake -Tall
popd
2016-02-26 06:37:58 +00:00
make build NOGDB=1 ${EXTRA}
2016-01-10 00:18:08 +00:00
}
package() {
2017-02-16 13:34:53 +00:00
cd "$srcdir"/fpcbuild-$pkgver
2016-01-10 00:18:08 +00:00
2017-02-16 13:34:53 +00:00
export HOME="$srcdir"
2016-01-10 00:18:08 +00:00
2017-02-16 13:34:53 +00:00
make -j1 PREFIX="$pkgdir"/usr install
2016-01-10 00:18:08 +00:00
2017-02-16 13:34:53 +00:00
export PATH="$pkgdir"/usr/bin:$PATH
2016-01-10 00:18:08 +00:00
2017-02-16 13:34:53 +00:00
install -Dm0644 fpcsrc/rtl/COPYING.FPC "$pkgdir"/usr/share/licenses/${pkgname}/COPYING.FPC
2016-01-10 00:18:08 +00:00
2017-02-16 13:34:53 +00:00
[ "$CARCH" = "i686" ] && ln -s /usr/lib/fpc/${pkgver}/ppc386 "$pkgdir"/usr/bin/
[ "$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/
2016-01-10 00:18:08 +00:00
2017-02-16 13:34:53 +00:00
mkdir -p "$pkgdir"/etc
"$pkgdir"/usr/lib/fpc/${pkgver}/samplecfg "$pkgdir"/usr/lib/fpc/${pkgver} "$pkgdir"/etc
2016-01-10 00:18:08 +00:00
# use -fPIC by default
echo -e "#ifdef cpux86_64\n# for x86_64 use -fPIC by default\n-Cg\n#endif" >> "$pkgdir/etc/fpc.cfg"
2017-02-16 13:34:53 +00:00
mv "$pkgdir"/usr/man "$pkgdir"/usr/share/
2016-01-10 00:18:08 +00:00
2017-02-16 13:34:53 +00:00
find "$pkgdir"/etc/ -type f -exec sed -i "s|"$pkgdir"||g" {} \;
2016-01-10 00:18:08 +00:00
}