# Maintainer: Erich Eckner # Contributor: L # Contributor: Sergej Pupykin # Contributor: Valeriy Lyasotskiy # Contributor: Jan Willemson # Contributor: Hugo Ideler # Contributor: BlackIkeEagle # Original PKGBUILD: Andre Naumann # See http://bbs.archlinux.org/viewtopic.php?t=9318&highlight=fpc pkgname='fpc-svn' pkgver=3.3.1.r49362 _pkgver="${pkgver%.r*}" _revision="${pkgver##*.r}" pkgrel=1 arch=('i486' 'i686' 'pentium4' 'x86_64') url='http://www.freepascal.org/' license=('GPL' 'LGPL' 'custom') depends=('bash' 'ncurses' 'zlib' 'expat') # Trunk can only be built with stable version of FPC makedepends=('fpc' 'subversion' 'fpc-src-svn') source=() pkgver() { { pacman -Q fpc-src-svn 2>/dev/null \ || { pacman -Ss fpc-src-svn \ | sed ' s@^\S\+/\(fpc-src-svn\s\+\)@\1@ t d ' } } \ | sed ' s@^.* @@ s@-.*$@@ ' } prepare() { cd "${srcdir}" mkdir -p "fpcbuild/.makepkg" svn checkout -r HEAD --ignore-externals --config-dir "fpcbuild/.makepkg" "http://svn.freepascal.org/svn/fpcbuild/trunk" "fpcbuild" } build() { cd "${srcdir}"/fpcbuild cp -r /usr/lib/fpc/src fpcsrc pushd fpcsrc/compiler fpcmake -Tall popd make NOGDB=1 OPT=' -dRelease' build } package() { pkgdesc="The Free Pascal Compiler is a Turbo Pascal 7.0 and Delphi compatible \ Pascal Compiler. It comes with fully TP 7.0 compatible run-time library." backup=('etc/fpc.cfg') options=('staticlibs') conflicts=('fpc') provides=("fpc=${pkgver}") local _pinned_dependencies _pinned_dependencies=( 'glibc>=2.31' ) depends+=("${_pinned_dependencies[@]}") cd "${srcdir}"/fpcbuild export HOME="${srcdir}" make -j1 PREFIX="${pkgdir}"/usr NOGDB=1 OPT=' -dRelease' install export PATH="${pkgdir}/usr/bin:${PATH}" install -Dm644 fpcsrc/rtl/COPYING.FPC \ "${pkgdir}"/usr/share/licenses/${pkgname}/COPYING.FPC local _fpcarch='' case "$CARCH" in 'i486'|'i686'|'pentium4') _fpcarch='386' ;; 'x86_64') _fpcarch='x64' ;; *) error 'Unsupported $CARCH' return 1 ;; esac ln -s /usr/lib/fpc/${_pkgver}/ppc${_fpcarch} "${pkgdir}"/usr/bin/ unset _fpcarch install -dm755 "${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" {} \; }