Compare commits
3 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4dc685c7fe | ||
|
|
8d4feccd01 | ||
|
|
a8024145cc |
6 changed files with 439 additions and 0 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -0,0 +1 @@
|
||||||
|
/libfreenect-v0.1.2.tar.bz2
|
||||||
11
freenect_generate_tarball.sh
Executable file
11
freenect_generate_tarball.sh
Executable file
|
|
@ -0,0 +1,11 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
|
||||||
|
git clone git://github.com/OpenKinect/libfreenect
|
||||||
|
pushd libfreenect
|
||||||
|
git checkout $1
|
||||||
|
sh mkcontrib.sh
|
||||||
|
find ./ -name ".git*" -exec rm -rf {} ';'
|
||||||
|
rm -rf platform/windows platform/osx
|
||||||
|
popd
|
||||||
|
tar cjf libfreenect-$1.tar.bz2 libfreenect
|
||||||
177
libfreenect-0.1.2-align.patch
Normal file
177
libfreenect-0.1.2-align.patch
Normal file
|
|
@ -0,0 +1,177 @@
|
||||||
|
commit e1365de85617781e370abdc7ce1ef6d9875d55de
|
||||||
|
Author: Drew Fisher <drew.m.fisher@gmail.com>
|
||||||
|
Date: Mon Jan 23 07:41:41 2012 -0800
|
||||||
|
|
||||||
|
cameras.c: memcpy structs into properly aligned buffers before toggling endianness.
|
||||||
|
|
||||||
|
The new registration structs are not aligned to 4-byte boundaries in the
|
||||||
|
buffers that we get back from the Kinect. This might have been causing
|
||||||
|
breakage on ARM, where nonaligned access is prohibited.
|
||||||
|
|
||||||
|
Signed-off-by: Drew Fisher <drew.m.fisher@gmail.com>
|
||||||
|
|
||||||
|
diff --git a/src/cameras.c b/src/cameras.c
|
||||||
|
index 9f0beb9..d391a7c 100644
|
||||||
|
--- a/src/cameras.c
|
||||||
|
+++ b/src/cameras.c
|
||||||
|
@@ -783,56 +783,55 @@ static int freenect_fetch_reg_info(freenect_device *dev)
|
||||||
|
FN_ERROR("freenect_fetch_reg_info: send_cmd read %d bytes (expected 118)\n", res);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
- freenect_reg_info *reg_info_ptr = (freenect_reg_info*)(&reply[2]);
|
||||||
|
- freenect_reg_info *dev_reg_info = &(dev->registration.reg_info);
|
||||||
|
- dev_reg_info->ax = fn_le32s(reg_info_ptr->ax);
|
||||||
|
- dev_reg_info->bx = fn_le32s(reg_info_ptr->bx);
|
||||||
|
- dev_reg_info->cx = fn_le32s(reg_info_ptr->cx);
|
||||||
|
- dev_reg_info->dx = fn_le32s(reg_info_ptr->dx);
|
||||||
|
- dev_reg_info->ay = fn_le32s(reg_info_ptr->ay);
|
||||||
|
- dev_reg_info->by = fn_le32s(reg_info_ptr->by);
|
||||||
|
- dev_reg_info->cy = fn_le32s(reg_info_ptr->cy);
|
||||||
|
- dev_reg_info->dy = fn_le32s(reg_info_ptr->dy);
|
||||||
|
- dev_reg_info->dx_start = fn_le32s(reg_info_ptr->dx_start);
|
||||||
|
- dev_reg_info->dy_start = fn_le32s(reg_info_ptr->dy_start);
|
||||||
|
- dev_reg_info->dx_beta_start = fn_le32s(reg_info_ptr->dx_beta_start);
|
||||||
|
- dev_reg_info->dy_beta_start = fn_le32s(reg_info_ptr->dy_beta_start);
|
||||||
|
- dev_reg_info->dx_beta_inc = fn_le32s(reg_info_ptr->dx_beta_inc);
|
||||||
|
- dev_reg_info->dy_beta_inc = fn_le32s(reg_info_ptr->dy_beta_inc);
|
||||||
|
- dev_reg_info->dxdx_start = fn_le32s(reg_info_ptr->dxdx_start);
|
||||||
|
- dev_reg_info->dxdy_start = fn_le32s(reg_info_ptr->dxdy_start);
|
||||||
|
- dev_reg_info->dydx_start = fn_le32s(reg_info_ptr->dydx_start);
|
||||||
|
- dev_reg_info->dydy_start = fn_le32s(reg_info_ptr->dydy_start);
|
||||||
|
- dev_reg_info->dxdxdx_start = fn_le32s(reg_info_ptr->dxdxdx_start);
|
||||||
|
- dev_reg_info->dydxdx_start = fn_le32s(reg_info_ptr->dydxdx_start);
|
||||||
|
- dev_reg_info->dxdxdy_start = fn_le32s(reg_info_ptr->dxdxdy_start);
|
||||||
|
- dev_reg_info->dydxdy_start = fn_le32s(reg_info_ptr->dydxdy_start);
|
||||||
|
- dev_reg_info->dydydx_start = fn_le32s(reg_info_ptr->dydydx_start);
|
||||||
|
- dev_reg_info->dydydy_start = fn_le32s(reg_info_ptr->dydydy_start);
|
||||||
|
- FN_SPEW("ax: %d\n", dev_reg_info->ax);
|
||||||
|
- FN_SPEW("bx: %d\n", dev_reg_info->bx);
|
||||||
|
- FN_SPEW("cx: %d\n", dev_reg_info->cx);
|
||||||
|
- FN_SPEW("dx: %d\n", dev_reg_info->dx);
|
||||||
|
- FN_SPEW("ay: %d\n", dev_reg_info->ay);
|
||||||
|
- FN_SPEW("by: %d\n", dev_reg_info->by);
|
||||||
|
- FN_SPEW("cy: %d\n", dev_reg_info->cy);
|
||||||
|
- FN_SPEW("dy: %d\n", dev_reg_info->dy);
|
||||||
|
- FN_SPEW("dx_start: %d\n", dev_reg_info->dx_start);
|
||||||
|
- FN_SPEW("dy_start: %d\n", dev_reg_info->dy_start);
|
||||||
|
- FN_SPEW("dx_beta_start: %d\n", dev_reg_info->dx_beta_start);
|
||||||
|
- FN_SPEW("dy_beta_start: %d\n", dev_reg_info->dy_beta_start);
|
||||||
|
- FN_SPEW("dx_beta_inc: %d\n", dev_reg_info->dx_beta_inc);
|
||||||
|
- FN_SPEW("dy_beta_inc: %d\n", dev_reg_info->dy_beta_inc);
|
||||||
|
- FN_SPEW("dxdx_start: %d\n", dev_reg_info->dxdx_start);
|
||||||
|
- FN_SPEW("dxdy_start: %d\n", dev_reg_info->dxdy_start);
|
||||||
|
- FN_SPEW("dydx_start: %d\n", dev_reg_info->dydx_start);
|
||||||
|
- FN_SPEW("dydy_start: %d\n", dev_reg_info->dydy_start);
|
||||||
|
- FN_SPEW("dxdxdx_start: %d\n", dev_reg_info->dxdxdx_start);
|
||||||
|
- FN_SPEW("dydxdx_start: %d\n", dev_reg_info->dydxdx_start);
|
||||||
|
- FN_SPEW("dxdxdy_start: %d\n", dev_reg_info->dxdxdy_start);
|
||||||
|
- FN_SPEW("dydxdy_start: %d\n", dev_reg_info->dydxdy_start);
|
||||||
|
- FN_SPEW("dydydx_start: %d\n", dev_reg_info->dydydx_start);
|
||||||
|
- FN_SPEW("dydydy_start: %d\n", dev_reg_info->dydydy_start);
|
||||||
|
+ memcpy(&dev->registration.reg_info, reply + 2, sizeof(dev->registration.reg_info));
|
||||||
|
+ dev->registration.reg_info.ax = fn_le32s(dev->registration.reg_info.ax);
|
||||||
|
+ dev->registration.reg_info.bx = fn_le32s(dev->registration.reg_info.bx);
|
||||||
|
+ dev->registration.reg_info.cx = fn_le32s(dev->registration.reg_info.cx);
|
||||||
|
+ dev->registration.reg_info.dx = fn_le32s(dev->registration.reg_info.dx);
|
||||||
|
+ dev->registration.reg_info.ay = fn_le32s(dev->registration.reg_info.ay);
|
||||||
|
+ dev->registration.reg_info.by = fn_le32s(dev->registration.reg_info.by);
|
||||||
|
+ dev->registration.reg_info.cy = fn_le32s(dev->registration.reg_info.cy);
|
||||||
|
+ dev->registration.reg_info.dy = fn_le32s(dev->registration.reg_info.dy);
|
||||||
|
+ dev->registration.reg_info.dx_start = fn_le32s(dev->registration.reg_info.dx_start);
|
||||||
|
+ dev->registration.reg_info.dy_start = fn_le32s(dev->registration.reg_info.dy_start);
|
||||||
|
+ dev->registration.reg_info.dx_beta_start = fn_le32s(dev->registration.reg_info.dx_beta_start);
|
||||||
|
+ dev->registration.reg_info.dy_beta_start = fn_le32s(dev->registration.reg_info.dy_beta_start);
|
||||||
|
+ dev->registration.reg_info.dx_beta_inc = fn_le32s(dev->registration.reg_info.dx_beta_inc);
|
||||||
|
+ dev->registration.reg_info.dy_beta_inc = fn_le32s(dev->registration.reg_info.dy_beta_inc);
|
||||||
|
+ dev->registration.reg_info.dxdx_start = fn_le32s(dev->registration.reg_info.dxdx_start);
|
||||||
|
+ dev->registration.reg_info.dxdy_start = fn_le32s(dev->registration.reg_info.dxdy_start);
|
||||||
|
+ dev->registration.reg_info.dydx_start = fn_le32s(dev->registration.reg_info.dydx_start);
|
||||||
|
+ dev->registration.reg_info.dydy_start = fn_le32s(dev->registration.reg_info.dydy_start);
|
||||||
|
+ dev->registration.reg_info.dxdxdx_start = fn_le32s(dev->registration.reg_info.dxdxdx_start);
|
||||||
|
+ dev->registration.reg_info.dydxdx_start = fn_le32s(dev->registration.reg_info.dydxdx_start);
|
||||||
|
+ dev->registration.reg_info.dxdxdy_start = fn_le32s(dev->registration.reg_info.dxdxdy_start);
|
||||||
|
+ dev->registration.reg_info.dydxdy_start = fn_le32s(dev->registration.reg_info.dydxdy_start);
|
||||||
|
+ dev->registration.reg_info.dydydx_start = fn_le32s(dev->registration.reg_info.dydydx_start);
|
||||||
|
+ dev->registration.reg_info.dydydy_start = fn_le32s(dev->registration.reg_info.dydydy_start);
|
||||||
|
+ FN_SPEW("ax: %d\n", dev->registration.reg_info.ax);
|
||||||
|
+ FN_SPEW("bx: %d\n", dev->registration.reg_info.bx);
|
||||||
|
+ FN_SPEW("cx: %d\n", dev->registration.reg_info.cx);
|
||||||
|
+ FN_SPEW("dx: %d\n", dev->registration.reg_info.dx);
|
||||||
|
+ FN_SPEW("ay: %d\n", dev->registration.reg_info.ay);
|
||||||
|
+ FN_SPEW("by: %d\n", dev->registration.reg_info.by);
|
||||||
|
+ FN_SPEW("cy: %d\n", dev->registration.reg_info.cy);
|
||||||
|
+ FN_SPEW("dy: %d\n", dev->registration.reg_info.dy);
|
||||||
|
+ FN_SPEW("dx_start: %d\n", dev->registration.reg_info.dx_start);
|
||||||
|
+ FN_SPEW("dy_start: %d\n", dev->registration.reg_info.dy_start);
|
||||||
|
+ FN_SPEW("dx_beta_start: %d\n", dev->registration.reg_info.dx_beta_start);
|
||||||
|
+ FN_SPEW("dy_beta_start: %d\n", dev->registration.reg_info.dy_beta_start);
|
||||||
|
+ FN_SPEW("dx_beta_inc: %d\n", dev->registration.reg_info.dx_beta_inc);
|
||||||
|
+ FN_SPEW("dy_beta_inc: %d\n", dev->registration.reg_info.dy_beta_inc);
|
||||||
|
+ FN_SPEW("dxdx_start: %d\n", dev->registration.reg_info.dxdx_start);
|
||||||
|
+ FN_SPEW("dxdy_start: %d\n", dev->registration.reg_info.dxdy_start);
|
||||||
|
+ FN_SPEW("dydx_start: %d\n", dev->registration.reg_info.dydx_start);
|
||||||
|
+ FN_SPEW("dydy_start: %d\n", dev->registration.reg_info.dydy_start);
|
||||||
|
+ FN_SPEW("dxdxdx_start: %d\n", dev->registration.reg_info.dxdxdx_start);
|
||||||
|
+ FN_SPEW("dydxdx_start: %d\n", dev->registration.reg_info.dydxdx_start);
|
||||||
|
+ FN_SPEW("dxdxdy_start: %d\n", dev->registration.reg_info.dxdxdy_start);
|
||||||
|
+ FN_SPEW("dydxdy_start: %d\n", dev->registration.reg_info.dydxdy_start);
|
||||||
|
+ FN_SPEW("dydydx_start: %d\n", dev->registration.reg_info.dydydx_start);
|
||||||
|
+ FN_SPEW("dydydy_start: %d\n", dev->registration.reg_info.dydydy_start);
|
||||||
|
/*
|
||||||
|
// NOTE: Not assigned above
|
||||||
|
FN_SPEW("dx_center: %d\n", dev_reg_info->dx_center);
|
||||||
|
@@ -861,10 +860,10 @@ static int freenect_fetch_reg_pad_info(freenect_device *dev)
|
||||||
|
FN_ERROR("freenect_fetch_reg_pad_info: send_cmd read %d bytes (expected 8)\n", res);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
- freenect_reg_pad_info *pad_info_ptr = (freenect_reg_pad_info*)(&reply[2]);
|
||||||
|
- dev->registration.reg_pad_info.start_lines = fn_le16s(pad_info_ptr->start_lines);
|
||||||
|
- dev->registration.reg_pad_info.end_lines = fn_le16s(pad_info_ptr->end_lines);
|
||||||
|
- dev->registration.reg_pad_info.cropping_lines = fn_le16s(pad_info_ptr->cropping_lines);
|
||||||
|
+ memcpy(&dev->registration.reg_pad_info, reply+2, sizeof(dev->registration.reg_pad_info));
|
||||||
|
+ dev->registration.reg_pad_info.start_lines = fn_le16s(dev->registration.reg_pad_info.start_lines);
|
||||||
|
+ dev->registration.reg_pad_info.end_lines = fn_le16s(dev->registration.reg_pad_info.end_lines);
|
||||||
|
+ dev->registration.reg_pad_info.cropping_lines = fn_le16s(dev->registration.reg_pad_info.cropping_lines);
|
||||||
|
FN_SPEW("start_lines: %u\n",dev->registration.reg_pad_info.start_lines);
|
||||||
|
FN_SPEW("end_lines: %u\n",dev->registration.reg_pad_info.end_lines);
|
||||||
|
FN_SPEW("cropping_lines: %u\n",dev->registration.reg_pad_info.cropping_lines);
|
||||||
|
@@ -888,7 +887,9 @@ static int freenect_fetch_reg_const_shift(freenect_device *dev)
|
||||||
|
FN_ERROR("freenect_fetch_reg_const_shift: send_cmd read %d bytes (expected 8)\n", res);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
- uint16_t shift = fn_le16(*((uint16_t*)(reply+2)));
|
||||||
|
+ uint16_t shift;
|
||||||
|
+ memcpy(&shift, reply+2, sizeof(shift));
|
||||||
|
+ shift = fn_le16(shift);
|
||||||
|
dev->registration.const_shift = (double)shift;
|
||||||
|
FN_SPEW("const_shift: %f\n",dev->registration.const_shift);
|
||||||
|
return 0;
|
||||||
|
@@ -907,17 +908,18 @@ static int freenect_fetch_zero_plane_info(freenect_device *dev)
|
||||||
|
FN_ERROR("freenect_fetch_zero_plane_info: send_cmd read %d bytes (expected 322)\n", res);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
+
|
||||||
|
+ memcpy(&(dev->registration.zero_plane_info), reply + 94, sizeof(dev->registration.zero_plane_info));
|
||||||
|
+ dev->registration.zero_plane_info.dcmos_emitter_dist = *((float*)(&fn_le32(*((uint32_t*)(&dev->registration.zero_plane_info.dcmos_emitter_dist)))));
|
||||||
|
+ dev->registration.zero_plane_info.dcmos_rcmos_dist = *((float*)(&fn_le32(*((uint32_t*)(&dev->registration.zero_plane_info.dcmos_rcmos_dist)))));
|
||||||
|
+ dev->registration.zero_plane_info.reference_distance = *((float*)(&fn_le32(*((uint32_t*)(&dev->registration.zero_plane_info.reference_distance)))));
|
||||||
|
+ dev->registration.zero_plane_info.reference_pixel_size = *((float*)(&fn_le32(*((uint32_t*)(&dev->registration.zero_plane_info.reference_pixel_size)))));
|
||||||
|
+
|
||||||
|
// WTF is all this data? it's way bigger than sizeof(XnFixedParams)...
|
||||||
|
- FN_SPEW("dcmos_emitter_distance: %f\n", *((float*)(reply+94)));
|
||||||
|
- FN_SPEW("dcmos_rcmos_distance: %f\n", *((float*)(reply+98)));
|
||||||
|
- FN_SPEW("reference_distance: %f\n", *((float*)(reply+102)));
|
||||||
|
- FN_SPEW("reference_pixel_size: %f\n", *((float*)(reply+106)));
|
||||||
|
-
|
||||||
|
- // The values are 32-bit floats in little-endian. So:
|
||||||
|
- dev->registration.zero_plane_info.dcmos_emitter_dist = *((float*)(&fn_le32(*((uint32_t*)(reply+94)))));
|
||||||
|
- dev->registration.zero_plane_info.dcmos_rcmos_dist = *((float*)(&fn_le32(*((uint32_t*)(reply+98)))));
|
||||||
|
- dev->registration.zero_plane_info.reference_distance = *((float*)(&fn_le32(*((uint32_t*)(reply+102)))));
|
||||||
|
- dev->registration.zero_plane_info.reference_pixel_size = *((float*)(&fn_le32(*((uint32_t*)(reply+106)))));
|
||||||
|
+ FN_SPEW("dcmos_emitter_distance: %f\n", dev->registration.zero_plane_info.dcmos_emitter_dist);
|
||||||
|
+ FN_SPEW("dcmos_rcmos_distance: %f\n", dev->registration.zero_plane_info.dcmos_rcmos_dist);
|
||||||
|
+ FN_SPEW("reference_distance: %f\n", dev->registration.zero_plane_info.reference_distance);
|
||||||
|
+ FN_SPEW("reference_pixel_size: %f\n", dev->registration.zero_plane_info.reference_pixel_size);
|
||||||
|
|
||||||
|
// FIXME: OpenNI seems to use a hardcoded value of 2.4 instead of 2.3 as reported by Kinect
|
||||||
|
dev->registration.zero_plane_info.dcmos_rcmos_dist = 2.4;
|
||||||
59
libfreenect-0.1.2-big-endian.patch
Normal file
59
libfreenect-0.1.2-big-endian.patch
Normal file
|
|
@ -0,0 +1,59 @@
|
||||||
|
commit bbc109a589a1dd2c229f8bc98536dbc184dd73f9
|
||||||
|
Author: Drew Fisher <drew.m.fisher@gmail.com>
|
||||||
|
Date: Sun Jan 29 16:28:32 2012 -0800
|
||||||
|
|
||||||
|
Build on big-endian systems again.
|
||||||
|
|
||||||
|
On big endian, fn_le32() is actually a function, not an empty preprocessor
|
||||||
|
macro, so we can't take the address of its return value when doing the C
|
||||||
|
equivalent of reinterpret_cast.
|
||||||
|
|
||||||
|
Signed-off-by: Drew Fisher <drew.m.fisher@gmail.com>
|
||||||
|
|
||||||
|
diff --git a/src/cameras.c b/src/cameras.c
|
||||||
|
index d391a7c..a078e1d 100644
|
||||||
|
--- a/src/cameras.c
|
||||||
|
+++ b/src/cameras.c
|
||||||
|
@@ -910,10 +910,15 @@ static int freenect_fetch_zero_plane_info(freenect_device *dev)
|
||||||
|
}
|
||||||
|
|
||||||
|
memcpy(&(dev->registration.zero_plane_info), reply + 94, sizeof(dev->registration.zero_plane_info));
|
||||||
|
- dev->registration.zero_plane_info.dcmos_emitter_dist = *((float*)(&fn_le32(*((uint32_t*)(&dev->registration.zero_plane_info.dcmos_emitter_dist)))));
|
||||||
|
- dev->registration.zero_plane_info.dcmos_rcmos_dist = *((float*)(&fn_le32(*((uint32_t*)(&dev->registration.zero_plane_info.dcmos_rcmos_dist)))));
|
||||||
|
- dev->registration.zero_plane_info.reference_distance = *((float*)(&fn_le32(*((uint32_t*)(&dev->registration.zero_plane_info.reference_distance)))));
|
||||||
|
- dev->registration.zero_plane_info.reference_pixel_size = *((float*)(&fn_le32(*((uint32_t*)(&dev->registration.zero_plane_info.reference_pixel_size)))));
|
||||||
|
+ uint32_t temp;
|
||||||
|
+ temp = fn_le32(*((uint32_t*)(&dev->registration.zero_plane_info.dcmos_emitter_dist)));
|
||||||
|
+ dev->registration.zero_plane_info.dcmos_emitter_dist = *((float*)(&temp));
|
||||||
|
+ temp = fn_le32(*((uint32_t*)(&dev->registration.zero_plane_info.dcmos_rcmos_dist)));
|
||||||
|
+ dev->registration.zero_plane_info.dcmos_rcmos_dist = *((float*)(&temp));
|
||||||
|
+ temp = fn_le32(*((uint32_t*)(&dev->registration.zero_plane_info.reference_distance)));
|
||||||
|
+ dev->registration.zero_plane_info.reference_distance = *((float*)(&temp));
|
||||||
|
+ temp = fn_le32(*((uint32_t*)(&dev->registration.zero_plane_info.reference_pixel_size)));
|
||||||
|
+ dev->registration.zero_plane_info.reference_pixel_size = *((float*)(&temp));
|
||||||
|
|
||||||
|
// WTF is all this data? it's way bigger than sizeof(XnFixedParams)...
|
||||||
|
FN_SPEW("dcmos_emitter_distance: %f\n", dev->registration.zero_plane_info.dcmos_emitter_dist);
|
||||||
|
diff --git a/src/freenect_internal.h b/src/freenect_internal.h
|
||||||
|
index 4e7950e..d23208a 100644
|
||||||
|
--- a/src/freenect_internal.h
|
||||||
|
+++ b/src/freenect_internal.h
|
||||||
|
@@ -89,12 +89,16 @@ static inline uint32_t fn_le32(uint32_t d)
|
||||||
|
static inline int16_t fn_le16s(int16_t s)
|
||||||
|
{
|
||||||
|
// reinterpret cast to unsigned, use the normal fn_le16, and then reinterpret cast back
|
||||||
|
- return *((int16_t*)(&fn_le16(*((uint16_t*)(&s)))));
|
||||||
|
+ uint16_t temp = (*(uint16_t*)(&s));
|
||||||
|
+ temp = fn_le16(temp);
|
||||||
|
+ return *((int16_t*)(&temp));
|
||||||
|
}
|
||||||
|
static inline int32_t fn_le32s(int32_t s)
|
||||||
|
{
|
||||||
|
// reinterpret cast to unsigned, use the normal fn_le32, and then reinterpret cast back
|
||||||
|
- return *((int32_t*)(&fn_le32(*((uint32_t*)(&s)))));
|
||||||
|
+ uint32_t temp = (*(uint32_t*)(&s));
|
||||||
|
+ temp = fn_le32(temp);
|
||||||
|
+ return *((int32_t*)(&temp));
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
#define fn_le16(x) (x)
|
||||||
190
libfreenect.spec
Normal file
190
libfreenect.spec
Normal file
|
|
@ -0,0 +1,190 @@
|
||||||
|
%{?filter_setup:
|
||||||
|
%filter_provides_in %{python_sitearch}/.*\.so$
|
||||||
|
%filter_setup
|
||||||
|
}
|
||||||
|
|
||||||
|
Name: libfreenect
|
||||||
|
Version: 0.1.2
|
||||||
|
Release: 4%{?dist}
|
||||||
|
Summary: Device driver for the Kinect
|
||||||
|
License: GPLv2+ or ASL 2.0
|
||||||
|
URL: http://www.openkinect.org/
|
||||||
|
|
||||||
|
# No official releases, yet. To reproduce tarball use freenect_generate_tarball.sh:
|
||||||
|
# Usage: freenect_generate_tarball.sh [GIT TAG]
|
||||||
|
Source0: libfreenect-v%{version}.tar.bz2
|
||||||
|
Source1: freenect_generate_tarball.sh
|
||||||
|
|
||||||
|
# https://github.com/OpenKinect/libfreenect/commit/e1365de85617781e370abdc7ce1ef6d9875d55de
|
||||||
|
Patch0: %{name}-0.1.2-align.patch
|
||||||
|
# https://github.com/OpenKinect/libfreenect/commit/bbc109a589a1dd2c229f8bc98536dbc184dd73f9
|
||||||
|
Patch1: %{name}-0.1.2-big-endian.patch
|
||||||
|
|
||||||
|
BuildRequires: cmake
|
||||||
|
BuildRequires: Cython
|
||||||
|
BuildRequires: doxygen
|
||||||
|
BuildRequires: freeglut-devel
|
||||||
|
BuildRequires: libusb1-devel
|
||||||
|
BuildRequires: libGL-devel
|
||||||
|
BuildRequires: libXi-devel
|
||||||
|
BuildRequires: libXmu-devel
|
||||||
|
BuildRequires: numpy
|
||||||
|
BuildRequires: opencv-devel
|
||||||
|
BuildRequires: python-devel
|
||||||
|
|
||||||
|
Requires: udev
|
||||||
|
|
||||||
|
%description
|
||||||
|
libfreenect is a free and open source library that provides access to the
|
||||||
|
Kinect device. Currently, the library supports the RGB webcam, the depth
|
||||||
|
image, the LED, and the tilt motor.
|
||||||
|
|
||||||
|
|
||||||
|
%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}.
|
||||||
|
|
||||||
|
%package static
|
||||||
|
Summary: Development files for %{name}
|
||||||
|
Requires: %{name}-devel%{?_isa} = %{version}-%{release}
|
||||||
|
|
||||||
|
%description static
|
||||||
|
The %{name}-static package contains static libraries for
|
||||||
|
developing applications that use %{name}.
|
||||||
|
|
||||||
|
%package fakenect
|
||||||
|
Summary: Library to play back recorded data for %{name}
|
||||||
|
Requires: %{name}%{?_isa} = %{version}-%{release}
|
||||||
|
|
||||||
|
%description fakenect
|
||||||
|
Fakenect consists of a "record" program to save dumps from the kinect sensor
|
||||||
|
and a library that can be linked to, providing an interface compatible with
|
||||||
|
freenect. This allows you to save data and repeat for experiments, debug
|
||||||
|
problems, share datasets, and experiment with the kinect without having one.
|
||||||
|
|
||||||
|
%package opencv
|
||||||
|
Summary: OpenCV bindings for %{name}
|
||||||
|
Requires: %{name}%{?_isa} = %{version}-%{release}
|
||||||
|
|
||||||
|
%description opencv
|
||||||
|
The %{name}-opencv package contains the libfreenect binding
|
||||||
|
library for OpenCV development.
|
||||||
|
|
||||||
|
%package python
|
||||||
|
Summary: Python bindings for %{name}
|
||||||
|
Requires: %{name}%{?_isa} = %{version}-%{release}
|
||||||
|
|
||||||
|
%description python
|
||||||
|
The %{name}-python package contains python bindings for %{name}
|
||||||
|
|
||||||
|
%prep
|
||||||
|
%setup -q -n %{name}
|
||||||
|
%patch0 -p1 -b .align
|
||||||
|
%patch1 -p1 -b .big-endian
|
||||||
|
# Get rid of osx and win specific stuff
|
||||||
|
sed -i 's|get_python_lib(prefix='\''${CMAKE_INSTALL_PREFIX}'\'')|get_python_lib(1)|' wrappers/python/CMakeLists.txt
|
||||||
|
sed -i 's|/usr/local|/usr|' wrappers/python/setup.py
|
||||||
|
chmod -x wrappers/cpp/cppview.cpp
|
||||||
|
sed -i 's|set(CMAKE_C_FLAGS "-Wall")|#set(CMAKE_C_FLAGS "-Wall")|' src/CMakeLists.txt
|
||||||
|
sed -i 's|set(CMAKE_C_FLAGS "-Wall")|#set(CMAKE_C_FLAGS "-Wall")|' examples/CMakeLists.txt
|
||||||
|
|
||||||
|
%build
|
||||||
|
mkdir build
|
||||||
|
pushd build
|
||||||
|
%cmake -DBUILD_AUDIO=ON -DBUILD-CPP=ON -DBUILD_C_SYNC=ON -DBUILD_CV=ON -DBUILD_REDIST_PACKAGE=ON -DBUILD_EXAMPLES=ON -DBUILD_CPACK=OFF -DBUILD_FAKENECT=ON -DBUILD_PYTHON=ON ..
|
||||||
|
make %{?_smp_mflags} VERBOSE=1
|
||||||
|
popd
|
||||||
|
|
||||||
|
pushd doc
|
||||||
|
doxygen Doxyfile
|
||||||
|
popd
|
||||||
|
|
||||||
|
%install
|
||||||
|
rm -rf %{buildroot}
|
||||||
|
make -C build install DESTDIR=%{buildroot}
|
||||||
|
mkdir -p %{buildroot}/lib/udev/rules.d
|
||||||
|
install -p -m 0644 platform/linux/udev/51-kinect.rules %{buildroot}/lib/udev/rules.d
|
||||||
|
find %{buildroot} -name '*.la' -exec rm -f {} ';'
|
||||||
|
mv %{buildroot}%{_includedir}/libfreenect.hpp %{buildroot}%{_includedir}/libfreenect/libfreenect.hpp
|
||||||
|
# These binaries have very vague names. Renaming them to freenect-* to clarify
|
||||||
|
for f in %{buildroot}%{_bindir}/*; do
|
||||||
|
mv $f %{buildroot}%{_bindir}/freenect-$(basename $f)
|
||||||
|
done
|
||||||
|
mv %{buildroot}%{_bindir}/freenect-fakenect %{buildroot}%{_bindir}/fakenect
|
||||||
|
|
||||||
|
mkdir -p %{buildroot}%{_datadir}/%{name}
|
||||||
|
mv %{buildroot}%{_datadir}/fwfetcher.py %{buildroot}%{_datadir}/%{name}
|
||||||
|
# Get rid of the hashbang in the fwfetcher song
|
||||||
|
sed -i "s|#!/usr/bin/env python||" %{buildroot}%{_datadir}/%{name}/fwfetcher.py
|
||||||
|
|
||||||
|
%post -p /sbin/ldconfig
|
||||||
|
|
||||||
|
%postun -p /sbin/ldconfig
|
||||||
|
|
||||||
|
%post opencv -p /sbin/ldconfig
|
||||||
|
|
||||||
|
%postun opencv -p /sbin/ldconfig
|
||||||
|
|
||||||
|
%files
|
||||||
|
%doc APACHE20 GPL2 README.asciidoc CONTRIB
|
||||||
|
/lib/udev/rules.d/*
|
||||||
|
%{_libdir}/libfreenect.so.*
|
||||||
|
%{_libdir}/libfreenect_sync.so.*
|
||||||
|
%exclude %{_bindir}/freenect-cvdemo
|
||||||
|
%exclude %{_bindir}/fakenect
|
||||||
|
%{_bindir}/freenect-*
|
||||||
|
%{_datadir}/%{name}
|
||||||
|
|
||||||
|
%files opencv
|
||||||
|
%{_bindir}/freenect-cvdemo
|
||||||
|
%{_libdir}/libfreenect_cv.so.*
|
||||||
|
|
||||||
|
%files devel
|
||||||
|
%doc doc/html
|
||||||
|
%doc examples/*.c wrappers/cpp/cppview.cpp
|
||||||
|
%{_includedir}/libfreenect
|
||||||
|
%{_libdir}/*.so
|
||||||
|
%{_libdir}/pkgconfig/*
|
||||||
|
%{_libdir}/fakenect/*.so
|
||||||
|
|
||||||
|
%files static
|
||||||
|
%{_libdir}/*.a
|
||||||
|
|
||||||
|
%files python
|
||||||
|
%{python_sitearch}/*.so
|
||||||
|
|
||||||
|
%files fakenect
|
||||||
|
%dir %{_libdir}/fakenect
|
||||||
|
%{_libdir}/fakenect/*.so.*
|
||||||
|
%{_bindir}/fakenect
|
||||||
|
|
||||||
|
%changelog
|
||||||
|
* Wed Jan 09 2013 Dan Horák <dan[at]danny.cz> - 0.1.2-4
|
||||||
|
- fixes for secondary arches
|
||||||
|
|
||||||
|
* Sat Nov 10 2012 Rich Mattes <richmattes@gmail.com> - 0.1.2-3
|
||||||
|
- Rebuild for new OpenCV
|
||||||
|
|
||||||
|
* Wed Aug 15 2012 Rich Mattes <richmattes@gmail.com> - 0.1.2-2
|
||||||
|
- Filtered private python lib provides
|
||||||
|
- Clarified that freenect_generate_tarball.sh works with a git tag
|
||||||
|
|
||||||
|
* Thu Apr 26 2012 Rich Mattes <richmattes@gmail.com> - 0.1.2-1
|
||||||
|
- Update to git tag 0.1.2
|
||||||
|
- Create OpenCV wrapper sub-package
|
||||||
|
- Create fakenect library sub-package
|
||||||
|
|
||||||
|
* Tue Mar 24 2011 Rich Mattes <richmattes@gmail.com> - 0-0.3.4a159fgit
|
||||||
|
- Force cmake to honor rpm optflags
|
||||||
|
- Change to out-of-tree build
|
||||||
|
|
||||||
|
* Tue Mar 24 2011 Rich Mattes <richmattes@gmail.com> - 0-0.2.4a159fgit
|
||||||
|
- Update to latest snapshot
|
||||||
|
|
||||||
|
* Mon Jan 31 2011 Rich Mattes <richmattes@gmail.com> - 0-0.1.687b2da5git
|
||||||
|
- Initial package
|
||||||
|
|
||||||
1
sources
1
sources
|
|
@ -0,0 +1 @@
|
||||||
|
b8f40bf839d50fb6937b76bd4fa1eecc libfreenect-v0.1.2.tar.bz2
|
||||||
Loading…
Add table
Add a link
Reference in a new issue