forked from lucasw/ros_from_src
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
executable file
·160 lines (135 loc) · 5.3 KB
/
build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
#!/bin/bash
# exit on error
set -e
set -x
# export PATH=$PATH:/usr/local/bin
SRC=`pwd`/src
echo $SRC
mkdir -p $SRC
BUILD=`pwd`/build
echo $BUILD
mkdir -p $BUILD
WS=`pwd`/catkin_ws/src
echo $WS
mkdir -p $WS || true
DEST=`pwd`/ros
# python installs
python --version | awk '{print $2}' | cut -d'.' -f1
# TODO(lucasw) these aren't working
PYTHON_MAJOR_VERSION=`python --version | awk '{print $2}' | cut -d'.' -f1`
PYTHON_MINOR_VERSION=`python --version | awk '{print $2}' | cut -d'.' -f2`
OPT_PYTHONPATH=$DEST/lib/python$PYTHON_MAJOR_VERSION.$PYTHON_MINOR_VERSION/site-packages/
echo $PYTHONPATH
export PYTHONPATH=$PYTHONPATH:$OPT_PYTHONPATH
echo PYTHONPATH=\$PYTHONPATH:$OPT_PYTHONPATH
# catkin_pkg
cd $SRC/catkin_pkg
python3 setup.py install --prefix=$DEST --record install_manifest.txt --single-version-externally-managed
ls -l $OPT_PYTHONPATH
ls -l $OPT_PYTHONPATH/catkin_pkg
# python -c "import sys; print(sys.path)"
python -c "import catkin_pkg; print(catkin_pkg.__version__)"
python -c "from catkin_pkg.package import parse_package"
# osrf pycommon
cd $SRC/osrf_pycommon
# TODO(lucasw) install to $DEST
python3 setup.py install --prefix=$DEST --record install_manifest.txt --single-version-externally-managed
# catkin tools
cd $SRC/catkin_tools
python3 setup.py install --prefix=$DEST --record install_manifest.txt --single-version-externally-managed
# catkin install
mkdir -p $BUILD/catkin
cd $BUILD/catkin
cmake $WS/catkin -DCATKIN_BUILD_BINARY_PACKAGE=ON -DCMAKE_INSTALL_PREFIX=$DEST -DPYTHON_EXECUTABLE=/usr/bin/python -DSETUPTOOLS_DEB_LAYOUT=OFF -DCATKIN_INSTALL_INTO_PREFIX_ROOT=true && make && make install
python -c "import catkin; print(catkin)"
ls -l $DEST/bin
PATH=$PATH:$DEST/bin
# console_bridge
mkdir -p $BUILD/console_bridge
cd $BUILD/console_bridge
# cmake ../../console_bridge -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_LIBDIR=lib && make && make install
cmake $WS/console_bridge -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$DEST -DCMAKE_INSTALL_LIBDIR=lib
make
make install
# cmake_modules
cd $WS
mkdir -p $BUILD/cmake_modules
ls -l $DEST/lib
cd $BUILD/cmake_modules
cmake $WS/cmake_modules -DCATKIN_BUILD_BINARY_PACKAGE=ON -DCMAKE_INSTALL_PREFIX=$DEST -DPYTHON_EXECUTABLE=/usr/bin/python -DSETUPTOOLS_DEB_LAYOUT=OFF
make
make install
# class_loader
mkdir -p $BUILD/class_loader
export CMAKE_PREFIX_PATH=$CMAKE_PREFIX_PATH:$DEST:$DEST/lib/cmake
ls -l $DEST
ls -l $DEST/share/cmake_modules/cmake/
cd $BUILD/class_loader
cmake $WS/class_loader -DCATKIN_BUILD_BINARY_PACKAGE=ON -DCMAKE_INSTALL_PREFIX=$DEST -DPYTHON_EXECUTABLE=/usr/bin/python -DSETUPTOOLS_DEB_LAYOUT=OFF -Dcmake_modules_DIR=$DEST/share/cmake_modules/cmake/
make
make install
# ros_environment
mkdir -p $BUILD/ros_environment
pwd
cd $BUILD/ros_environment
cmake $SRC/ros_environment -DCATKIN_BUILD_BINARY_PACKAGE=ON -DCMAKE_INSTALL_PREFIX=$DEST -DPYTHON_EXECUTABLE=/usr/bin/python -DSETUPTOOLS_DEB_LAYOUT=OFF
make
make install
# ros_pack
mkdir -p $BUILD/rospack
cd $BUILD/rospack
cmake $WS/rospack -DCATKIN_BUILD_BINARY_PACKAGE=ON -DCMAKE_INSTALL_PREFIX=$DEST -DPYTHON_EXECUTABLE=/usr/bin/python -DSETUPTOOLS_DEB_LAYOUT=OFF -Dcmake_modules_DIR=$DEST/share/cmake_modules/cmake/
make
make install
# genmsg
mkdir -p $BUILD/genmsg
cd $BUILD/genmsg
cmake $WS/genmsg -DCATKIN_BUILD_BINARY_PACKAGE=ON -DCMAKE_INSTALL_PREFIX=$DEST -DPYTHON_EXECUTABLE=/usr/bin/python -DSETUPTOOLS_DEB_LAYOUT=OFF -Dcmake_modules_DIR=$DEST/share/cmake_modules/cmake/
make
make install
# genpy
mkdir -p $BUILD/genpy
cd $BUILD/genpy
cmake $WS/genpy -DCATKIN_BUILD_BINARY_PACKAGE=ON -DCMAKE_INSTALL_PREFIX=$DEST -DPYTHON_EXECUTABLE=/usr/bin/python -DSETUPTOOLS_DEB_LAYOUT=OFF -Dcmake_modules_DIR=$DEST/share/cmake_modules/cmake/
make
make install
# roslib
mkdir -p $BUILD/roslib
cd $BUILD/roslib
cmake $WS/ros/core/roslib -DCATKIN_BUILD_BINARY_PACKAGE=ON -DCMAKE_INSTALL_PREFIX=$DEST -DPYTHON_EXECUTABLE=/usr/bin/python -DSETUPTOOLS_DEB_LAYOUT=OFF -Drospack_DIR=$DEST/share/rospack/cmake/
make
make install
# rosbuild
mkdir -p $BUILD/rosbuild
cd $BUILD/rosbuild
cmake $WS/ros/core/rosbuild -DCATKIN_BUILD_BINARY_PACKAGE=ON -DCMAKE_INSTALL_PREFIX=$DEST -DPYTHON_EXECUTABLE=/usr/bin/python -DSETUPTOOLS_DEB_LAYOUT=OFF # -Drospack_DIR=$DEST/share/rospack/cmake/
make
make install
# rospkg
cd $SRC/rospkg
python3 setup.py install --prefix=$DEST --record install_manifest.txt --single-version-externally-managed
cd $SRC/rosdistro
python3 setup.py install --prefix=$DEST --record install_manifest.txt --single-version-externally-managed
cd $SRC/rosdep
python3 setup.py install --prefix=$DEST --record install_manifest.txt --single-version-externally-managed
rosdep init || true
rosdep update
# TODO(lucasw) already have a copy of this but needs to be in the workspace
# find / | grep setup.bash
# find / | grep catkin-config.cmake
cd $WS/..
catkin init
source $DEST/setup.bash
catkin config
rospack list
# rosdep install --from-paths src --ignore-src -r -s # do a dry-run first
# rosdep install --from-paths src --ignore-src -r -y
CMAKE_PREFIX_PATH=$CMAKE_PREFIX_PATH:$DEST:$DEST/lib/cmake
echo $CMAKE_PREFIX_PATH
# TODO(lucasw) put this in WS to begin with
# TODO(lucasw) was this needed? Need a bunch of CATKIN_IGNOREs in every package/test dir to make it build
# ln -s $SRC/ros $WS/ros
catkin build --cmake-args -DCMAKE_BUILD_TYPE=Release -Wno-deprecated
source devel/setup.bash
rospack list
# TODO(lucasw) run tests