archrelease: copy trunk to community-any
[ArchLinux/community.git] / fpc / trunk / PKGBUILD
blobe6c82494b5e23f024d84b70278911a92123372a3
1 # Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>
2 # Maintainer: BlackIkeEagle <ike DOT devolder AT gmail DOT com>
3 # Contributor: Valeriy Lyasotskiy <onestep@ukr.net>
4 # Contributor: Jan Willemson <janwil@hot.ee>
5 # Contributor: Hugo Ideler <hugoideler@dse.nl>
6 # Original PKGBUILD: Andre Naumann <anaumann@SPARCed.org>
7 # See http://bbs.archlinux.org/viewtopic.php?t=9318&highlight=fpc
9 pkgname=fpc
10 pkgver=3.2.2
11 pkgrel=8
12 pkgdesc="Free Pascal Compiler, Turbo Pascal 7.0 and Delphi compatible."
13 arch=('x86_64')
14 url="http://www.freepascal.org/"
15 license=('GPL' 'LGPL' 'custom')
16 backup=("etc/fpc.cfg")
17 depends=('ncurses' 'zlib' 'expat' 'binutils' 'make')
18 makedepends=(fpc)
19 options=(zipman libtool staticlibs)
20 source=("https://downloads.sourceforge.net/project/freepascal/Source/${pkgver}/fpcbuild-${pkgver}.tar.gz")
21 sha512sums=('75889bb54adc70a6e2cbd291476b9b12d61c8f943a05b7d16d2024de3215c935465ff43b1400c412e128e260c7f49a9c66e35c21f86cb866e671b5b60a282d82')
23 build() {
24   cd "${srcdir}"/fpcbuild-${pkgver}
25   pushd fpcsrc/compiler
26   fpcmake -Tall
27   popd
28   make build
31 package() {
32   cd "${srcdir}"/fpcbuild-${pkgver}
34   export HOME="${srcdir}"
36   make -j1 PREFIX="${pkgdir}"/usr install
38   export PATH="${pkgdir}"/usr/bin:$PATH
40   install -Dm0644 fpcsrc/rtl/COPYING.FPC "${pkgdir}"/usr/share/licenses/${pkgname}/COPYING.FPC
42   [ "$CARCH" = "x86_64" ] && ln -s /usr/lib/fpc/${pkgver}/ppcx64 "${pkgdir}"/usr/bin/
44   mkdir -p "${pkgdir}"/etc
45   "${pkgdir}"/usr/lib/fpc/${pkgver}/samplecfg "${pkgdir}/usr/lib/fpc/${pkgver}" "${pkgdir}"/etc
46   "${pkgdir}"/usr/lib/fpc/${pkgver}/samplecfg "/usr/lib/fpc/${pkgver}" "${pkgdir}"/etc
47   cp "${srcdir}/.fp/fp."{cfg,ini} "${pkgdir}/usr/lib/fpc/${pkgver}/ide/text/"
49   # use -fPIC by default
50   echo -e "#ifdef cpux86_64\n# for x86_64 use -fPIC by default\n-Cg\n#endif" >> "${pkgdir}/etc/fpc.cfg"
52   mv "${pkgdir}"/usr/man "${pkgdir}"/usr/share/
54   find "${pkgdir}"/etc/ -type f -exec sed -i "s|"${pkgdir}"||g" {} \;