Commit 73237408 authored by pi's avatar pi
Browse files

New port: devel/libftdi1

Talking to FTDI's FT2232C, FT232BM and FT245BM type chips including
the popular bitbang mode, using libusb.

WWW: http://www.intra2net.com/en/developer/libftdi/

Please note that this is an updated version of devel/libftdi,
but dependencies require both versions to be available for a while.

PR:		191656
Submitted by:	uffe@uffe.org
parent cf05beae
......@@ -1007,6 +1007,7 @@
SUBDIR += libfortuna
SUBDIR += libfreefare
SUBDIR += libftdi
SUBDIR += libftdi1
SUBDIR += libg19
SUBDIR += libg19draw
SUBDIR += libgalago
......
# $FreeBSD$
PORTNAME= libftdi1
PORTVERSION= 1.1
CATEGORIES= devel
MASTER_SITES= http://www.intra2net.com/en/developer/libftdi/download/
MAINTAINER= uffe@uffe.org
COMMENT= Library (using libusb) to talk to FTDI chips
LICENSE= GPLv2
LIB_DEPENDS= libconfuse.so:${PORTSDIR}/devel/libconfuse
OPTIONS_DEFINE= PYTHON BOOST DOCS EXAMPLES
OPTIONS_DEFAULT= PYTHON BOOST DOCS EXAMPLES
OPTIONS_SUB= yes
BOOST_DESC= Build with boost
PYTHON_DESC= Build Python bindings
USES= pathfix pkgconfig cmake tar:bzip2
USE_LDCONFIG= yes
PORTDOCS= COPYING.LIB ChangeLog README
.include <bsd.port.options.mk>
.if ${PORT_OPTIONS:MDOCS}
CMAKE_ARGS+= -DDOCUMENTATION:BOOL=true
.else
CMAKE_ARGS+= -DDOCUMENTATION:BOOL=false
.endif
.if ${PORT_OPTIONS:MEXAMPLES}
CMAKE_ARGS+= -DEXAMPLES:BOOL=true
.else
CMAKE_ARGS+= -DEXAMPLES:BOOL=false
.endif
.if ${PORT_OPTIONS:MPYTHON}
USE_PYTHON= 2
CMAKE_ARGS+= -DPYTHON_BINDINGS:BOOL=true
BUILD_DEPENDS+= swig2.0:${PORTSDIR}/devel/swig20
.else
CMAKE_ARGS+= -DPYTHON_BINDINGS:BOOL=false
.endif
.if ${PORT_OPTIONS:MBOOST}
CMAKE_ARGS+= -DFTDIPP:BOOL=true
LIB_DEPENDS+= libboost_system.so:${PORTSDIR}/devel/boost-libs
.else
CMAKE_ARGS+= -DFTDIPP:BOOL=false
.endif
post-install:
.if ${PORT_OPTIONS:MEXAMPLES}
.for fname in baud_test bitbang bitbang2 bitbang_cbus bitbang_ft2232 eeprom find_all serial_test simple stream_test
${INSTALL_PROGRAM} ${WRKSRC}/examples/${fname} ${STAGEDIR}${PREFIX}/bin/ftdi1_${fname}_example
.endfor
.if ${PORT_OPTIONS:MBOOST}
.for fname in find_all_pp
${INSTALL_PROGRAM} ${WRKSRC}/examples/${fname} ${STAGEDIR}${PREFIX}/bin/ftdi1_${fname}_example
.endfor
.endif
.endif
.if ${PORT_OPTIONS:MDOCS}
${MKDIR} ${STAGEDIR}${DOCSDIR}
${INSTALL_DATA} ${PORTDOCS:S,^,${WRKSRC}/,} ${STAGEDIR}${DOCSDIR}/
.endif
.include <bsd.port.mk>
SHA256 (libftdi1-1.1.tar.bz2) = c0b1af1a13e2c6682a1d8041e5b164a1e0d90267cd378bb51e059bd62f821e21
SIZE (libftdi1-1.1.tar.bz2) = 99690
--- CMakeLists.txt.orig 2014-08-02 12:32:47.000000000 +0200
+++ CMakeLists.txt 2014-08-02 12:34:30.000000000 +0200
@@ -168,7 +168,7 @@
configure_file(${CMAKE_SOURCE_DIR}/libftdi1.pc.in ${CMAKE_BINARY_DIR}/libftdi1.pc @ONLY)
configure_file(${CMAKE_SOURCE_DIR}/libftdipp1.pc.in ${CMAKE_BINARY_DIR}/libftdipp1.pc @ONLY)
install(FILES ${CMAKE_BINARY_DIR}/libftdi1.pc ${CMAKE_BINARY_DIR}/libftdipp1.pc
- DESTINATION lib${LIB_SUFFIX}/pkgconfig)
+ DESTINATION libdata${LIB_SUFFIX}/pkgconfig)
if (UNIX OR MINGW)
configure_file ( libftdi1-config.in ${CMAKE_CURRENT_BINARY_DIR}/libftdi1-config @ONLY )
--- cmake/FindUSB1.cmake.orig 2014-08-02 12:05:59.000000000 +0200
+++ cmake/FindUSB1.cmake 2014-08-02 12:06:34.000000000 +0200
@@ -26,7 +26,7 @@
PATH_SUFFIXES libusb-1.0
PATHS ${PC_LIBUSB_INCLUDEDIR} ${PC_LIBUSB_INCLUDE_DIRS})
- FIND_LIBRARY(LIBUSB_LIBRARIES NAMES usb-1.0
+ FIND_LIBRARY(LIBUSB_LIBRARIES NAMES usb-1.0 usb
PATHS ${PC_LIBUSB_LIBDIR} ${PC_LIBUSB_LIBRARY_DIRS})
include(FindPackageHandleStandardArgs)
--- examples/CMakeLists.txt.orig 2014-08-03 23:07:13.000000000 +0200
+++ examples/CMakeLists.txt 2014-08-03 23:08:06.000000000 +0200
@@ -36,8 +36,8 @@
if(FTDI_BUILD_CPP)
if(Boost_FOUND)
message(STATUS "Building libftdi++ examples.")
- include_directories(BEFORE ${CMAKE_SOURCE_DIR}/ftdipp
- ${Boost_INCLUDE_DIRS})
+ include_directories(BEFORE ${CMAKE_SOURCE_DIR}/ftdipp)
+ include_directories(AFTER ${Boost_INCLUDE_DIRS})
# Target
add_executable(find_all_pp find_all_pp.cpp)
libftdi1 - A library (using libusb) to talk to FTDI's FT2232C,
FT232BM and FT245BM type chips including the popular bitbang mode.
Note: When you get a -5 error "can't claim usb device" during
ftdi_usb_open(), make sure the kernel ftdi_sio driver is unloaded.
WWW: http://www.intra2net.com/en/developer/libftdi/
bin/ftdi_eeprom
bin/libftdi1-config
bin/ftdi1_baud_test_example
bin/ftdi1_bitbang2_example
bin/ftdi1_bitbang_cbus_example
bin/ftdi1_bitbang_example
bin/ftdi1_bitbang_ft2232_example
bin/ftdi1_eeprom_example
bin/ftdi1_find_all_example
%%BOOST%%bin/ftdi1_find_all_pp_example
bin/ftdi1_serial_test_example
bin/ftdi1_simple_example
bin/ftdi1_stream_test_example
libdata/pkgconfig/libftdi1.pc
libdata/pkgconfig/libftdipp1.pc
lib/cmake/libftdi1/LibFTDI1Config.cmake
lib/cmake/libftdi1/UseLibFTDI1.cmake
@dirrmtry lib/cmake/libftdi1
@dirrmtry lib/cmake
include/libftdi1/ftdi.h
%%BOOST%%include/libftdi1/ftdi.hpp
@dirrmtry include/libftdi1
lib/libftdi1.a
lib/libftdi1.so
lib/libftdi1.so.2
lib/libftdi1.so.2.1.0
%%BOOST%%lib/libftdipp1.a
%%BOOST%%lib/libftdipp1.so
%%BOOST%%lib/libftdipp1.so.2
%%BOOST%%lib/libftdipp1.so.2.1.0
%%PYTHON%%%%PYTHON_SITELIBDIR%%/_ftdi1.so
%%PYTHON%%%%PYTHON_SITELIBDIR%%/ftdi1.py
%%PYTHON%%share/libftdi/examples/complete.py
%%PYTHON%%share/libftdi/examples/simple.py
%%PYTHON%%@dirrmtry share/libftdi/examples
%%PYTHON%%@dirrmtry share/libftdi
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment