Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Refactor] Using wstool to download libraries #77

Merged
merged 5 commits into from
Jan 7, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
68 changes: 20 additions & 48 deletions do_everything.sh
Original file line number Diff line number Diff line change
Expand Up @@ -113,43 +113,15 @@ export TARGET_DIR=$prefix/target
export RBA_TOOLCHAIN=$ANDROID_NDK_HOME/build/cmake/android.toolchain.cmake
apply_patch $my_loc/patches/android.toolchain.cmake.patch -d $ANDROID_NDK_HOME/build/cmake

# Now get boost with a specialized build
[ -d $prefix/libs/boost ] || run_cmd get_library boost $prefix/libs
[ -d $prefix/libs/bzip2 ] || run_cmd get_library bzip2 $prefix/libs
[ -d $prefix/libs/uuid ] || run_cmd get_library uuid $prefix/libs
[ -d $prefix/libs/poco-1.8.0 ] || run_cmd get_library poco $prefix/libs
[ -d $prefix/libs/tinyxml ] || run_cmd get_library tinyxml $prefix/libs
[ -d $prefix/libs/tinyxml2 ] || run_cmd get_library tinyxml2 $prefix/libs
[ -d $prefix/libs/console_bridge ] || run_cmd get_library console_bridge $prefix/libs
[ -d $prefix/libs/lz4-r131 ] || run_cmd get_library lz4 $prefix/libs
[ -d $prefix/libs/curl-7.47.0 ] || run_cmd get_library curl $prefix/libs
[ -d $prefix/libs/urdfdom/ ] || run_cmd get_library urdfdom $prefix/libs
[ -d $prefix/libs/urdfdom_headers ] || run_cmd get_library urdfdom_headers $prefix/libs
[ -d $prefix/libs/libiconv-1.15 ] || run_cmd get_library libiconv $prefix/libs
[ -d $prefix/libs/libxml2-2.9.7 ] || run_cmd get_library libxml2 $prefix/libs
[ -d $prefix/libs/collada_dom ] || run_cmd get_library collada_dom $prefix/libs
[ -d $prefix/libs/eigen-3.3.5 ] || run_cmd get_library eigen $prefix/libs
[ -d $prefix/libs/assimp-3.1.1 ] || run_cmd get_library assimp $prefix/libs
[ -d $prefix/libs/qhull-2015.2 ] || run_cmd get_library qhull $prefix/libs
[ -d $prefix/libs/yaml-cpp-yaml-cpp-0.6.2 ] || run_cmd get_library yaml-cpp $prefix/libs
[ -d $prefix/libs/flann ] || run_cmd get_library flann $prefix/libs
[ -d $prefix/libs/pcl-pcl-1.8.1 ] || run_cmd get_library pcl $prefix/libs
[ -d $prefix/libs/bullet ] || run_cmd get_library bullet $prefix/libs
[ -d $prefix/libs/SDL-1.2.15 ] || run_cmd get_library sdl $prefix/libs
[ -d $prefix/libs/SDL_image ] || run_cmd get_library sdl-image $prefix/libs
[ -d $prefix/libs/libogg-1.3.3 ] || run_cmd get_library ogg $prefix/libs
[ -d $prefix/libs/libvorbis-1.3.6 ] || run_cmd get_library vorbis $prefix/libs
[ -d $prefix/libs/libtheora-1.1.1 ] || run_cmd get_library theora $prefix/libs

# get rospkg dependency for pluginlib support at build time
[ -d $my_loc/files/rospkg ] || run_cmd get_library rospkg $my_loc/files
# Get all library dependencies.
run_cmd get_system_dependencies $my_loc/system_deps.rosinstall $prefix/libs $my_loc/files

echo
echo -e '\e[34mGetting ROS packages\e[39m'
echo

if [[ $skip -ne 1 ]] ; then
run_cmd get_ros_stuff $prefix
run_cmd get_catkin_packages $prefix

echo
echo -e '\e[34mApplying patches.\e[39m'
Expand Down Expand Up @@ -347,29 +319,29 @@ echo
[ -f $TARGET_DIR/lib/libbz2.a ] || run_cmd build_library bzip2 $prefix/libs/bzip2
[ -f $TARGET_DIR/lib/libuuid.a ] || run_cmd build_library uuid $prefix/libs/uuid
[ -f $TARGET_DIR/lib/libboost_system.a ] || run_cmd copy_boost $prefix/libs/boost
[ -f $TARGET_DIR/lib/libPocoFoundation.a ] || run_cmd build_library_with_toolchain poco $prefix/libs/poco-1.8.0
[ -f $TARGET_DIR/lib/libPocoFoundation.a ] || run_cmd build_library_with_toolchain poco $prefix/libs/poco
[ -f $TARGET_DIR/lib/libtinyxml.a ] || run_cmd build_library tinyxml $prefix/libs/tinyxml
[ -f $TARGET_DIR/lib/libtinyxml2.a ] || run_cmd build_library tinyxml2 $prefix/libs/tinyxml2
[ -f $TARGET_DIR/lib/libconsole_bridge.a ] || run_cmd build_library console_bridge $prefix/libs/console_bridge
[ -f $TARGET_DIR/lib/liblz4.a ] || run_cmd build_library lz4 $prefix/libs/lz4-r131/cmake_unofficial
[ -f $TARGET_DIR/lib/libcurl.a ] || run_cmd build_library_with_toolchain curl $prefix/libs/curl-7.47.0
[ -f $TARGET_DIR/lib/liblz4.a ] || run_cmd build_library lz4 $prefix/libs/lz4/cmake_unofficial
[ -f $TARGET_DIR/lib/libcurl.a ] || run_cmd build_library_with_toolchain curl $prefix/libs/curl
[ -f $TARGET_DIR/include/urdf_model/model.h ] || run_cmd build_library urdfdom_headers $prefix/libs/urdfdom_headers
[ -f $TARGET_DIR/lib/liburdfdom_model.a ] || run_cmd build_library urdfdom $prefix/libs/urdfdom
[ -f $TARGET_DIR/lib/libiconv.a ] || run_cmd build_library_with_toolchain libiconv $prefix/libs/libiconv-1.15
[ -f $TARGET_DIR/lib/libxml2.a ] || run_cmd build_library_with_toolchain libxml2 $prefix/libs/libxml2-2.9.7
[ -f $TARGET_DIR/lib/libiconv.a ] || run_cmd build_library_with_toolchain libiconv $prefix/libs/libiconv
[ -f $TARGET_DIR/lib/libxml2.a ] || run_cmd build_library_with_toolchain libxml2 $prefix/libs/libxml2
[ -f $TARGET_DIR/lib/libcollada-dom2.4-dp.a ] || run_cmd build_library collada_dom $prefix/libs/collada_dom
[ -f $TARGET_DIR/lib/libassimp.a ] || run_cmd build_library assimp $prefix/libs/assimp-3.1.1
[ -f $TARGET_DIR/include/eigen3/signature_of_eigen3_matrix_library ] || run_cmd build_library eigen $prefix/libs/eigen-3.3.5
[ -f $TARGET_DIR/lib/libqhullstatic.a ] || run_cmd build_library qhull $prefix/libs/qhull-2015.2
[ -f $TARGET_DIR/lib/libyaml-cpp.a ] || run_cmd build_library yaml-cpp $prefix/libs/yaml-cpp-yaml-cpp-0.6.2
[ -f $TARGET_DIR/lib/libassimp.a ] || run_cmd build_library assimp $prefix/libs/assimp
[ -f $TARGET_DIR/include/eigen3/signature_of_eigen3_matrix_library ] || run_cmd build_library eigen $prefix/libs/eigen
[ -f $TARGET_DIR/lib/libqhullstatic.a ] || run_cmd build_library qhull $prefix/libs/qhull
[ -f $TARGET_DIR/lib/libyaml-cpp.a ] || run_cmd build_library yaml-cpp $prefix/libs/yaml-cpp
[ -f $TARGET_DIR/lib/libflann_cpp_s.a ] || run_cmd build_library flann $prefix/libs/flann
[ -f $TARGET_DIR/lib/libpcl_common.a ] || run_cmd build_library pcl $prefix/libs/pcl-pcl-1.8.1
[ -f $TARGET_DIR/lib/libpcl_common.a ] || run_cmd build_library pcl $prefix/libs/pcl
[ -f $TARGET_DIR/lib/libBulletSoftBody.a ] || run_cmd build_library bullet $prefix/libs/bullet
[ -f $TARGET_DIR/lib/libSDL.a ] || run_cmd build_library_with_toolchain sdl $prefix/libs/SDL-1.2.15
[ -f $TARGET_DIR/lib/libSDL_image.a ] || run_cmd build_library_with_toolchain sdl-image $prefix/libs/SDL_image
[ -f $TARGET_DIR/lib/libogg.a ] || run_cmd build_library_with_toolchain ogg $prefix/libs/libogg-1.3.3
[ -f $TARGET_DIR/lib/libvorbis.a ] || run_cmd build_library_with_toolchain vorbis $prefix/libs/libvorbis-1.3.6
[ -f $TARGET_DIR/lib/libtheora.a ] || run_cmd build_library_with_toolchain theora $prefix/libs/libtheora-1.1.1
[ -f $TARGET_DIR/lib/libSDL.a ] || run_cmd build_library_with_toolchain sdl $prefix/libs/sdl
[ -f $TARGET_DIR/lib/libSDL_image.a ] || run_cmd build_library_with_toolchain sdl-image $prefix/libs/sdl-image
[ -f $TARGET_DIR/lib/libogg.a ] || run_cmd build_library_with_toolchain ogg $prefix/libs/ogg
[ -f $TARGET_DIR/lib/libvorbis.a ] || run_cmd build_library_with_toolchain vorbis $prefix/libs/vorbis
[ -f $TARGET_DIR/lib/libtheora.a ] || run_cmd build_library_with_toolchain theora $prefix/libs/theora

