aboutsummaryrefslogtreecommitdiff
path: root/devel/ice37/Makefile
blob: ac4bf989191bd6223afe126081672145da7bfd6b (plain) (blame)
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
# $FreeBSD$

PORTNAME=		Ice
PORTVERSION=		3.7.2
DISTVERSIONPREFIX=	v
CATEGORIES=		devel
PKGNAMESUFFIX?=		37

MAINTAINER=		grembo@FreeBSD.org
COMMENT=		Modern alternative to object middleware such as CORBA/COM/DCOM/COM+

LICENSE=		GPLv2

SLAVE_PORT?=		no
CONFLICTS=		Ice py*-Ice php*-Ice

.if ${SLAVE_PORT} == "no"
LIB_DEPENDS=		libexpat.so:textproc/expat2 \
			liblmdb.so:databases/lmdb \
			libmcpp.so:devel/mcpp
.else
LIB_VRS=		${PORTVERSION:R:S|.||g}
LIB_DEPENDS+=		libIce.so.${LIB_VRS}:devel/ice37
PLIST_SUB+=		LIB_VERSION="${PORTVERSION}" LIB_VRS="${LIB_VRS}"
.endif

DESTDIRNAME=		NOT_USED # setting DESTDIR interferes with Ice's Makefiles

OPTIONS_DEFINE?=	DEBUG STATIC TEST
OPTIONS_SUB=		yes

USES+=			compiler:c++14-lang iconv gmake
CONFIGS=		shared
DEBUG_MAKE_ENV=		OPTIMIZE=no
TEST_ALL_TARGET_OFF=	srcs
MAKE_ARGS+=		V=1

CONFIGS=		shared

.if ${SLAVE_PORT} == "no"
USES+=			ssl
CONFIGS+=		cpp11-shared
STATIC_VARS=		configs+="static cpp11-static"
TEST_USES=		python:build shebangfix
TEST_VARS=		shebang_glob=*.py
TEST_BUILD_DEPENDS=	${PYTHON_PKGNAMEPREFIX}passlib>0:security/py-passlib@${PY_FLAVOR}
.endif

.include <bsd.port.options.mk>

USE_LDCONFIG=		yes
BUILD_WRKSRC?=		${WRKSRC}/cpp
INSTALL_WRKSRC?=	${WRKSRC}/cpp
USE_GITHUB=		yes
GH_ACCOUNT=		zeroc-ice
GH_PROJECT=		ice

# determine if we are on a 64-bit arch
.if ${ARCH:M*64*}
MAKE_ENV+=		LP64=yes
.endif

.include <bsd.port.pre.mk>

.if ${PREFIX} != ${LOCALBASE}
PYSITEDIR=		${PREFIX}${PYTHON_SITELIBDIR:S|^${LOCALBASE}||}
.else
PYSITEDIR=		${PYTHON_SITELIBDIR}
.endif

.if defined(PYTHON_VER) && (${PYTHON_VER} == "2.7" || ${PYTHON_VER} == "3.4")
PLIST_SUB+=		PYTHONGT34="@comment "
.else
PLIST_SUB+=		PYTHONGT34=""
.endif

