Skip to content

Instantly share code, notes, and snippets.

@bchretien
Created March 9, 2016 15:16
Show Gist options
  • Save bchretien/37b0b532c1018a8e8afd to your computer and use it in GitHub Desktop.
Save bchretien/37b0b532c1018a8e8afd to your computer and use it in GitHub Desktop.
# PKGBUILD generated by Bloom (Thu, 10 Mar 2016 00:16:19 +0900)
# Upstream maintainer: Tully Foote <tfoote@osrfoundation.org>
pkgdesc="ROS - Standard ROS Messages including common message types representing primitive data
types and other basic message constructs, such as multiarrays. For common,
generic robot-specific message types, please see common_msgs."
url="http://www.ros.org/wiki/std_msgs"
pkgname='ros-indigo-std-msgs'
pkgver='0.5.9'
arch=('any')
pkgrel=1
license=('BSD')
makedepends=(
'ros-indigo-catkin'
'ros-indigo-message-generation'
)
depends=(
'ros-indigo-message-runtime'
)
conflicts=(
)
replaces=(
)
# Path to the source code
_dir='../..'
srcdir="$(pwd)"
prepare() {
# Use ROS environment variables
[ -f "/opt/ros/indigo/setup.bash" ] && source "/opt/ros/indigo/setup.bash"
# Create build directory
[ -d "${srcdir}/build" ] || mkdir "${srcdir}/build"
cd "${srcdir}/build"
# Fix Python2/Python3 conflicts
if [[ "2" == "2" ]]; then
for file in $(grep -rl -e 'env python *$' -e 'bin/python *$' "${srcdir}/${_dir}"); do
sed -i "s,env python *$,env python2,g" ${file}
sed -i "s,/usr/bin/python *$,/usr/bin/env python2,g" ${file}
done
fi
# Build project
cmake "${srcdir}/${_dir}" \
-DCMAKE_BUILD_TYPE=Release \
-DCATKIN_BUILD_BINARY_PACKAGE=ON \
-DCMAKE_INSTALL_PREFIX=/opt/ros/indigo \
-DPYTHON_EXECUTABLE=/usr/bin/python2 \
-DPYTHON_INCLUDE_DIR=/usr/include/python2.7 \
-DPYTHON_LIBRARY=/usr/lib/libpython2.7.so \
-DPYTHON_BASENAME=-python2.7 \
-DSETUPTOOLS_DEB_LAYOUT=OFF
}
build() {
cd "${srcdir}/build"
make
}
package() {
cd "${srcdir}/build"
make DESTDIR="${pkgdir}/" install
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment