Skip to content

Commit

Permalink
install catkin_virtualenv in build_ros1.sh and install rospkg-modules…
Browse files Browse the repository at this point in the history
… in build_ros1_dependencies.sh
  • Loading branch information
k-okada committed Oct 13, 2023
1 parent db30f18 commit 9299ee4
Show file tree
Hide file tree
Showing 5 changed files with 69 additions and 0 deletions.
1 change: 1 addition & 0 deletions jsk_unitree_robot/cross/build_ros1.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ mkdir -p ${SOURCE_ROOT}/src
mkdir -p ${HOST_INSTALL_ROOT}/ros1_inst

if [ ${UPDATE_SOURCE_ROOT} -eq 1 ]; then
vcs import --force --retry 10 --shallow ${SOURCE_ROOT}/src < repos/catkin_virtualenv.repos
vcs import --force --retry 10 --shallow ${SOURCE_ROOT}/src < repos/roseus_no_window.repos
for dir in euslisp jskeus; do ls ${SOURCE_ROOT}/src/$dir/patches/; rsync -avz ${SOURCE_ROOT}/src/$dir/patches/ ${SOURCE_ROOT}/src/$dir; done
# linux can use sed -i'.bak' and latest mac also supports same syntax.
Expand Down
18 changes: 18 additions & 0 deletions jsk_unitree_robot/cross/repos/catkin_virtualenv.repos
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
repositories:
catkin_virtualenv:
type: git
url: https://github.com/locusrobotics/catkin_virtualenv
version: 0.9.0
#
# 0.9.0 contains following two patches, but not release on ROS1
# catkin_virtualenv depends on python3-rospkg-modules (and others). It is installed in build_ros1_dependencies.sh
#
# At current, if we do a catkin build with CATKIN_ENABLE_TESTING=FALSE,
# we get the error 'Unknown CMake command "catkin_run_tests_target"'
# when calling catkin_generate_virtualenv. The following PR fixes this error.
# https://github.com/locusrobotics/catkin_virtualenv/pull/89
#
# Some python environments may not have ensurepip installed.
# Also, some users may not be able to use sudo apt install to install python3-venv (sudo command), etc.
# The following PR will enable catkin_virtualenv in environments without ensurepip by doing get-pip.py within venv.
# https://github.com/locusrobotics/catkin_virtualenv/pull/90
12 changes: 12 additions & 0 deletions jsk_unitree_robot/cross/repos/ros1_dependencies.repos
Original file line number Diff line number Diff line change
Expand Up @@ -262,3 +262,15 @@ repositories:
type: tar
url: http://archive.ubuntu.com/ubuntu/pool/universe/libc/libccd/libccd_2.0-1.debian.tar.xz
# fcl depends on ccd
python3-catkin-pkg-modules:
type: tar
url: http://packages.ros.org/ros/ubuntu/pool/main/p/python3-catkin-pkg-modules/python3-catkin-pkg-modules_0.5.2.orig.tar.gz
python3-catkin-pkg-modules/debian:
type: tar
url: http://packages.ros.org/ros/ubuntu/pool/main/p/python3-catkin-pkg-modules/python3-catkin-pkg-modules_0.5.2-1.debian.tar.xz
python3-rospkg-modules:
type: tar
url: http://packages.ros.org/ros/ubuntu/pool/main/p/python3-rospkg-modules/python3-rospkg-modules_1.5.0.orig.tar.gz
python3-rospkg-modules/debian:
type: tar
url: http://packages.ros.org/ros/ubuntu/pool/main/p/python3-rospkg-modules/python3-rospkg-modules_1.5.0-1.debian.tar.xz
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash
set -xeuf -o pipefail

DEBIAN_DIR=/home/user/ros1_dependencies_sources/src/python3-catkin-pkg-modules/debian/debian
SOURCE_DIR=/home/user/ros1_dependencies_sources/src/python3-catkin-pkg-modules/catkin_pkg_modules-0.5.2

# cd ${DEBIAN_DIR}/patches
# for patch_file in $(grep -v ^# series); do
# OUT="$(patch -p1 --forward --directory ${SOURCE_DIR} < ${patch_file} | tee /dev/tty)" || echo "${OUT}" | grep "Skipping patch" -q || (echo "$OUT" && false) || echo "OK"
# done

cd ${SOURCE_DIR}

mkdir -p /opt/jsk/${INSTALL_ROOT}/ros1_dependencies/lib/python3.6/site-packages/
SKIP_PYTHON_SCRIPTS=TRUE \
PYTHONPATH="/opt/jsk/${INSTALL_ROOT}/ros1_dependencies/lib/python3.6/site-packages" \
python3 \
setup.py install \
--prefix /opt/jsk/${INSTALL_ROOT}/ros1_dependencies
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash
set -xeuf -o pipefail

DEBIAN_DIR=/home/user/ros1_dependencies_sources/src/python3-rospkg-modules/debian/debian
SOURCE_DIR=/home/user/ros1_dependencies_sources/src/python3-rospkg-modules/rospkg_modules-1.5.0

# cd ${DEBIAN_DIR}/patches
# for patch_file in $(grep -v ^# series); do
# OUT="$(patch -p1 --forward --directory ${SOURCE_DIR} < ${patch_file} | tee /dev/tty)" || echo "${OUT}" | grep "Skipping patch" -q || (echo "$OUT" && false) || echo "OK"
# done

cd ${SOURCE_DIR}

mkdir -p /opt/jsk/${INSTALL_ROOT}/ros1_dependencies/lib/python3.6/site-packages/
SKIP_PYTHON_SCRIPTS=TRUE \
PYTHONPATH="/opt/jsk/${INSTALL_ROOT}/ros1_dependencies/lib/python3.6/site-packages" \
python3 \
setup.py install \
--prefix /opt/jsk/${INSTALL_ROOT}/ros1_dependencies

0 comments on commit 9299ee4

Please sign in to comment.