summaryrefslogtreecommitdiff
path: root/lang/fpc/Makefile.units
blob: cc6b57adb7ab281efb7e5c349f5293d9c4211c37 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
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}"
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} || ${PKGNAMESUFFIX:M-ide}
	${REINPLACE_CMD} -e '/globalunit/ s|\.\./packages|${FPCDIR}|' \
		${WRKDIR}/${WRKUNITDIR}/Makefile
.else
	${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