echo
echo -e '\e[34mCross-compiling ROS.\e[39m'
Expand All @@ -378,10 +350,10 @@ echo

if [[ $debugging -eq 1 ]];then
echo "Build type = DEBUG"
run_cmd build_cpp -p $prefix -b Debug -v $verbose
run_cmd build_catkin_workspace -p $prefix -b Debug -v $verbose
else
echo "Build type = RELEASE"
run_cmd build_cpp -p $prefix -b Release -v $verbose
run_cmd build_catkin_workspace -p $prefix -b Release -v $verbose
fi

if [[ $samples -eq 1 ]];then
Expand Down
4 changes: 2 additions & 2 deletions get_ros_stuff.sh → get_catkin_packages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ mkdir -p catkin_ws/src && cd catkin_ws

if [ -f src/.rosinstall ]; then
cd src/
wstool merge $my_loc/ndk.rosinstall --merge-replace
wstool merge $my_loc/ros.rosinstall --merge-replace
wstool update
cd ..
else
wstool init -j$PARALLEL_JOBS src $my_loc/ndk.rosinstall
wstool init -j$PARALLEL_JOBS src $my_loc/ros.rosinstall
fi
43 changes: 43 additions & 0 deletions get_system_dependencies.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#!/bin/bash

# Abort script on any failures
set -e

my_loc="$(cd "$(dirname $0)" && pwd)"
source $my_loc/config.sh
source $my_loc/utils.sh

