void-packages/srcpkgs/fpc/template

63 lines
2.1 KiB
Bash
Raw Normal View History

2015-09-15 02:24:19 +00:00
# Template file for 'fpc'
pkgname=fpc
2016-04-12 12:04:11 +00:00
version=3.0.0
2015-09-15 02:24:19 +00:00
revision=1
create_wrksrc=yes
build_wrksrc="${pkgname}build-${version}"
conf_files="/etc/fpc.cfg /etc/fppkg.cfg"
hostmakedepends="rpmextract"
makedepends="ncurses-devel zlib-devel expat-devel"
short_desc="Free Pascal Compiler"
maintainer="Jakub Skrzypnik <jot.skrzyp@gmail.com>"
license="GPL-2, LGPL-2.1, FPC-FPR"
homepage="http://freepascal.org/"
distfiles="http://gd.tuwien.ac.at/languages/pascal/${pkgname}/dist/${version}/source/${pkgname}build-${version}.tar.gz"
2016-04-12 12:04:11 +00:00
checksum=d5913b1d5d3d13190ae7ee72c305d5da49ac2ddc1b375b814751ef09ae5c80ec
2015-09-15 02:24:19 +00:00
case "$XBPS_TARGET_MACHINE" in
x86_64*)
distfiles+=" http://gd.tuwien.ac.at/languages/pascal/${pkgname}/dist/${version}/x86_64-linux/rpm/${pkgname}-${version}-1.x86_64.rpm"
2016-04-12 12:04:11 +00:00
checksum+=" 991495008a73f6ff92502a5172f580e887627626dfe146335eb037638dabdc76"
2015-09-15 02:24:19 +00:00
;;
i686)
distfiles+=" http://gd.tuwien.ac.at/languages/pascal/${pkgname}/dist/${version}/i386-linux/rpm/${pkgname}-${version}-1.i686.rpm"
2016-04-12 12:04:11 +00:00
checksum+=" 7b4569fb80cd6b7387344023d23c83312e99dc8ff19915e33f87d7cf73c6ff61"
2015-09-15 02:24:19 +00:00
;;
esac
# TODO: figure out cross-build and how to unwrap the ARM .tar.
nocross=yes
2016-05-25 11:16:19 +00:00
nopie=yes
2015-09-15 02:24:19 +00:00
only_for_archs="x86_64 x86_64-musl i686 i686-musl"
post_extract() {
# relative links needed
ln -sf ../lib64/fpc/${version}/ppcx64 usr/bin
ln -sf ../lib/fpc/${version}/ppc386 usr/bin
# tweak PT_INTERP for musl targets
case "$XBPS_TARGET_MACHINE" in
x86_64-musl)
sed -i s,/lib64/ld-linux-x86-64.so.2,/lib/ld-musl-x86_64.so.1, $build_wrksrc/fpcsrc/compiler/systems/t_linux.pas
;;
i686-musl)
sed -i s,/lib/ld-linux.so.2,/lib/ld-musl-i386.so.1, $build_wrksrc/fpcsrc/compiler/systems/t_linux.pas
;;
esac
}
do_build() {
FPC=$wrksrc/usr/bin/fpc make ${makejobs} all NOGDB=1
}
do_install() {
FPC=$wrksrc/usr/bin/fpc make install NOGDB=1 \
PREFIX=$DESTDIR/usr INSTALL_MANDIR=$DESTDIR/usr/share/man
ln -srf $DESTDIR/usr/lib/fpc/${version}/ppc* $DESTDIR/usr/bin
vmkdir etc
PATH=$DESTDIR/usr/bin:$PATH \
$DESTDIR/usr/lib/fpc/${version}/samplecfg \
$DESTDIR/usr/lib/fpc/${version} $DESTDIR/etc
sed -i "s,${DESTDIR},,g" $DESTDIR/etc/*.cfg $DESTDIR/etc/fppkg/*
vlicense fpcsrc/rtl/COPYING.FPC
}