diff --git a/libfreenect-0.5.3-cpp11.patch b/libfreenect-0.5.3-cpp11.patch new file mode 100644 index 0000000..b20069b --- /dev/null +++ b/libfreenect-0.5.3-cpp11.patch @@ -0,0 +1,43 @@ +diff -up ./OpenNI2-FreenectDriver/src/ColorStream.hpp.cpp11 ./OpenNI2-FreenectDriver/src/ColorStream.hpp +--- ./OpenNI2-FreenectDriver/src/ColorStream.hpp.cpp11 2016-02-21 12:18:01.412029788 -0500 ++++ ./OpenNI2-FreenectDriver/src/ColorStream.hpp 2016-02-21 12:18:21.272807345 -0500 +@@ -13,9 +13,9 @@ namespace FreenectDriver + { + public: + // from NUI library & converted to radians +- static const float DIAGONAL_FOV = 73.9 * (M_PI / 180); +- static const float HORIZONTAL_FOV = 62 * (M_PI / 180); +- static const float VERTICAL_FOV = 48.6 * (M_PI / 180); ++ static constexpr float DIAGONAL_FOV = 73.9 * (M_PI / 180); ++ static constexpr float HORIZONTAL_FOV = 62 * (M_PI / 180); ++ static constexpr float VERTICAL_FOV = 48.6 * (M_PI / 180); + + private: + typedef std::map< OniVideoMode, std::pair > FreenectVideoModeMap; +diff -up ./OpenNI2-FreenectDriver/src/DepthStream.hpp.cpp11 ./OpenNI2-FreenectDriver/src/DepthStream.hpp +--- ./OpenNI2-FreenectDriver/src/DepthStream.hpp.cpp11 2016-02-21 12:22:59.048682374 -0500 ++++ ./OpenNI2-FreenectDriver/src/DepthStream.hpp 2016-02-21 12:23:27.387791861 -0500 +@@ -17,9 +17,9 @@ namespace FreenectDriver + { + public: + // from NUI library and converted to radians +- static const float DIAGONAL_FOV = 70 * (M_PI / 180); +- static const float HORIZONTAL_FOV = 58.5 * (M_PI / 180); +- static const float VERTICAL_FOV = 45.6 * (M_PI / 180); ++ static constexpr float DIAGONAL_FOV = 70 * (M_PI / 180); ++ static constexpr float HORIZONTAL_FOV = 58.5 * (M_PI / 180); ++ static constexpr float VERTICAL_FOV = 45.6 * (M_PI / 180); + // from DepthKinectStream.cpp + static const int MAX_VALUE = 10000; + static const unsigned long long GAIN_VAL = 42; +@@ -28,8 +28,8 @@ namespace FreenectDriver + static const unsigned long long PARAM_COEFF_VAL = 4; + static const unsigned long long SHIFT_SCALE_VAL = 10; + static const unsigned long long ZERO_PLANE_DISTANCE_VAL = 120; +- static const double ZERO_PLANE_PIXEL_SIZE_VAL = 0.10520000010728836; +- static const double EMITTER_DCMOS_DISTANCE_VAL = 7.5; ++ static constexpr double ZERO_PLANE_PIXEL_SIZE_VAL = 0.10520000010728836; ++ static constexpr double EMITTER_DCMOS_DISTANCE_VAL = 7.5; + + private: + typedef std::map< OniVideoMode, std::pair > FreenectDepthModeMap; diff --git a/libfreenect.spec b/libfreenect.spec index 5a729dc..e7ce8bc 100644 --- a/libfreenect.spec +++ b/libfreenect.spec @@ -26,6 +26,8 @@ Patch3: %{name}-0.4.2-libdir.patch Patch4: secarch.patch # Catch exception in freenect-cppview when a freenect device is not presenet Patch5: %{name}-0.5.3-noabort.patch +# Fix const/constexpr usage for c++11 +Patch6: %{name}-0.5.3-cpp11.patch BuildRequires: cmake BuildRequires: Cython @@ -106,6 +108,7 @@ rm -rf platform/windows %patch3 -p0 -b .libdir %patch4 -p1 -b .secarch %patch5 -p0 -b .noabort +%patch6 -p0 -b .cpp11 %build mkdir build