1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-02 01:20:54 +00:00
freebsd-ports/lang/fpc/Makefile.units
2020-11-25 02:57:50 +00:00

73 lines
2.2 KiB
Makefile

BUILDNAME= ${FPC_ARCH}-${OPSYS:tl}
PLIST_SUB+= PORTVERSION=${PORTVERSION} \
BUILDNAME=${BUILDNAME}
PLIST= ${.CURDIR}/pkg-plist
PATCHDIR= ${.CURDIR}/files
FILESDIR= ${.CURDIR}/files
DFLY_PATCHDIR= ${.CURDIR}/dragonfly
DFLY_FILESDIR= ${.CURDIR}/dragonfly
WRKSRC= ${WRKDIR}/${FPCSRCDIR}
BUILD_WRKSRC= ${WRKDIR}/${WRKUNITDIR}
INSTALL_WRKSRC= ${WRKDIR}/${WRKUNITDIR}
OPT+= -Ur
FPCDIR?= ${LOCALBASE}/lib/fpc/${PORTVERSION}
UNITPREFIX= unit-
UNITNAME= ${UNITPREFIX}${PKGNAMESUFFIX:S/-//}${BUILDNAME:S/^/./}${UNITEXTRACT_SUFX}
UNITDIR= lib/fpc/${PORTVERSION}/units/${BUILDNAME}
UNITEXTRACT_SUFX= .tar.gz
EXTRACT_AFTER_ARGS= ${EXTRACTUNITDIR}
MAKE_ARGS+= PP="${LOCALBASE}/bin/fpc" \
FPCFPMAKE="${LOCALBASE}/bin/fpc" \
FPCMAKE="${LOCALBASE}/bin/fpcmake" \
CPU_TARGET=${FPC_ARCH} \
OS_TARGET=${OPSYS:tl} \
COMPILER_OPTIONS="${OPT}" \
BSDHIER=1 \
VERBOSE=1 \
INSTALL="${INSTALL_DATA}" \
INSTALLEXE="${INSTALL_PROGRAM}" \
INSTALLSCR="${INSTALL_SCRIPT}" \
INSTALL_PREFIX="${STAGEDIR}${PREFIX}" \
FPC_LDPATH=${FPC_LDPATH}
ALL_TARGET= fpc_baseinfo release
.if ${PORT_OPTIONS:MEXAMPLES} && defined(HAVE_EXAMPLES)
LATE_INSTALL_ARGS= fpc_exampleinstall
.endif
post-extract:
@cd ${WRKDIR}/${WRKUNITDIR} && \
${FIND} ${WRKSRC} -type d -name .svn | ${XARGS} ${RM} -r
.if ${PKGNAMESUFFIX:M-utils}
${REINPLACE_CMD} -e '/globalunit/ s|\.\./packages|${FPCDIR}|' \
${WRKDIR}/${WRKUNITDIR}/Makefile
.endif
.if ${PKGNAMESUFFIX:M-ide}
${REINPLACE_CMD} -e '/globalunit/ s|\.\./\.\./packages|${FPCDIR}|' \
${WRKDIR}/${WRKUNITDIR}/Makefile
.endif
.if ${PKGNAMESUFFIX:N-ide:N-utils}
${REINPLACE_CMD} -e '/globalunit/ {s|\.\.|${FPCDIR}|;}' \
${WRKDIR}/${WRKUNITDIR}/Makefile
.endif
post-patch:
.if ${PKGNAMESUFFIX} == "-fppkg"
@${REINPLACE_CMD} -e 's|packages_${OPSYS:tl}=fcl-net fcl-web|packages_${OPSYS:tl}=fcl-net|g' \
${WRKDIR}/${WRKUNITDIR}/Makefile.fpc
.endif
.if ${PKGNAMESUFFIX} == "-rtl-extra"
@${REINPLACE_CMD} -e 's|android,linux,|android,linux,freebsd,dragonfly,|g' \
${WRKDIR}/${WRKUNITDIR}/fpmake.pp
.endif
.if ${PKGNAMESUFFIX} == "-rtl-generics"
@${REINPLACE_CMD} -e 's|googleapi|rtl-generics|g' \
${WRKDIR}/${WRKUNITDIR}/Makefile.fpc \
${WRKDIR}/${WRKUNITDIR}/Makefile
.endif