1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-22 04:17:44 +00:00
freebsd-ports/devel/ros-nxt/Makefile
Rene Ladan da287c3a37 Upgrade the Robot Operating System ports to their 1.4 aka Diamondback versions.
Detailed changelists are available on the WWW sites.

Port changes:
- distribution files are now fetched from upstream servers instead of
  using local copies from my server
- Python files are now always compiled (to .pyc and .pyo) and use Python 2.7
- devel/ros is now split in to devel/ros, devel/ros-documentation,
  devel/ros-rx, and devel-ros-comm to allow more lightweight installations
- Connect latter 3 ports to the build
2011-05-31 22:24:13 +00:00

113 lines
4.3 KiB
Makefile

# New ports collection makefile for: nxt-ros
# Date created: 2010-11-27
# Whom: Rene Ladan <rene@FreeBSD.org>
#
# $FreeBSD$
PORTNAME= ros-nxt
PORTVERSION= 0.1.1
CATEGORIES= devel
MASTER_SITES= https://code.ros.org/svn/release/download/stacks/${STACKNAME}/${STACKNAME}-${PORTVERSION}/:rel \
${MASTER_SITE_GOOGLE_CODE}:gc \
http://foote-ros-pkg.googlecode.com/files/:foote
DISTFILES= nxt-${PORTVERSION}.tar.bz2:rel nxt-python-1.1.2.zip:gc \
nxt_description.parts.tar.gz:foote
DIST_SUBDIR= ros
EXTRACT_ONLY= nxt-${PORTVERSION}.tar.bz2
MAINTAINER= rene@FreeBSD.org
COMMENT= Robot Operating System - LEGO NXT interface
PROJECTHOST= nxt-python
LICENSE_COMB= multi
LICENSE= BSD GPLv3
STACKNAME= ${PORTNAME:S/ros-//}
WRKSRC= ${WRKDIR}/${STACKNAME}-${PORTVERSION}
# TODO port python-bluez for secondary bluetooth interface (no bluetooth here)
EXTRACT_DEPENDS=unzip:${PORTSDIR}/archivers/unzip
BUILD_DEPENDS= rosmake:${PORTSDIR}/devel/ros \
${LOCALBASE}/ros/stacks/ros_comm/stack.xml:${PORTSDIR}/devel/ros_comm \
${LOCALBASE}/ros/stacks/common_msgs/stack.xml:${PORTSDIR}/devel/ros-common_msgs \
${LOCALBASE}/ros/stacks/geometry/stack.xml:${PORTSDIR}/math/ros-geometry \
chrpath:${PORTSDIR}/devel/chrpath
RUN_DEPENDS= roscore:${PORTSDIR}/devel/ros \
${LOCALBASE}/ros/stacks/ros_comm/stack.xml:${PORTSDIR}/devel/ros_comm \
${LOCALBASE}/ros/stacks/common_msgs/stack.xml:${PORTSDIR}/devel/ros-common_msgs \
${LOCALBASE}/ros/stacks/geometry/stack.xml:${PORTSDIR}/math/ros-geometry \
${PYTHON_SITELIBDIR}/usb.so:${PORTSDIR}/devel/py-usb
USE_PYTHON= yes
USE_BZIP2= yes
# rosmake does its own threading
MAKE_JOBS_UNSAFE= yes
CFLAGS+= -I${LOCALBASE}/include
MAKE_ENV+= CPATH=${LOCALBASE}/include \
LIBRARY_PATH=${LOCALBASE}/lib \
MAKE=${LOCALBASE}/bin/gmake \
ROS_ROOT=${LOCALBASE}/ros/ros \
ROS_PACKAGE_PATH=${LOCALBASE}/ros/stacks/ros_comm:${LOCALBASE}/ros/stacks/common_msgs:${LOCALBASE}/ros/stacks/geometry:${WRKSRC} \
PYTHONPATH=${LOCALBASE}/ros/ros/core/roslib/src
MAKE_ARGS= -i --no-rosdep --status-rate=0 --disable-logging
.include <bsd.port.pre.mk>
.if ${OSVERSION} < 800069
LIB_DEPENDS+= usb:${PORTSDIR}/devel/libusb
.endif
post-extract:
${CP} ${_DISTDIR}/nxt_description.parts.tar.gz ${WRKSRC}/nxt_description/meshes/nxt_description.tar.gz
${MKDIR} ${WRKSRC}/nxt_python/build
${CP} ${_DISTDIR}/nxt-python-1.1.2.zip ${WRKSRC}/nxt_python/build
# already extract and mark as such because we have to patch it
(cd ${WRKSRC}/nxt_python/build ; \
${LOCALBASE}/bin/unzip -q nxt-python-1.1.2.zip ; \
${TOUCH} nxt-python-1.1.2/unpacked)
# remove nxt_rviz_plugin, it is unbuildable right now
# and keeping it here breaks rospack
${RM} -rf ${WRKSRC}/nxt_rviz_plugin
do-build:
(cd ${WRKSRC} ; ${MAKE_ENV} ${LOCALBASE}/bin/rosmake ${MAKE_ARGS})
PLIST_SUB= PYTHON_VER=${PYTHON_VER}
do-install:
${MKDIR} ${PREFIX}/ros/stacks/${STACKNAME}
# delete file already extracted
${RM} ${WRKSRC}/nxt_description/meshes/nxt_description.tar.gz
# delete files explicitly because negation in find (for COPYTREE_SHARE) is bogus
.for d in nxt_controllers nxt_description nxt_lxf2urdf nxt_msgs nxt_python \
nxt_ros #nxt_rviz_plugin
${FIND} ${WRKSRC}/${d} -name build -type d -or -name \*.bak -type f \
-or -name .svnignore -type f -or -name .cvsignore -type f \
-or -name \*.orig -or -name installed -type f \
-or -name wiped -type f | ${XARGS} ${RM} -rf
(cd ${WRKSRC} ; ${COPYTREE_SHARE} ${d} ${PREFIX}/ros/stacks/${STACKNAME})
.endfor
.for f in CMakeLists.txt Makefile rosdep.yaml stack.xml
${INSTALL_DATA} ${WRKSRC}/${f} ${PREFIX}/ros/stacks/${STACKNAME}
.endfor
# make scripts executable
.for f in nxt_controllers/scripts/base_controller.py \
nxt_controllers/scripts/base_odometry.py \
nxt_controllers/scripts/joint_position_controller.py \
nxt_lxf2urdf/scripts/lxf2urdf.py nxt_lxf2urdf/scripts/transformations.py \
nxt_python/bin/nxt_filer nxt_python/bin/nxt_push nxt_python/bin/nxt_test \
nxt_python/sensor_tests/color_sensor_test.py \
nxt_python/sensor_tests/touch_sensor_test.py nxt_python/test_sensors.py \
nxt_ros/scripts/joint_states_aggregator.py nxt_ros/scripts/nxt_ros.py
${CHMOD} 0555 ${PREFIX}/ros/stacks/${STACKNAME}/${f}
.endfor
post-install:
${PYTHON_CMD} -O -mcompileall ${PREFIX}/ros/stacks/${STACKNAME}/
${PYTHON_CMD} -mcompileall ${PREFIX}/ros/stacks/${STACKNAME}/
.include <bsd.port.post.mk>