| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 18 | |
| 19 | |
| 20 |
|
| 21 | (define-module (gnu packages openkinect)
|
| 22 | #:use-module (guix gexp)
|
| 23 | #:use-module (guix packages)
|
| 24 | #:use-module (guix git-download)
|
| 25 | #:use-module (guix build-system cmake)
|
| 26 | #:use-module ((guix licenses) #:prefix license:)
|
| 27 | #:use-module (gnu packages pkg-config)
|
| 28 | #:use-module (gnu packages libusb)
|
| 29 | #:use-module (gnu packages python)
|
| 30 | #:use-module (gnu packages python-build)
|
| 31 | #:use-module (gnu packages python-xyz)
|
| 32 | #:use-module (gnu packages gl)
|
| 33 | #:use-module (gnu packages pkg-config)
|
| 34 | #:use-module (gnu packages image-processing))
|
| 35 |
|
| 36 | (define-public libfreenect
|
| 37 | (package
|
| 38 | (name "libfreenect")
|
| 39 | (version "0.7.5")
|
| 40 | (source
|
| 41 | (origin
|
| 42 | (method git-fetch)
|
| 43 | (uri (git-reference
|
| 44 | (url "https://github.com/OpenKinect/libfreenect")
|
| 45 | (commit (string-append "v" version))))
|
| 46 | (file-name (git-file-name name version))
|
| 47 | (sha256
|
| 48 | (base32 "0a4rgrqsl3jwdrpri3li2lrkag5s1zd40w9jxl59nhz5d8ald4iy"))))
|
| 49 | (build-system cmake-build-system)
|
| 50 | (arguments
|
| 51 | (list
|
| 52 | #:tests? #f |
| 53 | #:configure-flags
|
| 54 | #~(list "-DBUILD_FAKENECT=ON"
|
| 55 | "-DBUILD_CPP=ON"
|
| 56 | "-DBUILD_EXAMPLES=OFF" |
| 57 | "-DBUILD_CV=OFF" |
| 58 | "-DBUILD_PYTHON=OFF" |
| 59 | "-DBUILD_C_SYNC=ON")
|
| 60 | #:phases
|
| 61 | #~(modify-phases %standard-phases
|
| 62 | (add-after 'install 'install-udev-rules
|
| 63 | (lambda _
|
| 64 | (install-file "../source/platform/linux/udev/51-kinect.rules"
|
| 65 | (string-append #$output "/lib/udev/rules.d")))))))
|
| 66 | (native-inputs (list pkg-config))
|
| 67 | (inputs (list libusb))
|
| 68 | (synopsis "Drivers and libraries for the Xbox Kinect device")
|
| 69 | (description
|
| 70 | "libfreenect is a userspace driver for the Microsoft Kinect.
|
| 71 | It supports: RGB and Depth Images, Motors, Accelerometer, LED and Audio.")
|
| 72 | (home-page "https://github.com/OpenKinect/libfreenect")
|
| 73 | (license license:gpl2+)))
|
| 74 |
|
| 75 | |
| 76 | (define libfreenect-derived-phases
|
| 77 | #~(modify-phases %standard-phases
|
| 78 | (add-after 'unpack 'patch-CMakeLists.txt
|
| 79 | (lambda _
|
| 80 | (substitute* "CMakeLists.txt"
|
| 81 | ((".*libusb.*") "")
|
| 82 | (("add_subdirectory \\(src\\)") "")
|
| 83 | ((".*libfreenectConfig.cmake.*") ""))))))
|
| 84 |
|
| 85 | (define-public libfreenect-examples
|
| 86 | (package
|
| 87 | (inherit libfreenect)
|
| 88 | (name "libfreenect-examples")
|
| 89 | (arguments
|
| 90 | (list
|
| 91 | #:tests? #f |
| 92 | #:configure-flags
|
| 93 | #~(list "-DBUILD_EXAMPLES=ON"
|
| 94 | "-DBUILD_FAKENECT=OFF"
|
| 95 | "-DBUILD_CPP=OFF"
|
| 96 | "-DBUILD_C_SYNC=OFF"
|
| 97 | "-DBUILD_CV=OFF")
|
| 98 | #:phases libfreenect-derived-phases))
|
| 99 | (inputs (list libfreenect freeglut))
|
| 100 | (synopsis "Examples for libfreenect, the Xbox Kinect device library")))
|
| 101 |
|
| 102 | (define-public libfreenect-opencv
|
| 103 | (package
|
| 104 | (inherit libfreenect)
|
| 105 | (name "libfreenect-opencv")
|
| 106 | (inputs
|
| 107 | (list libfreenect opencv))
|
| 108 | (arguments
|
| 109 | (list
|
| 110 | #:tests? #f |
| 111 | #:configure-flags
|
| 112 | #~(list "-DBUILD_EXAMPLES=OFF"
|
| 113 | "-DBUILD_FAKENECT=OFF"
|
| 114 | "-DBUILD_CPP=OFF"
|
| 115 | "-DBUILD_C_SYNC=OFF"
|
| 116 | "-DBUILD_CV=ON")
|
| 117 | #:phases libfreenect-derived-phases))
|
| 118 | (synopsis "OpenCV wrapper for libfreenect, the Xbox Kinect device
|
| 119 | library")))
|
| 120 |
|
| 121 | (define-public python-libfreenect
|
| 122 | (package
|
| 123 | (inherit libfreenect)
|
| 124 | (name "python-libfreenect")
|
| 125 | (native-inputs
|
| 126 | (list python-cython python-setuptools))
|
| 127 | (inputs
|
| 128 | (list libfreenect))
|
| 129 | (propagated-inputs
|
| 130 | (list python python-numpy))
|
| 131 | (arguments
|
| 132 | (list
|
| 133 | #:tests? #f |
| 134 | #:configure-flags
|
| 135 | #~(list "-DBUILD_EXAMPLES=OFF"
|
| 136 | "-DBUILD_CPP=OFF"
|
| 137 | "-DBUILD_CV=OFF"
|
| 138 | "-DBUILD_C_SYNC=OFF"
|
| 139 | "-DBUILD_FAKENECT=OFF"
|
| 140 | "-DBUILD_PYTHON3=ON"
|
| 141 | |
| 142 | "-DCMAKE_C_FLAGS=-Wno-error=int-conversion")
|
| 143 | #:phases libfreenect-derived-phases))
|
| 144 | (synopsis "Python wrapper for libfreenect, the Xbox Kinect device
|
| 145 | library")))
|