diff --git a/devel/libftdi/Makefile b/devel/libftdi/Makefile index e4061e24a3f0..7d40c79a1a64 100644 --- a/devel/libftdi/Makefile +++ b/devel/libftdi/Makefile @@ -2,67 +2,49 @@ PORTNAME= libftdi PORTVERSION= 0.20 -PORTREVISION= 2 +PORTREVISION= 3 CATEGORIES= devel MASTER_SITES= http://www.intra2net.com/en/developer/libftdi/download/ MAINTAINER= ports@FreeBSD.org COMMENT= Library (using libusb) to talk to FTDI chips -OPTIONS_DEFINE+= BOOST PYTHON -BOOST_DESC= Build with boost +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 +USE_LDCONFIG= yes + +OPTIONS_DEFINE= BOOST DOCS PYTHON +OPTIONS_DEFAULT=BOOST DOCS PYTHON +OPTIONS_SUB= yes + +BOOST_DESC= C++ bindings (requires Boost) +BOOST_LIB_DEPENDS= libboost_system.so:${PORTSDIR}/devel/boost-libs +BOOST_CMAKE_ON= -DFTDIPP:BOOL=ON +BOOST_CMAKE_OFF= -DFTDIPP:BOOL=OFF +BOOST_CXXFLAGS= -I${LOCALBASE}/include + PYTHON_DESC= Python bindings - -USES= pathfix pkgconfig libtool -USE_AUTOTOOLS= autoconf automake -GNU_CONFIGURE= yes -CFLAGS+= -I${LOCALBASE}/include -USE_LDCONFIG= yes -INSTALL_TARGET= install-strip - -BUILD_DEPENDS= ${LOCALBASE}/bin/autoreconf-2.69:${PORTSDIR}/devel/autoconf \ - ${LOCALBASE}/bin/automake-1.14:${PORTSDIR}/devel/automake \ - ${LOCALBASE}/bin/libtoolize:${PORTSDIR}/devel/libtool - -PORTDOCS= COPYING.LIB ChangeLog README - -.include - -.if ${PORT_OPTIONS:MBOOST} -PLIST_SUB+= BOOST="" -CONFIGURE_ARGS+= --with-boost -CXXFLAGS+= "-I${LOCALBASE}/include" -LIB_DEPENDS+= libboost_system.so:${PORTSDIR}/devel/boost-libs -.else -PLIST_SUB+= BOOST="@comment " -CONFIGURE_ARGS+= --without-boost -.endif -.if ${PORT_OPTIONS:MPYTHON} -PLIST_SUB+= PYTHON="" PYDISTUTILS_EGGINFO=${PYDISTUTILS_EGGINFO} -CONFIGURE_ARGS+= --enable-python-binding -CONFIGURE_ENV+= SWIG="${LOCALBASE}/bin/swig2.0" -BUILD_DEPENDS+= swig2.0:${PORTSDIR}/devel/swig20 -USE_PYTHON= yes -.else -PLIST_SUB+= PYTHON="@comment " -.endif - -EXTRA_PATCHES= ${FILESDIR}/extra-patch-configure.in - -OPTIONS_DEFINE= DOCS -OPTIONS_DEFAULT= DOCS +PYTHON_BUILD_DEPENDS= swig2.0:${PORTSDIR}/devel/swig20 +PYTHON_CMAKE_ON= -DPYTHON_BINDINGS:BOOL=ON +PYTHON_CMAKE_OFF= -DPYTHON_BINDINGS:BOOL=OFF +PYTHON_USES= python post-patch: - ${REINPLACE_CMD} -E -e \ - 's:\$$\(libdir\)/pkgconfig:${PREFIX}/libdata/pkgconfig:' \ - ${WRKSRC}/Makefile.am ${WRKSRC}/Makefile.in - -pre-configure: - cd ${WRKSRC} && ${AUTORECONF} --force --install - echo "done pre-conf" + @${REINPLACE_CMD} \ + -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: - ${MKDIR} ${STAGEDIR}${DOCSDIR} - ${INSTALL_DATA} ${PORTDOCS:S,^,${WRKSRC}/,} ${STAGEDIR}${DOCSDIR}/ + ${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 diff --git a/devel/libftdi/files/extra-patch-configure.in b/devel/libftdi/files/extra-patch-configure.in deleted file mode 100644 index c292da005de5..000000000000 --- a/devel/libftdi/files/extra-patch-configure.in +++ /dev/null @@ -1,34 +0,0 @@ ---- configure.in.orig 2011-02-28 15:03:24.000000000 +0200 -+++ configure.in 2011-02-28 15:04:24.000000000 +0200 -@@ -7,30 +7,7 @@ - AM_PROG_LIBTOOL - AC_PROG_CXX - --dnl check for libusb-config --AC_CHECK_TOOL(HAVELIBUSB, libusb-config) -- --if test ! -z "$HAVELIBUSB"; then -- LIBUSB_CFLAGS=`$HAVELIBUSB --cflags` -- LIBUSB_LIBS=`$HAVELIBUSB --libs` -- -- CFLAGS="$CFLAGS $LIBUSB_CFLAGS" -- LIBS="$LIBS $LIBUSB_LIBS" --else -- AC_MSG_ERROR([*** libusb-config not found. You need a working libusb installation.]) --fi -- --dnl check for version of libusb --AC_MSG_CHECKING([if libusb version is >= 0.1.7]) --libusb_version_needed="1007" --libusb_version=`$HAVELIBUSB --version | sed -e "s/libusb //" | awk 'BEGIN { FS = "."; } { printf "%d", ($''1 * 1000 + $''2) * 1000 + $''3;}'` -- --if test $libusb_version -lt $libusb_version_needed; then -- AC_MSG_RESULT(no) -- AC_MSG_ERROR([*** libusb is too old ($libusb_version). You need a libusb installation newer or equal to 0.1.7.]) --else -- AC_MSG_RESULT(yes) --fi -+LIBS="$LIBS -lusb" - - ENABLE_ASYNC_MODE=0 - AC_ARG_WITH(async-mode, diff --git a/devel/libftdi/pkg-plist b/devel/libftdi/pkg-plist index c4ce2983e636..2f2b6b97cbf8 100644 --- a/devel/libftdi/pkg-plist +++ b/devel/libftdi/pkg-plist @@ -1,19 +1,10 @@ -bin/baud_test -bin/bitbang -bin/bitbang2 -bin/bitbang_cbus -bin/bitbang_ft2232 -bin/find_all -%%BOOST%%bin/find_all_pp bin/libftdi-config -bin/serial_test -bin/simple include/ftdi.h %%BOOST%%include/ftdi.hpp %%PYTHON%%%%PYTHON_SITELIBDIR%%/_ftdi.so %%PYTHON%%%%PYTHON_SITELIBDIR%%/ftdi.py %%PYTHON%%%%PYTHON_SITELIBDIR%%/ftdi.pyc -%%PYTHON%%%%PYTHON_SITELIBDIR%%/%%PYDISTUTILS_EGGINFO%% +%%PYTHON%%%%PYTHON_SITELIBDIR%%/ftdi.pyo lib/libftdi.a lib/libftdi.so lib/libftdi.so.1