ports/116398: New port: devel/libnxt Lego Mindstorms NXT firmware management
Jason Bacon
jwbacon at tds.net
Sun Sep 16 16:10:02 UTC 2007
>Number: 116398
>Category: ports
>Synopsis: New port: devel/libnxt Lego Mindstorms NXT firmware management
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: change-request
>Submitter-Id: current-users
>Arrival-Date: Sun Sep 16 16:10:01 GMT 2007
>Closed-Date:
>Last-Modified:
>Originator: Jason Bacon
>Release: 6.1-RELEASE
>Organization:
NA
>Environment:
FreeBSD sculpin 6.1-RELEASE-p11 FreeBSD 6.1-RELEASE-p11 #5: Wed Dec 20 18:29:42 PST 2006 root at PCBSD.localhost:/usr/obj/usr/src/sys/PCBSDv1.3-SMP i386
>Description:
Libnxt is a library and set of tools for managing Lego Mindstorms NXT firmware via the Unix command line.
>How-To-Repeat:
>Fix:
Patch attached with submission follows:
# This is a shell archive. Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file". Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
# devel/libnxt
# devel/libnxt/files
# devel/libnxt/files/patch-SConstruct
# devel/libnxt/files/patch-lowlevel.c
# devel/libnxt/files/pkg-message.in
# devel/libnxt/pkg-descr
# devel/libnxt/Makefile
# devel/libnxt/distinfo
# devel/libnxt/pkg-plist
#
echo c - devel/libnxt
mkdir -p devel/libnxt > /dev/null 2>&1
echo c - devel/libnxt/files
mkdir -p devel/libnxt/files > /dev/null 2>&1
echo x - devel/libnxt/files/patch-SConstruct
sed 's/^X//' >devel/libnxt/files/patch-SConstruct << 'END-of-devel/libnxt/files/patch-SConstruct'
X--- SConstruct.orig Sat Apr 21 23:41:39 2007
X+++ SConstruct Sat May 5 13:02:19 2007
X@@ -9,7 +9,7 @@
X else:
X endian = '_NXT_LITTLE_ENDIAN'
X
X-BuildEnv = Environment(CCFLAGS=['-Wall', '-std=gnu99',
X+BuildEnv = Environment(CCFLAGS=['-Wall', '-std=gnu99','-I/usr/local/include',
X '-g', '-ggdb', '-D' + endian])
X if auto_libs:
X BuildEnv.ParseConfig('pkg-config --cflags --libs ' + auto_libs)
X@@ -24,7 +24,7 @@
X LIBS='usb'))
X
X Default(BuildEnv.Program('fwflash', 'main_fwflash.c',
X- LIBS=['usb', 'nxt'], LIBPATH='.'))
X+ LIBS=['usb', 'nxt'], LIBPATH=['.','/usr/local/lib']))
X
X Default(BuildEnv.Program('fwexec', 'main_fwexec.c',
X- LIBS=['usb', 'nxt'], LIBPATH='.'))
X+ LIBS=['usb', 'nxt'], LIBPATH=['.','/usr/local/lib']))
END-of-devel/libnxt/files/patch-SConstruct
echo x - devel/libnxt/files/patch-lowlevel.c
sed 's/^X//' >devel/libnxt/files/patch-lowlevel.c << 'END-of-devel/libnxt/files/patch-lowlevel.c'
X--- lowlevel.c.orig Sat May 5 16:14:13 2007
X+++ lowlevel.c Sat May 5 16:14:37 2007
X@@ -103,7 +103,7 @@
X return NXT_CONFIGURATION_ERROR;
X }
X
X- ret = usb_claim_interface(nxt->hdl, 1);
X+ ret = usb_claim_interface(nxt->hdl, 0);
X if (ret < 0)
X {
X usb_close(nxt->hdl);
X@@ -115,7 +115,7 @@
X nxt_recv_buf(nxt, buf, 2);
X if (memcmp(buf, "\n\r", 2) != 0)
X {
X- usb_release_interface(nxt->hdl, 1);
X+ usb_release_interface(nxt->hdl, 0);
X usb_close(nxt->hdl);
X return NXT_HANDSHAKE_FAILED;
X }
X@@ -127,7 +127,7 @@
X nxt_error_t
X nxt_close(nxt_t *nxt)
X {
X- usb_release_interface(nxt->hdl, 1);
X+ usb_release_interface(nxt->hdl, 0);
X usb_close(nxt->hdl);
X free(nxt);
X
END-of-devel/libnxt/files/patch-lowlevel.c
echo x - devel/libnxt/files/pkg-message.in
sed 's/^X//' >devel/libnxt/files/pkg-message.in << 'END-of-devel/libnxt/files/pkg-message.in'
X
X-------------------------------------------------------------------------
XUsing libnxt in your programs will require the following compile options:
X
X -I%%PREFIX%%/include/libnxt
X -L%%PREFIX%%/lib -lnxt
X-------------------------------------------------------------------------
END-of-devel/libnxt/files/pkg-message.in
echo x - devel/libnxt/pkg-descr
sed 's/^X//' >devel/libnxt/pkg-descr << 'END-of-devel/libnxt/pkg-descr'
XLego Mindstorms NXT firmware management tools and library.
X
XWWW: http://libnxt.googlecode.com
END-of-devel/libnxt/pkg-descr
echo x - devel/libnxt/Makefile
sed 's/^X//' >devel/libnxt/Makefile << 'END-of-devel/libnxt/Makefile'
X# New ports collection makefile for: libnxt
X# Date created: 2007-05-05
X# Whom: Jason Bacon <bacon11 at tds.net>
X#
X# $FreeBSD$
X#
X
XPORTNAME= libnxt
XPORTVERSION= 0.3
XCATEGORIES= devel
XMASTER_SITES= http://libnxt.googlecode.com/files/ \
X http://personalpages.tds.net/~jwbacon/Ports/distfiles/
X
XMAINTAINER= bacon at smithers.neuro.mcw.edu
XCOMMENT= Lego NXT library
X
XLIB_DEPENDS= usb-0.1.8:${PORTSDIR}/devel/libusb
XBUILD_DEPENDS= scons:${PORTSDIR}/devel/scons \
X python:${PORTSDIR}/lang/python
X
XSUB_FILES= pkg-message
X
Xdo-build:
X (cd ${WRKSRC}; scons)
X
Xdo-install:
X ${MKDIR} ${PREFIX}/include/libnxt
X ${INSTALL_PROGRAM} ${WRKSRC}/fwflash ${PREFIX}/bin
X ${INSTALL_PROGRAM} ${WRKSRC}/fwexec ${PREFIX}/bin
X ${INSTALL_DATA} ${WRKSRC}/libnxt.a ${PREFIX}/lib
X ${MKDIR} ${PREFIX}/include/libnxt
X.for file in ${WRKSRC}/*.h
X ${INSTALL_DATA} ${WRKSRC}/${file} ${PREFIX}/include/libnxt
X.endfor
X
Xpost-install:
X @${CAT} ${WRKDIR}/pkg-message
X
X.include <bsd.port.mk>
END-of-devel/libnxt/Makefile
echo x - devel/libnxt/distinfo
sed 's/^X//' >devel/libnxt/distinfo << 'END-of-devel/libnxt/distinfo'
XMD5 (libnxt-0.3.tar.gz) = 05be5f5b8822f10e4fc4e1dea7d5e770
XSHA256 (libnxt-0.3.tar.gz) = fe310cb917ec69d4e20f9d70ef96d9eec51d0434a8a3580c8a6615488526f8cf
XSIZE (libnxt-0.3.tar.gz) = 16247
END-of-devel/libnxt/distinfo
echo x - devel/libnxt/pkg-plist
sed 's/^X//' >devel/libnxt/pkg-plist << 'END-of-devel/libnxt/pkg-plist'
Xbin/fwexec
Xbin/fwflash
Xinclude/libnxt/error.h
Xinclude/libnxt/firmware.h
Xinclude/libnxt/flash.h
Xinclude/libnxt/flash_routine.h
Xinclude/libnxt/lowlevel.h
Xinclude/libnxt/samba.h
Xlib/libnxt.a
X at dirrm include/libnxt
END-of-devel/libnxt/pkg-plist
exit
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list