summaryrefslogtreecommitdiff
path: root/devel/libftdi/Makefile
blob: fb5c9ec786d7542dca3118d6635b04d898060e05 (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

PORTNAME=	libftdi
PORTVERSION=	0.20
PORTREVISION=	16
CATEGORIES=	devel
MASTER_SITES=	http://www.intra2net.com/en/developer/libftdi/download/

MAINTAINER=	yuri@FreeBSD.org
COMMENT=	Library (using libusb) to talk to FTDI chips

LICENSE=	GPLv2 LGPL21
LICENSE_COMB=	multi
LICENSE_FILE_GPLv2=	${WRKSRC}/COPYING.GPL
LICENSE_FILE_LGPL21=	${WRKSRC}/COPYING.LIB

USES=		cmake pkgconfig
CMAKE_ARGS=	-DDOCUMENTATION:BOOL=OFF -DEXAMPLES:BOOL=OFF
USE_LDCONFIG=	yes

OPTIONS_DEFINE=	BOOST PYTHON
OPTIONS_DEFAULT=BOOST PYTHON
OPTIONS_SUB=	yes

BOOST_DESC=		C++ bindings (requires Boost)
BOOST_LIB_DEPENDS=	libboost_system.so:devel/boost-libs
BOOST_CMAKE_BOOL=	FTDIPP
BOOST_CXXFLAGS=		-I${LOCALBASE}/include

PYTHON_DESC=		Python bindings
PYTHON_BUILD_DEPENDS=	swig:devel/swig
PYTHON_CMAKE_BOOL=	PYTHON_BINDINGS
PYTHON_USES=		python
PYTHON_USE=		PYTHON=py3kplist

post-patch:
	@${REINPLACE_CMD} \
		-e '/includedir/s|/$${PROJECT_NAME}||' \
		-e '/SET.*LIB_SUFFIX/s/64/""/' \
		-e 's|lib$${LIB_SUFFIX}/pkgconfig|libdata/pkgconfig|' \
		${WRKSRC}/CMakeLists.txt
	@${REINPLACE_CMD} 's|SITEPACKAGE.*ABSOLUTE|SITEPACKAGE ${PYTHON_SITELIBDIR} ABSOLUTE|' \
		${WRKSRC}/bindings/CMakeLists.txt

post-install-PYTHON-on:
	${PYTHON_CMD} -m compileall -d ${PYTHON_SITELIBDIR} ${STAGEDIR}${PYTHON_SITELIBDIR}
	${PYTHON_CMD} -O -m compileall -d ${PYTHON_SITELIBDIR} ${STAGEDIR}${PYTHON_SITELIBDIR}
	@${STRIP_CMD} ${STAGEDIR}${PYTHON_SITELIBDIR}/_ftdi.so

.include <bsd.port.mk>