if [ $# != 3 ] || [ $1 == '-h' ] || [ $1 == '--help' ]; then
echo "Usage: $0 system_deps_rosinstall library_prefix_path files_prefix_path"
echo " example: $0 /home/user/ros_android/system_deps.rosinstall /home/user/my_workspace/output/libs /home/user/ros_android/files"
echo $@
exit 1
fi

echo
echo -e '\e[34mGetting system libraries.\e[39m'
echo

rosinstall_file=$1
lib_prefix=$(cd $2 && pwd)
files_prefix=$(cd $3 && pwd)

# Get everything
if [ -f $lib_prefix/.rosinstall ]; then
pushd $lib_prefix
wstool merge $rosinstall_file --merge-replace
wstool update -j$PARALLEL_JOBS
popd
else
wstool init -j$PARALLEL_JOBS $lib_prefix $rosinstall_file
fi

# Library-specific patches / actions.

# Boost
pushd $lib_prefix/boost
[ -d build/out ] || bash -x ./build-android.sh $ANDROID_NDK_HOME --boost=1.68.0 --arch=$ANDROID_ABI
popd

# Rospkg
cp -r $lib_prefix/rospkg $files_prefix
12 changes: 6 additions & 6 deletions patches/assimp.patch
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
diff --git libs/assimp-3.1.1/CMakeLists.txt libs/assimp-3.1.1/CMakeLists.txt
diff --git libs/assimp/CMakeLists.txt libs/assimp/CMakeLists.txt
index d332428..1af59dc 100644
--- libs/assimp-3.1.1/CMakeLists.txt
+++ libs/assimp-3.1.1/CMakeLists.txt
--- libs/assimp/CMakeLists.txt
+++ libs/assimp/CMakeLists.txt
@@ -76,7 +76,7 @@ SET( ASSIMP_INCLUDE_INSTALL_DIR "include" CACHE PATH
"Path the header files are installed to." )
SET( ASSIMP_BIN_INSTALL_DIR "bin" CACHE PATH
Expand All @@ -11,10 +11,10 @@ index d332428..1af59dc 100644
"Build a static (.a) version of the library" )

SET(ASSIMP_DEBUG_POSTFIX "d" CACHE STRING "Debug Postfitx for lib, samples and tools")
diff --git libs/assimp-3.1.1/code/BlenderDNA.cpp libs/assimp-3.1.1/code/BlenderDNA.cpp
diff --git libs/assimp/code/BlenderDNA.cpp libs/assimp/code/BlenderDNA.cpp
index 16e639e..fdd49eb 100644
--- libs/assimp-3.1.1/code/BlenderDNA.cpp
+++ libs/assimp-3.1.1/code/BlenderDNA.cpp
--- libs/assimp/code/BlenderDNA.cpp
+++ libs/assimp/code/BlenderDNA.cpp
@@ -56,10 +56,10 @@ using namespace Assimp::Formatter;
#define for_each BOOST_FOREACH
bool match4(StreamReaderAny& stream, const char* string) {
Expand Down
31 changes: 0 additions & 31 deletions patches/log4cxx.patch

This file was deleted.

4 changes: 2 additions & 2 deletions patches/lz4.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--- libs/lz4-r131/cmake_unofficial/CMakeLists.txt
+++ libs/lz4-r131/cmake_unofficial/CMakeLists.txt
--- libs/lz4/cmake_unofficial/CMakeLists.txt
+++ libs/lz4/cmake_unofficial/CMakeLists.txt
@@ -14,7 +14,7 @@
MESSAGE( STATUS "64 bit architecture detected size of void * is " ${SIZEOF_VOID_P})
ENDIF()
Expand Down
14 changes: 7 additions & 7 deletions patches/pcl-1.8.1.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--- libs/pcl-pcl-1.8.1/CMakeLists.txt
+++ libs/pcl-pcl-1.8.1/CMakeLists.txt
--- libs/pcl/CMakeLists.txt
+++ libs/pcl/CMakeLists.txt
@@ -1,6 +1,8 @@
### ---[ PCL global CMake
cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
Expand All @@ -13,7 +13,7 @@ diff --git a/android_pcl_config_minimal.cmake b/android_pcl_config_minimal.cmake
new file mode 100644
index 0000000..be84634
--- /dev/null
+++ libs/pcl-pcl-1.8.1/android_pcl_config_minimal.cmake
+++ libs/pcl/android_pcl_config_minimal.cmake
@@ -0,0 +1,15 @@
+set(WITH_FZAPI FALSE CACHE BOOL "fzapi: disabled (forced)" FORCE)
+set(WITH_LIBUSB FALSE CACHE BOOL "libusb: disabled (forced)" FORCE)
Expand All @@ -31,8 +31,8 @@ index 0000000..be84634
+set(HAVE_MM_MALLOC_EXITCODE "2" CACHE STRING "Result from TRY_RUN for HAVE_MM_MALLOC" FORCE)
+set(HAVE_POSIX_MEMALIGN_EXITCODE "2" CACHE STRING "Result from TRY_RUN for HAVE_POSIX_MEMALIGN" FORCE)
+
--- libs/pcl-pcl-1.8.1/PCLConfig.cmake.in
+++ libs/pcl-pcl-1.8.1/PCLConfig.cmake.in
--- libs/pcl/PCLConfig.cmake.in
+++ libs/pcl/PCLConfig.cmake.in
@@ -853,8 +853,9 @@
set(PCL_${COMPONENT}_LIBRARY ${PCL_${COMPONENT}_LIBRARY_DEBUG})
endif(NOT PCL_${COMPONENT}_LIBRARY AND WIN32)
Expand All @@ -52,8 +52,8 @@ index 0000000..be84634
endif(PCL_${INT_DEP}_LIBRARIES)
endif(PCL_${INT_DEP}_FOUND)
endforeach(int_dep)
--- libs/pcl-pcl-1.8.1/cmake/pcl_pclconfig.cmake
+++ libs/pcl-pcl-1.8.1/cmake/pcl_pclconfig.cmake
--- libs/pcl/cmake/pcl_pclconfig.cmake
+++ libs/pcl/cmake/pcl_pclconfig.cmake
@@ -61,6 +61,13 @@
endif(_status)
endforeach(_ss)
Expand Down
12 changes: 6 additions & 6 deletions patches/poco.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--- libs/poco-1.8.0/Foundation/include/Poco/SharedLibrary.h
+++ libs/poco-1.8.0/Foundation/include/Poco/SharedLibrary.h
--- libs/poco/Foundation/include/Poco/SharedLibrary.h
+++ libs/poco/Foundation/include/Poco/SharedLibrary.h
@@ -23,7 +23,9 @@
#include "Poco/Foundation.h"

Expand All @@ -11,8 +11,8 @@
#include "Poco/SharedLibrary_HPUX.h"
#elif defined(POCO_VXWORKS)
#include "Poco/SharedLibrary_VX.h"
--- libs/poco-1.8.0/Foundation/src/SharedLibrary.cpp
+++ libs/poco-1.8.0/Foundation/src/SharedLibrary.cpp
--- libs/poco/Foundation/src/SharedLibrary.cpp
+++ libs/poco/Foundation/src/SharedLibrary.cpp
@@ -18,7 +18,9 @@
#include "Poco/Exception.h"

Expand All @@ -25,7 +25,7 @@
#elif defined(POCO_VXWORKS)
#include "SharedLibrary_VX.cpp"
--- /dev/null
+++ libs/poco-1.8.0/Foundation/src/SharedLibrary_ANDROID_STATIC.cpp
+++ libs/poco/Foundation/src/SharedLibrary_ANDROID_STATIC.cpp
@@ -0,0 +1,119 @@
+//
+// SharedLibrary_ANDROID.cpp
Expand Down Expand Up @@ -147,7 +147,7 @@
+
+} // namespace Poco
--- /dev/null
+++ libs/poco-1.8.0/build/config/Android_static
+++ libs/poco/build/config/Android_static
@@ -0,0 +1,91 @@
+#
+# $Id: //poco/1.4/build/config/Android#3 $
Expand Down
4 changes: 2 additions & 2 deletions patches/qhull.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--- libs/qhull-2012.1/CMakeLists.txt 2014-12-19 18:26:42.612712590 -0300
+++ libs/qhull-2012.1/CMakeLists.txt 2014-12-19 18:44:18.124752493 -0300
--- libs/qhull/CMakeLists.txt 2014-12-19 18:26:42.612712590 -0300
+++ libs/qhull/CMakeLists.txt 2014-12-19 18:44:18.124752493 -0300
@@ -241,7 +241,7 @@

set(
Expand Down
4 changes: 2 additions & 2 deletions patches/yaml-cpp.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--- libs/yaml-cpp-yaml-cpp-0.6.2/CMakeLists.txt
+++ libs/yaml-cpp-yaml-cpp-0.6.2/CMakeLists.txt
--- libs/yaml-cpp/CMakeLists.txt
+++ libs/yaml-cpp/CMakeLists.txt
@@ -38,7 +38,11 @@ enable_testing()
### Project options
###
Expand Down
File renamed without changes.
Loading