summaryrefslogtreecommitdiff
path: root/devel/p4api/Makefile
blob: ab04764ae936a8ca6c46bccd35fdad41546d2e49 (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
58
59
60
61
62
PORTNAME=	p4api
PORTVERSION=	${YEAR}.${MAJOR}.${MINOR}
PORTREVISION=	1
CATEGORIES=	devel
# Perforce stupidly rerolls their distfiles on a regular basis, updating the
# files' timestamps when they do, which changes the zip file's checksum.  Work
# around that by cacheing the distfile in LOCAL and using that version to make
# distinfo
MASTER_SITES=	LOCAL/asomers/perforce/p4:zip \
		ftp://ftp.perforce.com/perforce/${P4VERSION}/doc/manuals/p4api/:pdf \
		https://swarm.workshop.perforce.com/projects/perforce_software-p4/archives/:zip
DIST_SUBDIR=	perforce/p4
DISTNAME=	${YEAR}-${MAJOR}
DISTFILES=	${ZIP_FILES}:zip p4api.pdf:pdf
EXTRACT_ONLY=	${ZIP_FILES}

MAINTAINER=	asomers@FreeBSD.org
COMMENT=	Perforce API (static libraries and header files)

LICENSE=	BSD2CLAUSE
LICENSE_FILE=	${WRKSRC}/LICENSE

BROKEN_FreeBSD_11_powerpc64=	fails to build: /bin/sh: clang++: not found
BROKEN_FreeBSD_12_powerpc64=	fails to build: /bin/sh: clang++: not found

BUILD_DEPENDS=	${JAM}:devel/jam

OPTIONS_DEFINE=	DOCS EXAMPLES

USES=		zip

WRKSRC=		${WRKDIR}/${DISTNAME}

.include <bsd.port.pre.mk>
.include "../p4/Makefile.inc"

# Sadly, Jam always returns 1 even on success.  Ignore its return value and
# detect build errors during the install phase.
do-build:
	cd ${WRKSRC} && ${SETENV} C++="${CXX}" C++FLAGS="${CXXFLAGS}" \
		CCFLAGS="${CFLAGS}" \
		LINKFLAGS="${LDFLAGS}" \
		OSVER=${OSVER} \
		API=1 \
		TYPE=pic \
		${JAM} -dx -j${MAKE_JOBS_NUMBER} || true

do-install:
	${MKDIR} ${STAGEDIR}${PREFIX}/include/perforce
	cd ${WRKSRC}/p4-bin/bin.pic/p4api-*/include/p4 && ${COPYTREE_SHARE} . ${STAGEDIR}${PREFIX}/include/perforce
	${MKDIR} ${STAGEDIR}${PREFIX}/lib/perforce
	cd ${WRKSRC}/p4-bin/bin.pic/p4api-*/lib && ${COPYTREE_SHARE} . ${STAGEDIR}${PREFIX}/lib/perforce

do-install-DOCS-on:
	${MKDIR} ${STAGEDIR}${DOCSDIR}
	${INSTALL_DATA} ${DISTDIR}/${DIST_SUBDIR}/p4api.pdf ${STAGEDIR}${DOCSDIR}

do-install-EXAMPLES-on:
	${MKDIR} ${STAGEDIR}${EXAMPLESDIR}
	cd ${WRKSRC}/p4-bin/bin.pic/p4api-*/sample && ${COPYTREE_SHARE} . ${STAGEDIR}${EXAMPLESDIR}

.include <bsd.port.post.mk>