# SliTaz package receipt. PACKAGE="fpc" VERSION="2.6.4" CATEGORY="development" SHORT_DESC="The Free Pascal Compiler" MAINTAINER="slaxemulator@gmail.com" LICENSE="GPL2 LGPL2.1" SOURCE="fpcbuild" TARBALL="$SOURCE-$VERSION.tar.gz" WEB_SITE="https://www.freepascal.org/" WGET_URL="ftp://ftp.freepascal.org/pub/fpc/dist/$VERSION/source/$TARBALL" CONFIG_FILES="/etc/fpc.cfg" TAGS="compiler pascal" CROSS_BUGS="arm-slitaz-gnueabi-as: Command not found" #HOST_ARCH="i486 arm" DEPENDS="ncurses" BUILD_DEPENDS="fpc-bootstrap" # What is the latest version available today? current_version() { wget -O - 'https://gitlab.com/freepascal.org/fpc/source/-/tags?sort=updated_desc' 2>/dev/null | \ sed '/source-/!d;/tar.gz/!d;/quot;/d;/_rc[0-9]/d;/macos/d;s|.*/source-||;s|.*release.||;s|.tar.*||;/^[0-9]/!d;s|_|.|g' | sort -Vr | sed q } # Handle cross compilation. ARM: fpc-bootstrap build host must be installed case "$ARCH" in arm*) BUILD_DEPENDS="" ;; esac # Rules to configure and make the package. compile_rules() { case "$ARCH" in i?86) make ${ARCH_ARGS} NOGDB=1 build make -j1 NOGDB=1 PREFIX=$DESTDIR/usr install ;; arm*) make crossinstall \ NOGDB=1 \ CPU_TARGET=arm \ OS_TARGET=linux \ OPT=-dFPC_ARMEL \ CROSSBINDIR=/cross/$ARCH/tools/bin \ BINUTILSPREFIX=arm-slitaz-gnueabi- \ INSTALL_PREFIX=$DESTDIR/usr ;; esac && # install package license install -m 755 -d $DESTDIR/usr/share/licenses/fpc && install -m 644 $src/fpcsrc/rtl/COPYING.FPC \ $DESTDIR/usr/share/licenses/fpc/ # move man pages to the right place mv $install/usr/man $install/usr/share } # Rules to gen a SliTaz package suitable for Tazpkg. genpkg_rules() { mkdir -p $fs/usr $fs/etc cp -a $install/usr/bin $fs/usr cp -a $install/usr/lib $fs/usr # create symlink for compiler ln -s /usr/lib/$PACKAGE/$VERSION/ppc386 $fs/usr/bin # config file #mkdir -p $fs/etc #cp -a $fs/usr/lib/fpc/$VERSION/samplecfg $fs/etc/fpc.cfg } post_install() { if [ ! -s "$1/etc/fpc.cfg" ]; then chroot "$1/" fpcmkcfg > /etc/fpc.cfg fi # Fix units search path sed -i -e 's!^-Fu/units/$fpctarget!-Fu/usr/lib/fpc/'$VERSION'/units/$fpctarget!' \ -e 's!^-Fu/units/$fpctarget/*!-Fu/usr/lib/fpc/'$VERSION'/units/$fpctarget/*!' \ -e 's!^-Fu/units/$fpctarget/rtl!-Fu/usr/lib/fpc/'$VERSION'/units/$fpctarget/rtl!' "$1/etc/fpc.cfg" }