This repository has been archived by the owner on Jan 13, 2023. It is now read-only.
forked from esteve/ros2_pepper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
prepare_requirements_ros1.sh
executable file
·101 lines (89 loc) · 3.81 KB
/
prepare_requirements_ros1.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
#!/bin/bash
set -euf -o pipefail
PYTHON2_VERSION=2.7.13
INSTALL_ROOT=.ros-root
export AL_DIR=/home/gro/naoqi-sdk
export ALDE_CTC_CROSS=/home/gro/ctc-linux64-atom-2.5.2.74
export ROS_PEPPER_CI=''
if [ -z "$ALDE_CTC_CROSS" ]; then
echo "Please define the ALDE_CTC_CROSS variable with the path to Aldebaran's Crosscompiler toolchain"
exit 1
fi
docker build -t ros1-pepper -f docker/Dockerfile_ros1 docker/
if [ ! -e "Python-${PYTHON2_VERSION}.tar.xz" ]; then
wget -cN https://www.python.org/ftp/python/$PYTHON2_VERSION/Python-${PYTHON2_VERSION}.tar.xz
tar xvf Python-${PYTHON2_VERSION}.tar.xz
fi
mkdir -p ccache-build/
mkdir -p ${PWD}/Python-${PYTHON2_VERSION}-host
mkdir -p ${PWD}/${INSTALL_ROOT}/Python-${PYTHON2_VERSION}
USE_TTY=""
if [ -z "$ROS_PEPPER_CI" ]; then
USE_TTY="-it"
fi
echo "Use tty = ${USE_TTY}"
docker run ${USE_TTY} --rm \
-u $(id -u) \
-e INSTALL_ROOT=${INSTALL_ROOT} \
-e PYTHON2_VERSION=${PYTHON2_VERSION} \
-v ${PWD}/ccache-build:/home/nao/.ccache \
-v ${PWD}/Python-${PYTHON2_VERSION}:/home/nao/Python-${PYTHON2_VERSION}-src \
-v ${PWD}/Python-${PYTHON2_VERSION}-host:/home/nao/${INSTALL_ROOT}/Python-${PYTHON2_VERSION} \
-v ${ALDE_CTC_CROSS}:/home/nao/ctc \
-e CC \
-e CPP \
-e CXX \
-e RANLIB \
-e AR \
-e AAL \
-e LD \
-e READELF \
-e CFLAGS \
-e CPPFLAGS \
-e LDFLAGS \
ros1-pepper \
bash -c "\
set -euf -o pipefail && \
mkdir -p Python-${PYTHON2_VERSION}-src/build-host && \
cd Python-${PYTHON2_VERSION}-src/build-host && \
export PATH=/home/nao/${INSTALL_ROOT}/Python-${PYTHON2_VERSION}/bin:\${PATH} && \
../configure \
--prefix=/home/nao/${INSTALL_ROOT}/Python-${PYTHON2_VERSION} \
--enable-shared \
--disable-ipv6 \
ac_cv_file__dev_ptmx=yes \
ac_cv_file__dev_ptc=no && \
export LD_LIBRARY_PATH=/home/nao/ctc/openssl/lib:/home/nao/ctc/zlib/lib:/home/nao/${INSTALL_ROOT}/Python-${PYTHON2_VERSION}/lib && \
make -j4 install && \
wget -O - -q https://bootstrap.pypa.io/get-pip.py | /home/nao/${INSTALL_ROOT}/Python-${PYTHON2_VERSION}/bin/python && \
/home/nao/${INSTALL_ROOT}/Python-${PYTHON2_VERSION}/bin/pip install empy catkin-pkg setuptools vcstool numpy rospkg defusedxml netifaces"
docker run ${USE_TTY} --rm \
-u $(id -u) \
-e INSTALL_ROOT=${INSTALL_ROOT} \
-e PYTHON2_VERSION=${PYTHON2_VERSION} \
-v ${PWD}/ccache-build:/home/nao/.ccache \
-v ${PWD}/Python-${PYTHON2_VERSION}:/home/nao/Python-${PYTHON2_VERSION}-src \
-v ${PWD}/Python-${PYTHON2_VERSION}-host:/home/nao/Python-${PYTHON2_VERSION}-host \
-v ${PWD}/${INSTALL_ROOT}/Python-${PYTHON2_VERSION}:/home/nao/${INSTALL_ROOT}/Python-${PYTHON2_VERSION} \
-v ${ALDE_CTC_CROSS}:/home/nao/ctc \
ros1-pepper \
bash -c "\
set -euf -o pipefail && \
mkdir -p Python-${PYTHON2_VERSION}-src/build-pepper && \
cd Python-${PYTHON2_VERSION}-src/build-pepper && \
export LD_LIBRARY_PATH=/home/nao/ctc/openssl/lib:/home/nao/ctc/zlib/lib:/home/nao/Python-${PYTHON2_VERSION}-host/lib && \
export PATH=/home/nao/Python-${PYTHON2_VERSION}-host/bin:\${PATH} && \
../configure \
--prefix=/home/nao/${INSTALL_ROOT}/Python-${PYTHON2_VERSION} \
--host=i686-aldebaran-linux-gnu \
--build=x86_64-linux \
--enable-shared \
--disable-ipv6 \
ac_cv_file__dev_ptmx=yes \
ac_cv_file__dev_ptc=no && \
make -j4 && \
export LD_LIBRARY_PATH=/home/nao/ctc/openssl/lib:/home/nao/ctc/zlib/lib:/home/nao/${INSTALL_ROOT}/Python-${PYTHON2_VERSION}/lib && \
export PATH=/home/nao/${INSTALL_ROOT}/Python-${PYTHON2_VERSION}/bin:\${PATH} && \
make install && \
wget -O - -q https://bootstrap.pypa.io/get-pip.py | /home/nao/${INSTALL_ROOT}/Python-${PYTHON2_VERSION}/bin/python && \
/home/nao/${INSTALL_ROOT}/Python-${PYTHON2_VERSION}/bin/pip install empy catkin-pkg setuptools vcstool numpy rospkg defusedxml netifaces"