opencv: updated to version 2.4.11.

This commit is contained in:
Renato Caldas 2015-03-17 18:06:10 +00:00
parent 419d313a0c
commit ac1ee7efd9

View File

@ -1,55 +1,78 @@
version=\
(
2.0.0
"2.4.11"
)
url=\
(
"http://garr.dl.sourceforge.net/project/opencvlibrary/opencv-unix/2.0/OpenCV-$version.tar.bz2"
"http://sourceforge.net/projects/opencvlibrary/files/opencv-unix/$version/opencv-$version.zip"
)
md5=\
(
'ed27520514baacc5edad7b06ad24130e'
'32f498451bff1817a60e1aabc2939575'
)
requires=\
(
'cmake/host'
'ffmpeg/default'
)
maintainer=\
(
'Ricardo Martins <rasm@fe.up.pt>'
'Renato Caldas <rmsc@fe.up.pt>'
)
configure()
{
"../OpenCV-$version/configure" \
--prefix="$cfg_dir_toolchain_sysroot/usr" \
--target="$cfg_target_canonical" \
--host="$cfg_target_canonical" \
--build="$cfg_host_canonical" \
--without-gtk \
--without-python \
--without-swig \
--disable-sse \
--disable-apps
LINKER_ADDED_FLAGS="-Wl,-rpath,${cfg_dir_rootfs}/usr/lib"
mkdir -p ../build
cd ../build
${cfg_dir_toolchain}/usr/local/bin/cmake \
-DCMAKE_SYSTEM_NAME="Linux" \
-DCMAKE_SYSTEM_PROCESSOR="$cfg_architecture" \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_FIND_ROOT_PATH="${cfg_dir_toolchain_sysroot}/usr ${cfg_dir_rootfs}/usr" \
-DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY \
-DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY \
-DCMAKE_C_COMPILER="${cmd_target_cc}" \
-DCMAKE_CXX_COMPILER="${cmd_target_cxx}" \
-DCMAKE_C_FLAGS="${cfg_target_gcc_flags}" \
-DCMAKE_SHARED_LINKER_FLAGS="${LINKER_ADDED_FLAGS} ${CMAKE_SHARED_LINKER_FLAGS}" \
-DCMAKE_MODULE_LINKER_FLAGS="${LINKER_ADDED_FLAGS} ${CMAKE_MODULE_LINKER_FLAGS}" \
-DCMAKE_EXE_LINKER_FLAGS="${LINKER_ADDED_FLAGS} ${CMAKE_EXE_LINKER_FLAGS}" \
-DCMAKE_INSTALL_PREFIX="${cfg_dir_toolchain_sysroot}/usr" \
-DBUILD_DOCS=OFF \
-DBUILD_EXAMPLES=OFF \
-DBUILD_PERF_TESTS=OFF \
-DBUILD_SHARED_LIBS=ON \
-DBUILD_TESTS=OFF \
-DBUILD_WITH_DEBUG_INFO=OFF \
../opencv-$version/
}
build()
{
$cmd_make
cd ${pkg_build_dir}/../build &&
$cmd_make VERBOSE=1
}
host_install()
{
cd ${pkg_build_dir}/../build &&
$cmd_make install
}
target_install()
{
for f in $cfg_dir_toolchain_sysroot/usr/lib/{libcv.*so*,libcvaux.so*,libcxcore.so*,libhighgui.so*,libml.so*}; do
dst="$cfg_dir_rootfs/lib/$(basename $f)"
if [ -f "$f" ]; then
$cmd_target_strip "$f" -o "$dst"
cd "${pkg_build_dir}/../build" &&
for f in "$cfg_dir_toolchain_sysroot/usr/lib/"libopencv*so*; do
if [ -L "$f" ]; then
cp -av "$f" "$cfg_dir_rootfs/usr/lib"
else
cp -a "$f" -o "$dst"
$cmd_target_strip -v "$f" -o "$cfg_dir_rootfs/usr/lib/$(basename "$f")"
fi
done
}