void-packages/srcpkgs/fpc/template

64 lines
2.1 KiB
Bash

# Template file for 'fpc'
pkgname=fpc
version=3.2.0
revision=1
archs="x86_64* i686*"
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="Leah Neukirchen <leah@vuxu.org>"
license="GPL-2.0-or-later, LGPL-2.1-or-later"
homepage="http://freepascal.org/"
distfiles="${SOURCEFORGE_SITE}/freepascal/Source/${version}/${pkgname}build-${version}.tar.gz"
checksum=f9b914eace989a023fb953da203dc0d973b44487568b4138c7d5b9613d7d6838
case "$XBPS_TARGET_MACHINE" in
x86_64*)
distfiles+=" ${SOURCEFORGE_SITE}/freepascal/Linux/${version}/${pkgname}-${version}-1.x86_64.rpm"
checksum+=" 1f74e1ad3ced2dd67688fdb92edd42e73cdc31ef96056f8739449d70a9306f2c"
;;
i686*)
distfiles+=" ${SOURCEFORGE_SITE}/freepascal/Linux/${version}/${pkgname}-${version}-1.i686.rpm"
checksum+=" 05c5600c9461362a08df100cf50ca125cb2b4d5bfe4da48cf8c144f2bf4617a2"
;;
esac
# TODO: figure out cross-build and how to unwrap the ARM .tar.
nocross=yes
nopie=yes
noverifyrdeps=yes
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
cd $build_wrksrc && patch -p0 < ${FILESDIR}/musl-__libc_csu.patch
;;
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/default $DESTDIR/usr/lib/fpc/${version}/ide/text/*
vlicense fpcsrc/rtl/COPYING.FPC
}