mirror of
https://git.FreeBSD.org/ports.git
synced 2024-12-25 04:43:33 +00:00
lang/fpc: Prepare for 3.0 and the use of older bootstrap
The Free Pascal Compiler port currently mandates that the bootstrap compiler be the same version of the compiler being built. This means that every update requires a new bootstrap compiler to be generated before the update. This goes against the philosophy of a bootstrap compiler, which aims to allow older compilers to build self-hosting modern compilers. FPC is capable of this, but the feature wasn't being leveraged. There are a lot of changes in this commit, but I believe the resulting compiler is the same as before the commit, thus PORTREVISION has not been bumped. Changes include: * Add DragonFly bootstrap compiler 2.6.4 to list of distfiles * use OPSYS to make builds generic between FreeBSD and DragonFly * Add FREEBSD PLIST variable as FreeBSD builds an extra unit * Create the framework to have a bootstrap compiler of an older version than the current version (BOOTVER variable) * split PP variable out of MAKE_ARGS and use NEWPPC or BOOTPPC to specify PP uniquely (required when bootstrap version is different) * wrap compound command with parenthesis * Use options lists on TAR man page (xfz without hyphen is legacy) * unmask installation commands * respect 80-column limits, wrapping as necessary * bring in some dports-specific changes that have no effect on port to eliminate dports patch files future work: When version 3.0 is released, the new fpc make program will be built which will have some moderate impacts to the build process and it will use a "bootstrap" target. The intention is to continue using the 2.6.4 bootstrap compilers to build the upcoming 3.0 compiler when it is released. New bootstrap compilers will not be generated until the existing bootstrap compilers are unable to bootstrap the upcoming release.
This commit is contained in:
parent
97c332e87a
commit
fe0e6bcacc
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=376655
@ -11,6 +11,7 @@ MASTER_SITES= ftp://ftp.freepascal.org/pub/fpc/dist/${PORTVERSION}/source/:sourc
|
||||
ftp://freepascal.stack.nl/pub/fpc/dist/${PORTVERSION}/source/:source \
|
||||
ftp://ftp.no.freepascal.org/pub/fpc/dist/${PORTVERSION}/source/:source \
|
||||
ftp://ftp.us.freepascal.org/pub/fpc/dist/${PORTVERSION}/source/:source \
|
||||
http://leaf.dragonflybsd.org/~marino/dports-src/:DragonFlybootstrap \
|
||||
SF/freepascal/Source/${PORTVERSION}:source \
|
||||
${MASTER_SITE_GOOGLE_CODE}:bootstrap \
|
||||
${MASTER_SITE_LOCAL:S|$|acm/freepascal/:bootstrap|} \
|
||||
@ -25,19 +26,15 @@ COMMENT?= Free Pascal compiler with Turbo and Delphi
|
||||
PROJECTHOST= bsdistfiles
|
||||
USES= gmake iconv
|
||||
ONLY_FOR_ARCHS= i386 amd64
|
||||
BOOTVER= 2.6.4
|
||||
|
||||
OPTIONSFILE= ${PORT_DBDIR}/${PORTNAME}${PKGNAMESUFFIX}/options
|
||||
|
||||
#OPT?=-Ur -CX
|
||||
OPT?=-CX
|
||||
FPCSRCDIR= ${PORTNAME}-${PORTVERSION}
|
||||
|
||||
.include <bsd.port.pre.mk>
|
||||
|
||||
.if ${OPSYS} == DragonFly
|
||||
IGNORE= not supported on DragonFly yet
|
||||
.endif
|
||||
|
||||
.if ${ARCH} == "i386"
|
||||
PPNAME= ppc386
|
||||
FPC_ARCH= i386
|
||||
@ -50,44 +47,66 @@ PLIST_SUB= FPC_I386="@comment " \
|
||||
FPC_AMD64=""
|
||||
.endif
|
||||
|
||||
.if ${OPSYS} == FreeBSD
|
||||
PLIST_SUB+= FREEBSD=""
|
||||
.else
|
||||
PLIST_SUB+= FREEBSD="@comment "
|
||||
.endif
|
||||
|
||||
.if !defined(PKGNAMESUFFIX)
|
||||
SUB_FILES= pkg-message
|
||||
|
||||
BUILDNAME= ${FPC_ARCH}-freebsd
|
||||
BUILDNAME= ${FPC_ARCH}-${OPSYS:tl}
|
||||
PLIST_SUB+= PORTVERSION=${PORTVERSION} \
|
||||
BUILDNAME=${BUILDNAME}
|
||||
DISTFILES+= ${PPNAME}-${PORTVERSION}-${OPSYS:tl}${EXTRACT_SUFX}:bootstrap \
|
||||
DISTFILES+= ${BOOTDIR}${EXTRACT_SUFX}:${OPSYS:MDragonFly}bootstrap \
|
||||
${DISTNAME:S/$/.man/}${EXTRACT_SUFX}:man
|
||||
MAKE_ARGS+= PP=${WRKDIR}/${PPNAME}-${PORTVERSION}-${OPSYS:tl} \
|
||||
FPCMAKE=${WRKDIR}/${FPCSRCDIR}/utils/fpcm/fpcmake \
|
||||
MAKE_ARGS+= FPCMAKE=${WRKDIR}/${FPCSRCDIR}/utils/fpcm/fpcmake \
|
||||
FPCTARGET=${BUILDNAME} \
|
||||
ARCH=${FPC_ARCH} \
|
||||
OPT="${OPT}" \
|
||||
BSDHIER=1 \
|
||||
INSTALL_PREFIX=${STAGEDIR}${PREFIX}
|
||||
NEWPPC= PP=${WRKSRC}/compiler/${PPNAME}
|
||||
NEWFPC= FPC=${WRKSRC}/compiler/${PPNAME}
|
||||
BOOTDIR= ${PPNAME}-${BOOTVER}-${OPSYS:tl}
|
||||
BOOTPPC= PP=${WRKDIR}/${BOOTDIR}
|
||||
|
||||
do-extract:
|
||||
# unpack binary distribution
|
||||
@${MKDIR} ${WRKDIR}
|
||||
@${TAR} xfz ${_DISTDIR}/${PPNAME}-${PORTVERSION}-${OPSYS:tl}${EXTRACT_SUFX} --directory \
|
||||
${WRKDIR} && ${CHMOD} +x ${WRKDIR}/${PPNAME}-${PORTVERSION}-${OPSYS:tl}
|
||||
@${TAR} -xzf ${_DISTDIR}/${BOOTDIR}${EXTRACT_SUFX} \
|
||||
--directory ${WRKDIR} && ${CHMOD} +x ${WRKDIR}/${BOOTDIR}
|
||||
# unpack man files
|
||||
@${TAR} xfz ${_DISTDIR}/${DISTNAME:S/$/.man/}${EXTRACT_SUFX} --directory \
|
||||
${WRKDIR}
|
||||
@${TAR} -xzf ${_DISTDIR}/${DISTNAME:S/$/.man/}${EXTRACT_SUFX} \
|
||||
--directory ${WRKDIR}
|
||||
# unpack source distribution
|
||||
@cd ${WRKDIR} && \
|
||||
${GZIP_CMD} -dc ${_DISTDIR}/${DISTNAME:S/$/.source/}${EXTRACT_SUFX} \
|
||||
| ${TAR} xf - ${FPCSRCDIR}/compiler ${FPCSRCDIR}/rtl \
|
||||
${FPCSRCDIR}/utils/fpcmkcfg ${FPCSRCDIR}/packages/fcl-base \
|
||||
${FPCSRCDIR}/packages/fcl-process ${FPCSRCDIR}/utils/fpcm
|
||||
@(cd ${WRKDIR} && ${GZIP_CMD} -dc \
|
||||
${_DISTDIR}/${DISTNAME:S/$/.source/}${EXTRACT_SUFX} | \
|
||||
${TAR} -xf - \
|
||||
${FPCSRCDIR}/compiler \
|
||||
${FPCSRCDIR}/rtl \
|
||||
${FPCSRCDIR}/utils/fpcmkcfg \
|
||||
${FPCSRCDIR}/packages/fcl-base \
|
||||
${FPCSRCDIR}/packages/fcl-process \
|
||||
${FPCSRCDIR}/utils/fpcm)
|
||||
|
||||
post-patch:
|
||||
.if ${ARCH} == "i386"
|
||||
@${REINPLACE_CMD} -i "" -e 's|504000|${OSVERSION}|g' ${WRKDIR}/${FPCSRCDIR}/rtl/freebsd/${FPC_ARCH}/cprt0.as
|
||||
@${REINPLACE_CMD} -i "" -e 's|504000|${OSVERSION}|g' \
|
||||
${WRKDIR}/${FPCSRCDIR}/rtl/freebsd/${FPC_ARCH}/cprt0.as
|
||||
.elif ${ARCH} == "amd64"
|
||||
@${REINPLACE_CMD} -i "" -e 's|700055|${OSVERSION}|g' ${WRKDIR}/${FPCSRCDIR}/rtl/freebsd/${FPC_ARCH}/cprt0.as
|
||||
@${REINPLACE_CMD} -i "" -e 's|502110|${OSVERSION}|g' ${WRKDIR}/${FPCSRCDIR}/rtl/freebsd/${FPC_ARCH}/gprt0.as
|
||||
@${REINPLACE_CMD} -i "" -e 's|700055|${OSVERSION}|g' ${WRKDIR}/${FPCSRCDIR}/rtl/freebsd/${FPC_ARCH}/prt0.as
|
||||
. if ${OPSYS} == FreeBSD
|
||||
@${REINPLACE_CMD} -i "" -e 's|700055|${OSVERSION}|g' \
|
||||
${WRKDIR}/${FPCSRCDIR}/rtl/freebsd/${FPC_ARCH}/cprt0.as
|
||||
@${REINPLACE_CMD} -i "" -e 's|502110|${OSVERSION}|g' \
|
||||
${WRKDIR}/${FPCSRCDIR}/rtl/freebsd/${FPC_ARCH}/gprt0.as
|
||||
@${REINPLACE_CMD} -i "" -e 's|700055|${OSVERSION}|g' \
|
||||
${WRKDIR}/${FPCSRCDIR}/rtl/freebsd/${FPC_ARCH}/prt0.as
|
||||
. else
|
||||
@${REINPLACE_CMD} -i "" -e 's|400000|${DFLYVERSION}|g' \
|
||||
${WRKSRC}/${FPCSRCDIR}/rtl/dragonfly/${FPC_ARCH}/*.as
|
||||
. endif
|
||||
.endif
|
||||
.if empty(ICONV_LIB)
|
||||
@${REINPLACE_CMD} -e "s|if (s<>'c') or reorder then|if ((s<>'c') and (s<>'iconv')) or reorder then|" \
|
||||
@ -98,22 +117,31 @@ post-patch:
|
||||
|
||||
do-build:
|
||||
# build fpc compiler
|
||||
@cd ${WRKDIR}/${FPCSRCDIR}/compiler && ${SETENV} ${MAKE_ENV} ${MAKE_CMD} cycle ${MAKE_ARGS}
|
||||
(cd ${WRKDIR}/${FPCSRCDIR}/compiler && ${SETENV} ${MAKE_ENV} \
|
||||
${MAKE_CMD} cycle ${MAKE_ARGS} ${BOOTPPC})
|
||||
# build fpcmkcfg
|
||||
@cd ${WRKDIR}/${FPCSRCDIR}/utils/fpcm && ${SETENV} ${MAKE_ENV} ${MAKE_CMD} ${MAKE_ARGS}
|
||||
@cd ${WRKDIR}/${FPCSRCDIR}/packages/fcl-base && ${SETENV} ${MAKE_ENV} ${MAKE_CMD} ${MAKE_ARGS}
|
||||
@cd ${WRKDIR}/${FPCSRCDIR}/packages/fcl-process && ${SETENV} ${MAKE_ENV} ${MAKE_CMD} ${MAKE_ARGS}
|
||||
@cd ${WRKDIR}/${FPCSRCDIR}/utils/fpcmkcfg && ${SETENV} ${MAKE_ENV} ${MAKE_CMD} ${MAKE_ARGS}
|
||||
(cd ${WRKDIR}/${FPCSRCDIR}/utils/fpcm && ${SETENV} ${MAKE_ENV} \
|
||||
${MAKE_CMD} ${MAKE_ARGS} ${NEWPPC})
|
||||
(cd ${WRKDIR}/${FPCSRCDIR}/packages/fcl-base && ${SETENV} ${MAKE_ENV} \
|
||||
${MAKE_CMD} ${MAKE_ARGS} ${NEWPPC})
|
||||
(cd ${WRKDIR}/${FPCSRCDIR}/packages/fcl-process && \
|
||||
${SETENV} ${MAKE_ENV} ${MAKE_CMD} ${MAKE_ARGS} ${NEWPPC})
|
||||
(cd ${WRKDIR}/${FPCSRCDIR}/utils/fpcmkcfg && \
|
||||
${SETENV} ${MAKE_ENV} ${MAKE_CMD} ${MAKE_ARGS} ${NEWPPC})
|
||||
|
||||
do-install:
|
||||
# Installing fpc compiler
|
||||
@cd ${WRKDIR}/${FPCSRCDIR}/rtl && ${SETENV} ${MAKE_ENV} ${MAKE_CMD} install ${MAKE_ARGS}
|
||||
(cd ${WRKDIR}/${FPCSRCDIR}/rtl && ${SETENV} ${MAKE_ENV} \
|
||||
${MAKE_CMD} install ${MAKE_ARGS} ${NEWFPC})
|
||||
# Installing fpc runtime
|
||||
@cd ${WRKDIR}/${FPCSRCDIR}/compiler && ${SETENV} ${MAKE_ENV} ${MAKE_CMD} install ${MAKE_ARGS}
|
||||
(cd ${WRKDIR}/${FPCSRCDIR}/compiler && ${SETENV} ${MAKE_ENV} \
|
||||
${MAKE_CMD} install ${MAKE_ARGS} ${NEWFPC})
|
||||
# Installng fpcmkcfg
|
||||
@cd ${WRKDIR}/${FPCSRCDIR}/utils/fpcmkcfg && ${SETENV} ${MAKE_ENV} ${MAKE_CMD} install ${MAKE_ARGS}
|
||||
(cd ${WRKDIR}/${FPCSRCDIR}/utils/fpcmkcfg && ${SETENV} ${MAKE_ENV} \
|
||||
${MAKE_CMD} install ${MAKE_ARGS} ${NEWFPC})
|
||||
# Installng fpcmake
|
||||
@cd ${WRKDIR}/${FPCSRCDIR}/utils/fpcm && ${SETENV} ${MAKE_ENV} ${MAKE_CMD} install ${MAKE_ARGS}
|
||||
${INSTALL_PROGRAM} ${WRKDIR}/${FPCSRCDIR}/utils/fpcm/fpcmake \
|
||||
${STAGEDIR}${PREFIX}/bin
|
||||
# Installing manpages
|
||||
${INSTALL_MAN} ${WRKDIR}/man/man1/* ${STAGEDIR}${MAN1PREFIX}/man/man1
|
||||
${INSTALL_MAN} ${WRKDIR}/man/man5/* ${STAGEDIR}${MAN1PREFIX}/man/man5
|
||||
|
@ -1,4 +1,4 @@
|
||||
BUILDNAME= ${FPC_ARCH}-freebsd
|
||||
BUILDNAME= ${FPC_ARCH}-${OPSYS:tl}
|
||||
|
||||
PLIST_SUB+= PORTVERSION=${PORTVERSION} \
|
||||
BUILDNAME=${BUILDNAME}
|
||||
@ -6,6 +6,8 @@ PLIST_SUB+= PORTVERSION=${PORTVERSION} \
|
||||
PLIST= ${.CURDIR}/pkg-plist
|
||||
PATCHDIR= ${.CURDIR}/files
|
||||
FILESDIR= ${.CURDIR}/files
|
||||
DFLY_PATCHDIR= ${.CURDIR}/dragonfly
|
||||
DFLY_FILESDIR= ${.CURDIR}/dragonfly
|
||||
WRKSRC= ${WRKDIR}/${PORTNAME}-${PORTVERSION}
|
||||
BUILD_WRKSRC= ${WRKDIR}/${WRKUNITDIR}
|
||||
INSTALL_WRKSRC= ${WRKDIR}/${WRKUNITDIR}
|
||||
@ -39,11 +41,11 @@ post-extract:
|
||||
|
||||
post-patch:
|
||||
.if ${PKGNAMESUFFIX} == "-fpmkunit"
|
||||
@${REINPLACE_CMD} -e 's|\[Linux\]|\[Linux,FreeBSD,NetBSD,OpenBSD\]|g' \
|
||||
@${REINPLACE_CMD} -e 's|\[Linux\]|\[Linux,FreeBSD,DragonFly\]|g' \
|
||||
${WRKDIR}/${WRKUNITDIR}/src/${PKGNAMESUFFIX:S/-//}.pp
|
||||
.endif
|
||||
.if ${PKGNAMESUFFIX} == "-fppkg"
|
||||
@${REINPLACE_CMD} -e 's|packages_freebsd=fcl-net fcl-web|packages_freebsd=fcl-net|g' \
|
||||
@${REINPLACE_CMD} -e 's|packages_${OPSYS:tl}=fcl-net fcl-web|packages_${OPSYS:tl}=fcl-net|g' \
|
||||
${WRKDIR}/${WRKUNITDIR}/Makefile.fpc
|
||||
.endif
|
||||
.if ${PKGNAMESUFFIX} == "-utils"
|
||||
|
@ -6,3 +6,5 @@ SHA256 (freepascal/ppcx64-2.6.4-freebsd.tar.gz) = f74a268a206fbd52d3c92f4e0722cd
|
||||
SIZE (freepascal/ppcx64-2.6.4-freebsd.tar.gz) = 1035650
|
||||
SHA256 (freepascal/fpc-2.6.4.man.tar.gz) = c1d5bc37f96d60b37dd0ea85b6c7244306ae61c01df6053226309a75145ab804
|
||||
SIZE (freepascal/fpc-2.6.4.man.tar.gz) = 43335
|
||||
SHA256 (freepascal/ppcx64-2.6.4-dragonfly.tar.gz) = d537d84302c0e0cb56d45851ab8da664145b9e2619346d35f1e3797a6f924ef9
|
||||
SIZE (freepascal/ppcx64-2.6.4-dragonfly.tar.gz) = 4033024
|
||||
|
@ -81,8 +81,8 @@ lib/fpc/%%PORTVERSION%%/units/%%BUILDNAME%%/rtl/fmtbcd.ppu
|
||||
lib/fpc/%%PORTVERSION%%/units/%%BUILDNAME%%/rtl/fpintres.o
|
||||
lib/fpc/%%PORTVERSION%%/units/%%BUILDNAME%%/rtl/fpintres.ppu
|
||||
lib/fpc/%%PORTVERSION%%/units/%%BUILDNAME%%/rtl/libpfpintres.a
|
||||
lib/fpc/%%PORTVERSION%%/units/%%BUILDNAME%%/rtl/freebsd.o
|
||||
lib/fpc/%%PORTVERSION%%/units/%%BUILDNAME%%/rtl/freebsd.ppu
|
||||
%%FREEBSD%%lib/fpc/%%PORTVERSION%%/units/%%BUILDNAME%%/rtl/freebsd.o
|
||||
%%FREEBSD%%lib/fpc/%%PORTVERSION%%/units/%%BUILDNAME%%/rtl/freebsd.ppu
|
||||
lib/fpc/%%PORTVERSION%%/units/%%BUILDNAME%%/rtl/getopts.o
|
||||
lib/fpc/%%PORTVERSION%%/units/%%BUILDNAME%%/rtl/getopts.ppu
|
||||
lib/fpc/%%PORTVERSION%%/units/%%BUILDNAME%%/rtl/gprt0.o
|
||||
@ -117,7 +117,7 @@ lib/fpc/%%PORTVERSION%%/units/%%BUILDNAME%%/rtl/libperrors.a
|
||||
lib/fpc/%%PORTVERSION%%/units/%%BUILDNAME%%/rtl/libpexeinfo.a
|
||||
lib/fpc/%%PORTVERSION%%/units/%%BUILDNAME%%/rtl/libpfgl.a
|
||||
lib/fpc/%%PORTVERSION%%/units/%%BUILDNAME%%/rtl/libpfmtbcd.a
|
||||
lib/fpc/%%PORTVERSION%%/units/%%BUILDNAME%%/rtl/libpfreebsd.a
|
||||
%%FREEBSD%%lib/fpc/%%PORTVERSION%%/units/%%BUILDNAME%%/rtl/libpfreebsd.a
|
||||
lib/fpc/%%PORTVERSION%%/units/%%BUILDNAME%%/rtl/libpgetopts.a
|
||||
lib/fpc/%%PORTVERSION%%/units/%%BUILDNAME%%/rtl/libpheaptrc.a
|
||||
lib/fpc/%%PORTVERSION%%/units/%%BUILDNAME%%/rtl/libpinitc.a
|
||||
|
Loading…
Reference in New Issue
Block a user