Compare commits

...

2 Commits
master ... f18

Author SHA1 Message Date
Dan Horák
a4a0a035c8 build on platforms without valgrind 2013-01-09 18:44:33 +01:00
Rich Mattes
fbe6d6d59d Initial import 2012-10-22 18:42:55 -04:00
5 changed files with 206 additions and 0 deletions

1
.gitignore vendored
View File

@ -0,0 +1 @@
/libccd-1.4.tar.gz

79
libccd-1.3-ctest.patch Normal file
View File

@ -0,0 +1,79 @@
diff -rpN libccd-1.3/CMakeLists.txt libccd-1.3-testsuite/CMakeLists.txt
*** libccd-1.3/CMakeLists.txt 2012-05-16 01:54:39.000000000 -0400
--- libccd-1.3-testsuite/CMakeLists.txt 2012-05-26 14:03:34.671702814 -0400
*************** set(CCD_VERSION "1.2")
*** 6,10 ****
--- 6,11 ----
set(PKG_DESC "Library for collision detection between convex shapes")
set(LIB_SUFFIX "" CACHE STRING "Library installation directory suffix")
+ set(BUILD_TESTS false CACHE BOOL "Build the test suite")
include_directories("src/")
*************** install(TARGETS ccd ccd_static ARCHIVE D
*** 51,53 ****
--- 52,58 ----
install(DIRECTORY src/ccd DESTINATION include FILES_MATCHING PATTERN "*.h")
install(FILES "${pkg_conf_file}" DESTINATION lib${LIB_SUFFIX}/pkgconfig/ COMPONENT pkgconfig)
+ if (BUILD_TESTS)
+ enable_testing()
+ add_subdirectory(src/testsuites)
+ endif (BUILD_TESTS)
diff -rpN libccd-1.3/src/testsuites/CMakeLists.txt libccd-1.3-testsuite/src/testsuites/CMakeLists.txt
*** libccd-1.3/src/testsuites/CMakeLists.txt 1969-12-31 19:00:00.000000000 -0500
--- libccd-1.3-testsuite/src/testsuites/CMakeLists.txt 2012-05-26 14:04:13.659169012 -0400
***************
*** 0 ****
--- 1,51 ----
+ set(CCDTEST_ARGS "" CACHE STRING "Argments to pass to ccdtest executable")
+
+ set(TEST_SOURCES
+ common.c
+ support.c
+ vec3.c
+ polytope.c
+ boxbox.c
+ spheresphere.c
+ cylcyl.c
+ boxcyl.c
+ mpr_boxbox.c
+ mpr_cylcyl.c
+ mpr_boxcyl.c)
+
+ add_library(cu cu/cu.c)
+
+ add_executable(ccdtest ${TEST_SOURCES} main.c)
+ target_link_libraries(ccdtest ccd cu rt)
+ add_definitions(-DCU_ENABLE_TIMER)
+ include_directories(${CMAKE_CURRENT_SOURCE_DIR})
+ add_test(NAME ccdtest
+ COMMAND ccdtest ${CCDTEST_ARGS}
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
+
+ add_test(NAME ccdtest-valgrind
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+ COMMAND valgrind -q --leak-check=full --show-reachable=yes --trace-children=yes
+ --error-limit=no
+ ${CMAKE_CURRENT_BINARY_DIR}/ccdtest ${CCDTEST_ARGS})
+
+ add_test(NAME ccdtest-valgrind-gen-suppressions
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+ COMMAND valgrind -q --leak-check=full --show-reachable=yes --trace-children=yes
+ --gen-suppressions=all --log-file=out --error-limit=no
+ ${CMAKE_CURRENT_BINARY_DIR}/ccdtest ${CCDTEST_ARGS})
+
+
+ add_executable(bench bench.c support.c cu/cu.c)
+ target_link_libraries(bench ccd cu rt)
+ add_test(NAME bench
+ COMMAND bench)
+
+ add_executable(bench2 bench2.c support.c cu/cu.c)
+ target_link_libraries(bench2 ccd cu rt)
+ add_test(NAME bench2
+ COMMAND bench2)
+
+ add_test(NAME check-regressions
+ COMMAND python ${CMAKE_CURRENT_SOURCE_DIR}/cu/check-regressions regressions
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})

View File

@ -0,0 +1,9 @@
diff -up ./ccd.pc.in.fixpkgconfig ./ccd.pc.in
--- ./ccd.pc.in.fixpkgconfig 2012-05-29 17:35:17.042383687 -0400
+++ ./ccd.pc.in 2012-05-29 17:35:35.396786946 -0400
@@ -9,4 +9,4 @@ Description: @PKG_DESC@
Version: @CCD_VERSION@
Requires: @PKG_EXTERNAL_DEPS@
Libs: -L${libdir} -lccd
-Cflags: -I${includedir}
+Cflags: -I${includedir}/ccd

116
libccd.spec Normal file
View File

@ -0,0 +1,116 @@
%ifarch %{ix86} x86_64 ppc ppc64 s390x %{arm}
%global with_valgrind 1
%endif
Name: libccd
Version: 1.4
Release: 2%{?dist}
Summary: Library for collision detection between convex shapes
License: BSD
URL: http://libccd.danfis.cz
Source0: http://libccd.danfis.cz/files/%{name}-%{version}.tar.gz
# This patch integrates all of the test programs that are present in
# the testsuites folder into CMake, via CTest. Not yet submitted
# upstream
Patch0: %{name}-1.3-ctest.patch
# This patch changes the ccd.pc file to point to the correct include
# directory. Not yet submitted upstream
Patch1: %{name}-1.3-fixpkgconfig.patch
%if 0%{?rhel}
BuildRequires: cmake28
%else
BuildRequires: cmake
%endif
# These are required for executing the test suite
BuildRequires: python
%if 0%{?with_valgrind}
BuildRequires: valgrind
%endif
%description
libccd implements variation on Gilbert-Johnson-Keerthi (GJK) algorithm +
Expand Polytope Algorithm (EPA). It also implements Minkowski Portal
Refinement (MPR, a.k.a. XenoCollide) algorithm as published in Game
Programming Gems 7.
%package devel
Summary: Development files for %{name}
Requires: %{name}%{?_isa} = %{version}-%{release}
%description devel
The %{name}-devel package contains libraries and header files for
developing applications that use %{name}.
%prep
%setup -q
%patch0 -p1
%patch1 -p0
%build
mkdir build
pushd build
%if 0%{?rhel}
%cmake28 \
%else
%cmake \
%endif
-DBUILD_TESTS=ON \
-DCMAKE_BUILD_TYPE=None \
..
popd
make -C build %{?_smp_mflags}
%install
rm -rf $RPM_BUILD_ROOT
make -C build install DESTDIR=$RPM_BUILD_ROOT
find $RPM_BUILD_ROOT -name '*.la' -exec rm -f {} ';'
rm -f $RPM_BUILD_ROOT%{_libdir}/*.a
%check
%if 0%{?with_valgrind}
make -C build test
%endif
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%files
%doc BSD-LICENSE README
%{_libdir}/*.so.*
%files devel
%doc doc/jgt98convex.pdf
%{_includedir}/*
%{_libdir}/*.so
%{_libdir}/pkgconfig/*.pc
%changelog
* Wed Jan 09 2013 Dan Horák <dan[at]danny.cz> - 1.4-2
- build on platforms without valgrind
* Mon Oct 22 2012 Rich Mattes <richmattes@gmail.com> - 1.4-1
- Update to release 1.4
* Tue May 29 2012 Rich Mattes <richmattes@gmail.com> - 1.3-3
- Fixed pkgconfig file to point to correct include dir
* Sat May 26 2012 Rich Mattes <richmattes@gmail.com> - 1.3-2
- Convert test suite to CTest
* Fri May 25 2012 Rich Mattes <richmattes@gmail.com> - 1.3-1
- Update to release 1.3
- Remove upstreamed soname patch
* Sun May 06 2012 Rich Mattes <richmattes@gmail.com> - 1.2-3
- Removed -static subpackage.
* Mon Apr 30 2012 Rich Mattes <richmattes@gmail.com> - 1.2-2
- Update soname patch to match upstream implementation
* Fri Apr 27 2012 Rich Mattes <richmattes@gmail.com> - 1.2-1
- Initial package

View File

@ -0,0 +1 @@
684a9f2f44567a12a30af383de992a89 libccd-1.4.tar.gz