From 8658973ce93ec7346961f80e3d4c2e091958b58d Mon Sep 17 00:00:00 2001 From: Kristof Robot Date: Mon, 27 Oct 2014 09:36:16 +0100 Subject: [PATCH 1/3] wxwidgets: keeping in-source build (resolves #299) This commit provides the autotools-brokensep class and uses it for the wxwidgets recipe. The autotools-brokensep indicates that this package currently cannot handle out-of-source builds, and hence the in-source build must be kept until this is resolved. The autotools-brokensep class is a copy of the autotools-brokensep class provided in the openembedded-core commit 006b8a78 [1]. To make this commit backwards compatible to even earlier versions of openembedded-core, we provide this class in meta-ros ourselves. [1] http://cgit.openembedded.org/openembedded-core/commit/?id=006b8a7808a58713af16c326dc37d07765334b12 --- recipes-extended/wxwidgets/wxwidgets_2.9.5.bb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes-extended/wxwidgets/wxwidgets_2.9.5.bb b/recipes-extended/wxwidgets/wxwidgets_2.9.5.bb index 2fb79a1..6017a30 100644 --- a/recipes-extended/wxwidgets/wxwidgets_2.9.5.bb +++ b/recipes-extended/wxwidgets/wxwidgets_2.9.5.bb @@ -12,7 +12,7 @@ SRC_URI[sha256sum] = "b74ba96ca537cc5d049d21ec9ab5eb2670406a4aa9f1ea4845ea84a995 S = "${WORKDIR}/wxWidgets-${PV}" -inherit autotools pkgconfig binconfig +inherit autotools-brokensep pkgconfig binconfig EXTRA_AUTORECONF = " -I ${S}/build/aclocal" EXTRA_OECONF = " --with-opengl \ From af9e7cb233fe7f6c9707162b4b7e69ac8e483d1a Mon Sep 17 00:00:00 2001 From: Kristof Robot Date: Wed, 29 Oct 2014 19:52:27 +0100 Subject: [PATCH 2/3] libfreenect: backporting upstream patch to stop clobbering CFLAGS Backporting following libfreenect patch: https://github.com/OpenKinect/libfreenect/commit/ 0cbb86ec982d3e79ad5efa9d1b2b16724ae89bc5 Without this patch, libfreenect would override all compiler flags, including any machine specific compile flags (e.g. -mfloat-abi=hard to compile with hard floating point). We are backporting this patch rather than upgrading to v0.4.1 where this is fixed, as v0.4.0 introduced changes that break compatibility with the current freenect version (0.3.2). See https://github.com/OpenKinect/libfreenect/releases/tag/v0.4.0 for the breaking changes. See https://github.com/ros-drivers/freenect_stack/issues/12 for additional discussion. --- .../0001-Stop-clobbering-CFLAGS.patch | 129 ++++++++++++++++++ .../libfreenect/libfreenect_0.2.1.bb | 2 + 2 files changed, 131 insertions(+) create mode 100644 recipes-extended/libfreenect/libfreenect/0001-Stop-clobbering-CFLAGS.patch diff --git a/recipes-extended/libfreenect/libfreenect/0001-Stop-clobbering-CFLAGS.patch b/recipes-extended/libfreenect/libfreenect/0001-Stop-clobbering-CFLAGS.patch new file mode 100644 index 0000000..0fd3d9e --- /dev/null +++ b/recipes-extended/libfreenect/libfreenect/0001-Stop-clobbering-CFLAGS.patch @@ -0,0 +1,129 @@ +From 3c1098e119c39a0b42503371e0a452a399f4b170 Mon Sep 17 00:00:00 2001 +From: Benn Snyder +Date: Sat, 22 Mar 2014 16:06:09 -0400 +Subject: [PATCH] Stop clobbering CFLAGS FN_DEBUG: lost packets per frame + (lppf) + +Signed-off-by: Benn Snyder + +Upstream-Status: Backport [Accepted in 0.4.1] +--- + CMakeLists.txt | 21 ++++++++++++--------- + examples/CMakeLists.txt | 2 -- + src/CMakeLists.txt | 2 -- + src/cameras.c | 6 ++++++ + src/freenect_internal.h | 1 + + wrappers/cpp/CMakeLists.txt | 2 -- + 6 files changed, 19 insertions(+), 15 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index c1f4c02..4731324 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -100,15 +100,18 @@ SET(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin) + SET(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/lib) + SET(DOC_OUTPUT_PATH ${CMAKE_BINARY_DIR}/doc) + +-# let CFLAGS env override this +-if(CMAKE_C_FLAGS STREQUAL "") +- set(CMAKE_C_FLAGS "-O2") +-endif() +-SET(CMAKE_C_FLAGS_DEBUG "-g -DDEBUG=1") +-SET(CMAKE_C_FLAGS_RELEASE "-O2") +-SET(CMAKE_C_FLAGS_RELWITHDEBINFO "-O2 -g") +- +-add_definitions(-Wall) ++if (MSVC) ++ set(C_FLAGS_WARNING "-W4") ++else () ++ set(C_FLAGS_WARNING "-Wall") ++endif (MSVC) ++ ++# These defaults can be overriden by environment CFLAGS ++set(CMAKE_C_FLAGS "-O2 ${C_FLAGS_WARNING} ${CMAKE_C_FLAGS}") ++# Configurations ++SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS} -g -DDEBUG=1") ++SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS}") ++SET(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELEASE} -g") + + # Pretty much everyone is going to need the main includes + include_directories (${CMAKE_CURRENT_SOURCE_DIR}/include) +diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt +index 3ae566e..9cc401b 100644 +--- a/examples/CMakeLists.txt ++++ b/examples/CMakeLists.txt +@@ -2,8 +2,6 @@ + # Packages needed for examples + ###################################################################################### + +-set(CMAKE_C_FLAGS "-Wall") +- + if (WIN32) + set_source_files_properties(glview.c PROPERTIES LANGUAGE CXX) + set_source_files_properties(regview.c PROPERTIES LANGUAGE CXX) +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index e248ec4..669cab9 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -4,8 +4,6 @@ + + include_directories (${CMAKE_CURRENT_SOURCE_DIR}) + +-set(CMAKE_C_FLAGS "-Wall") +- + include_directories(${LIBUSB_1_INCLUDE_DIRS}) + IF(WIN32) + LIST(APPEND SRC core.c tilt.c cameras.c flags.c usb_libusb10.c registration.c ../platform/windows/libusb10emu/libusb-1.0/libusbemu.cpp ../platform/windows/libusb10emu/libusb-1.0/failguard.cpp) +diff --git a/src/cameras.c b/src/cameras.c +index 4a54d27..3b1c0e7 100644 +--- a/src/cameras.c ++++ b/src/cameras.c +@@ -129,7 +129,12 @@ static int stream_process(freenect_context *ctx, packet_stream *strm, uint8_t *p + // handle lost packets + if (strm->seq != hdr->seq) { + uint8_t lost = hdr->seq - strm->seq; ++ strm->lost_pkts += lost; + FN_LOG(l_info, "[Stream %02x] Lost %d packets\n", strm->flag, lost); ++ ++ FN_DEBUG("[Stream %02x] Lost %d total packets in %d frames (%f lppf)\n", ++ strm->flag, strm->lost_pkts, strm->valid_frames, (float)strm->lost_pkts / strm->valid_frames); ++ + if (lost > 5 || strm->variable_length) { + FN_LOG(l_notice, "[Stream %02x] Lost too many packets, resyncing...\n", strm->flag); + strm->synced = 0; +@@ -215,6 +220,7 @@ static int stream_process(freenect_context *ctx, packet_stream *strm, uint8_t *p + strm->timestamp = strm->last_timestamp; + strm->valid_frames++; + } ++ + return got_frame_size; + } + +diff --git a/src/freenect_internal.h b/src/freenect_internal.h +index 8df4ee2..dee3525 100644 +--- a/src/freenect_internal.h ++++ b/src/freenect_internal.h +@@ -147,6 +147,7 @@ typedef struct { + int frame_size; + int last_pkt_size; + int valid_pkts; ++ uint lost_pkts; + int valid_frames; + int variable_length; + uint32_t last_timestamp; +diff --git a/wrappers/cpp/CMakeLists.txt b/wrappers/cpp/CMakeLists.txt +index ff8469f..64b721d 100644 +--- a/wrappers/cpp/CMakeLists.txt ++++ b/wrappers/cpp/CMakeLists.txt +@@ -3,8 +3,6 @@ INSTALL(FILES libfreenect.hpp + + IF(BUILD_EXAMPLES) + +-set(CMAKE_C_FLAGS "-Wall") +- + if (WIN32) + set(THREADS_USE_PTHREADS_WIN32 true) + find_package(Threads REQUIRED) +-- +1.8.3.2 + diff --git a/recipes-extended/libfreenect/libfreenect_0.2.1.bb b/recipes-extended/libfreenect/libfreenect_0.2.1.bb index 03adb0e..e6c0b22 100644 --- a/recipes-extended/libfreenect/libfreenect_0.2.1.bb +++ b/recipes-extended/libfreenect/libfreenect_0.2.1.bb @@ -8,6 +8,8 @@ SRC_URI = "https://github.com/OpenKinect/libfreenect/archive/v${PV}.tar.gz;downl SRC_URI[md5sum] = "95a3d8d2cc6a71db1bc53c579647fabf" SRC_URI[sha256sum] = "9fdc348a12b9a7008f4ec20188666bf549e6bbbe3fe9199757c37332a286abfb" +SRC_URI += "file://0001-Stop-clobbering-CFLAGS.patch" + inherit cmake #force libs always into /usr/lib, even when compiling on 64bit arch From 09645131293ae8bfada006c6b58df34b6b72c4f0 Mon Sep 17 00:00:00 2001 From: Kristof Robot Date: Wed, 29 Oct 2014 19:59:26 +0100 Subject: [PATCH 3/3] libfreenect: adding bash runtime dependency Solves following warning: QA Issue: libfreenect requires /bin/bash, but no providers in its RDEPENDS [file-rdeps] --- recipes-extended/libfreenect/libfreenect_0.2.1.bb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/recipes-extended/libfreenect/libfreenect_0.2.1.bb b/recipes-extended/libfreenect/libfreenect_0.2.1.bb index e6c0b22..0cb21d7 100644 --- a/recipes-extended/libfreenect/libfreenect_0.2.1.bb +++ b/recipes-extended/libfreenect/libfreenect_0.2.1.bb @@ -18,3 +18,5 @@ EXTRA_OECMAKE += " -DLIB_SUFFIX=''" FILES_${PN} += "${libdir}/fakenect/${BPN}.so.*" FILES_${PN}-dev += "${libdir}/fakenect/${BPN}.so" FILES_${PN}-dbg += "${libdir}/fakenect/.debug" + +RDEPENDS_${PN} += "bash"