post-patch:
	@${SED} 's|%%CONFIGS%%|${CONFIGS}|g; \
		s|%%DATADIR%%|${STAGEDIR}${DATADIR}|g; \
		s|%%DOCSDIR%%|${STAGEDIR}${DOCSDIR}|g; \
		s|%%ICONV_LIB%%|${ICONV_LIB}|g; \
		s|%%INSTALL_PROGRAM%%|${INSTALL_PROGRAM}|g; \
		s|%%INSTALL_DATA%%|${INSTALL_DATA}|g; \
		s|%%LOCALBASE%%|${LOCALBASE}|g; \
		s|%%MANPREFIX%%|${STAGEDIR}${MANPREFIX}|g; \
		s|%%OPENSSLLIB%%|${OPENSSLLIB}|g; \
		s|%%OPENSSLINC%%|${OPENSSLINC}|g; \
		s|%%PREFIX%%|${STAGEDIR}${PREFIX}|g;' \
		${FILESDIR}/Make.rules.FreeBSD > ${WRKSRC}/config/Make.rules.FreeBSD
	@${REINPLACE_CMD} 's|%%CHMOD%%|${CHMOD}|g; \
		s|%%INSTALL_DATA%%|${INSTALL_DATA}|g; \
		s|%%INSTALL_LIB%%|${INSTALL_LIB}|g; \
		s|%%INSTALL_PROGRAM%%|${INSTALL_PROGRAM}|g; \
		s|%%MKDIR%%|${MKDIR}|g; \
		s|%%MV%%|${MV}|g; \
		s|%%RM%%|${RM}|g;' \
		${WRKSRC}/config/Make.project.rules
	@${REINPLACE_CMD} 's|%%INSTALL_PROGRAM%%|${INSTALL_PROGRAM}|g; \
		s|%%INSTALL_DATA%%|${INSTALL_DATA}|g; \
		s|%%ICONV_LIB%%|${ICONV_LIB}|g; \
		s|%%PYTHON_CMD%%|${PYTHON_CMD}|g; \
		s|%%PYTHON_SITELIBDIR%%|${STAGEDIR}${PYSITEDIR}|g; \
		s|%%PREFIX%%|${PREFIX}|g; \
		s|%%LOCALBASE%%|${LOCALBASE}|g' ${WRKSRC}/python/config/Make.rules
	@${REINPLACE_CMD} 's|%%CHMOD%%|${CHMOD}|g; \
		s|%%INSTALL_DATA%%|${INSTALL_DATA}|g; \
		s|%%INSTALL_LIB%%|${INSTALL_LIB}|g; \
		s|%%INSTALL_PROGRAM%%|${INSTALL_PROGRAM}|g; \
		s|%%MKDIR%%|${MKDIR}|g; \
		s|%%MV%%|${MV}|g; \
		s|%%RM%%|${RM}|g;' \
		${WRKSRC}/python/python/Makefile
	@${REINPLACE_CMD} 's|%%INSTALL_PROGRAM%%|${INSTALL_PROGRAM}|g; \
		s|%%INSTALL_DATA%%|${INSTALL_DATA}|g; \
		s|%%PREFIX%%|${PREFIX}|g; \
		s|%%LOCALBASE%%|${LOCALBASE}|g;' ${WRKSRC}/php/Makefile
	@${REINPLACE_CMD} 's|%%LOCALBASE%%|${LOCALBASE}|g;' \
		${WRKSRC}/scripts/Util.py
	@${REINPLACE_CMD} 's|%%LOCALBASE%%|${LOCALBASE}|g;' \
		${WRKSRC}/scripts/Glacier2Util.py

IS_JAILED_CMD=		${SYSCTL} -n security.jail.jailed
JAILED_FILTER=		--rfilter=IceDiscovery \
			--rfilter=priority \
			--rfilter=threadPoolPriority \
			--rfilter=udp

do-test-TEST-on:
.for CONFIG in ${CONFIGS}
	@${ECHO} Testing configuration ${CONFIG}
	cd ${BUILD_WRKSRC} && \
		${SETENV} LC_ALL=en_US.UTF-8 ${PYTHON_CMD} ./allTests.py \
		--config=${CONFIG} \
		$$(${TEST} $$(${IS_JAILED_CMD}) -eq 1 \
			&& ${ECHO} ${JAILED_FILTER})
.endfor

.if ${SLAVE_PORT} == "no"

pre-install:
	@${MKDIR} ${STAGEDIR}${DATADIR}

post-install:
	${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/*.so.*
	@cd ${WRKSRC} && ${GMAKE} install-doc install-slice
.endif

.include <bsd.port.post.mk>