1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-21 00:25:50 +00:00

New port: devel/libmpsse

Open source library for SPI/I2C control via FTDI chips

Libmpsse is a library for interfacing with SPI/I2C devices via FTDI's
FT-2232 family of USB chips. Based around the libftdi library.

WWW: http://code.google.com/p/libmpsse/

PR:		188575
Submitted by:	uffe@uffe.org
This commit is contained in:
Kurt Jaeger 2014-08-03 11:09:34 +00:00
parent 59168d1ba9
commit 29ef2c74f5
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=363874
6 changed files with 134 additions and 0 deletions

View File

@ -1060,6 +1060,7 @@
SUBDIR += libmowgli
SUBDIR += libmowgli2
SUBDIR += libmpcbdm
SUBDIR += libmpsse
SUBDIR += libmsiecf
SUBDIR += libmsocket
SUBDIR += libmtrie

51
devel/libmpsse/Makefile Normal file
View File

@ -0,0 +1,51 @@
# $FreeBSD$
PORTNAME= libmpsse
PORTVERSION= 1.3
CATEGORIES= devel
MASTER_SITES= ${MASTER_SITE_GOOGLE_CODE}
MAINTAINER= uffe@uffe.org
COMMENT= Open source library for SPI/I2C control via FTDI chips
LICENSE= GPLv2
BUILD_DEPENDS= swig2.0:${PORTSDIR}/devel/swig20
LIB_DEPENDS= libftdi.so:${PORTSDIR}/devel/libftdi
USES= gmake pkgconfig
USE_AUTOTOOLS= autoconf
USE_LDCONFIG= yes
USE_PYTHON= 2
GNU_CONFIGURE= yes
CFLAGS+= -I${LOCALBASE}/include -fPIC
LDFLAGS+= -L${LOCALBASE}/lib -lftdi
CONFIGURE_WRKSRC= ${WRKSRC}/src
BUILD_WRKSRC= ${WRKSRC}/src
INSTALL_WRKSRC= ${WRKSRC}/src
CONFIGURE_ENV= SWIG="swig2.0"
MAKE_ARGS= CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}"
PORTDOCS= INSTALL COPYING README README.* AN_135_MPSSE_Basics.pdf
PORTEXAMPLES= *
PLIST_FILES= ${LOCALBASE}/lib/libmpsse.so ${LOCALBASE}/lib/libmpsse.a ${LOCALBASE}/include/mpsse.h \
${PYTHON_SITELIBDIR}/mpsse.py ${PYTHON_SITELIBDIR}/pylibmpsse.py ${PYTHON_SITELIBDIR}/_pylibmpsse.so
pre-install:
${MKDIR} ${STAGEDIR}/${LOCALBASE}/lib/
post-install:
${MKDIR} ${STAGEDIR}/${DOCSDIR}
(cd ${WRKSRC}/docs && ${COPYTREE_SHARE} . ${STAGEDIR}${DOCSDIR} "! -name Makefile")
${MKDIR} ${STAGEDIR}/${EXAMPLESDIR}
(cd ${WRKSRC}/src/examples && ${COPYTREE_SHARE} . ${STAGEDIR}${EXAMPLESDIR} "! -name Makefile")
post-stage:
${STRIP_CMD} ${STAGEDIR}${PYTHON_SITELIBDIR}/_pylibmpsse.so
${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/libmpsse.so
.include <bsd.port.mk>

2
devel/libmpsse/distinfo Normal file
View File

@ -0,0 +1,2 @@
SHA256 (libmpsse-1.3.tar.gz) = 08f2a0025074720d40e29430089b1ab78d764756cc5d2bcb3148d98131b4074b
SIZE (libmpsse-1.3.tar.gz) = 652047

View File

@ -0,0 +1,31 @@
--- src/Makefile.in.orig 2014-08-02 23:32:56.329217465 +0200
+++ src/Makefile.in 2014-08-02 23:35:17.471137680 +0200
@@ -43,9 +43,10 @@
-o _pylib$(TARGET).so $(LDFLAGS) $(INC)
pyswig-install:
- install -D -m644 pylib$(TARGET).py $(DESTDIR)/$(PYLIB)/pylib$(TARGET).py
- install -D -m644 _pylib$(TARGET).so $(DESTDIR)/$(PYLIB)/_pylib$(TARGET).so
- install -D -m644 $(TARGET).py $(DESTDIR)/$(PYLIB)/$(TARGET).py
+ install -d -m755 $(DESTDIR)/$(PYLIB)
+ install -m644 pylib$(TARGET).py $(DESTDIR)/$(PYLIB)/pylib$(TARGET).py
+ install -m644 _pylib$(TARGET).so $(DESTDIR)/$(PYLIB)/_pylib$(TARGET).so
+ install -m644 $(TARGET).py $(DESTDIR)/$(PYLIB)/$(TARGET).py
pyswig-uninstall:
rm -f $(DESTDIR)/$(PYLIB)/$(TARGET).* \
@@ -58,9 +59,11 @@
py-uninstall:
install: py$(BUILD)-install
- install -D -m644 lib$(TARGET).so $(DESTDIR)/$(LIBDIR)/lib$(TARGET).so
- install -D -m644 lib$(TARGET).a $(DESTDIR)/$(LIBDIR)/lib$(TARGET).a
- install -D -m644 $(TARGET).h $(DESTDIR)/$(INCDIR)/$(TARGET).h
+ install -d -m755 $(DESTDIR)/$(LIBDIR)
+ install -m644 lib$(TARGET).so $(DESTDIR)/$(LIBDIR)/lib$(TARGET).so
+ install -m644 lib$(TARGET).a $(DESTDIR)/$(LIBDIR)/lib$(TARGET).a
+ install -d -m755 $(DESTDIR)/$(INCDIR)
+ install -m644 $(TARGET).h $(DESTDIR)/$(INCDIR)/$(TARGET).h
uninstall: py$(BUILD)-uninstall
rm -f $(DESTDIR)/$(LIBDIR)/lib$(TARGET).so \

View File

@ -0,0 +1,43 @@
--- src/configure.ac.orig 2014-04-13 17:54:11.835943734 +0200
+++ src/configure.ac 2014-04-13 18:06:11.083132540 +0200
@@ -42,6 +42,31 @@
exit 1
fi
+ if ! test $PYEXE
+ then
+ PYEXE=$(which python2)
+ if ! test ${PYEXE}
+ then
+ PYEXE=$(which python)
+ fi
+ fi
+ echo $PYEXE
+
+ if ! test $PYDEV
+ then
+ for INCL in $(python2-config --includes)
+ do
+ echo $INCL
+ INCL=$(echo "${INCL}" | sed 's:^-I::g')
+ echo $INCL
+ if test -f "${INCL}/Python.h"
+ then
+ PYDEV="${INCL}"
+ break;
+ fi;
+ done
+ fi
+
if ! test $PYDEV
then
PYDEV="/usr/include/python$(python -V 2>&1 | awk '{print $2}' | cut -d'.' -f1,2)"
@@ -54,7 +79,7 @@
dnl This is a hack to get a valid python library path
echo "import sys" > pylib.py
echo "for path in sys.path: print path" >> pylib.py
- PYLIB="$(python pylib.py | grep -e '-packages$' | head -1)"
+ PYLIB="$(${PYEXE} pylib.py | grep -e '-packages$' | head -1)"
rm -f pylib.py
fi

6
devel/libmpsse/pkg-descr Normal file
View File

@ -0,0 +1,6 @@
Open source library for SPI/I2C control via FTDI chips
Libmpsse is a library for interfacing with SPI/I2C devices via FTDI's
FT-2232 family of USB chips. Based around the libftdi library.
WWW: http://code.google.com/p/libmpsse/