# $Id$ # Maintainer: Sergej Pupykin # Maintainer: BlackIkeEagle # Contributor: Valeriy Lyasotskiy # Contributor: Jan Willemson # Contributor: Hugo Ideler # Original PKGBUILD: Andre Naumann # See http://bbs.archlinux.org/viewtopic.php?t=9318&highlight=fpc # ALARM: Kevin Mihelich # - link ppcarm to /usr/bin # - build for armhf on v6/v7 pkgname=fpc pkgver=3.0.4 pkgrel=3 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." arch=('x86_64') url="http://www.freepascal.org/" license=('GPL' 'LGPL' 'custom') backup=("etc/fpc.cfg") depends=('ncurses' 'zlib' 'expat' 'binutils' 'make') makedepends=(fpc) options=(zipman staticlibs) validpgpkeys=('F40ADB902B24264AA42E50BF92EDB04BFF325CF3') source=(ftp://ftp.freepascal.org/pub/fpc/dist/$pkgver/source/fpcbuild-$pkgver.tar.gz) sha256sums=('f66514e6f2c2e4e1bccccb4d554c24b77682ed61c87811ae5dd210f421855e76') build() { cd "$srcdir"/fpcbuild-$pkgver [[ $CARCH == "armv7h" || $CARCH == "armv6h" ]] && EXTRA="OPT=-dFPC_ARMHF" pushd fpcsrc/compiler fpcmake -Tall popd make build NOGDB=1 ${EXTRA} } package() { cd "$srcdir"/fpcbuild-$pkgver export HOME="$srcdir" make -j1 PREFIX="$pkgdir"/usr install NOGDB=1 export PATH="$pkgdir"/usr/bin:$PATH install -Dm0644 fpcsrc/rtl/COPYING.FPC "$pkgdir"/usr/share/licenses/${pkgname}/COPYING.FPC [ "$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/ mkdir -p "$pkgdir"/etc "$pkgdir"/usr/lib/fpc/${pkgver}/samplecfg "$pkgdir"/usr/lib/fpc/${pkgver} "$pkgdir"/etc # 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" mv "$pkgdir"/usr/man "$pkgdir"/usr/share/ find "$pkgdir"/etc/ -type f -exec sed -i "s|"$pkgdir"||g" {} \; }