summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO68
-rw-r--r--.gitignore5
-rw-r--r--PKGBUILD151
-rw-r--r--add-libv4l2-module.patch37
-rw-r--r--fix-opencv-headers.patch13
5 files changed, 176 insertions, 98 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 97c9d1fb725b..8536a7bf660d 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,28 +1,56 @@
pkgbase = psmoveapi-git
- pkgdesc = Playstation Move Motion Controller API
- pkgver = 4.0.1.r14.g1eb4525
- pkgrel = 2
- url = http://thp.io/2010/psmove/
- arch = i686
+ pkgdesc = Playstation Move Motion Controller API (GIT version)
+ pkgver = 4.0.12.164.g3539912
+ pkgrel = 1
+ url = http://thp.io/2010/psmove
arch = x86_64
license = BSD
+ makedepends = git
makedepends = cmake
- depends = udev
- depends = bluez-libs
- depends = v4l-utils
- depends = opencv
- depends = jdk7-openjdk
- depends = python2
- depends = mono
- depends = swig
- depends = freeglut
- depends = libusb
- source = psmoveapi::git+https://github.com/thp/psmoveapi.git
- source = fix-opencv-headers.patch
+ makedepends = python-sphinx
+ makedepends = systemd-libs
+ makedepends = dbus
+ makedepends = bluez-libs
+ makedepends = v4l-utils
+ makedepends = opencv
+ makedepends = libusb
+ makedepends = libusb-compat
+ options = debug
+ source = git+https://github.com/thp/psmoveapi.git
+ source = git+https://github.com/thp/hidapi.git
+ source = git+https://github.com/inspirit/PS3EYEDriver.git
+ source = git+https://github.com/libusb/libusb.git
source = add-libv4l2-module.patch
- sha1sums = SKIP
- sha1sums = 4544da4ae2f0220350b9d59f05d1e6c8b5e71b36
- sha1sums = f81b484bced325b076ea550b47f2bb145f709a45
+ source = https://patch-diff.githubusercontent.com/raw/thp/psmoveapi/pull/488.diff
+ sha256sums = SKIP
+ sha256sums = SKIP
+ sha256sums = SKIP
+ sha256sums = SKIP
+ sha256sums = 271eaa3f1f5c50045873f1583ebc38eb6c9451440a7c98de5b75731058901480
+ sha256sums = 80133615f0b17e6f85cb2529823267c1ddd62b3ca9ca4c7ff2f5ee775999c177
pkgname = psmoveapi-git
+ depends = gcc-libs
+ depends = glibc
+ depends = systemd-libs
+ depends = libudev.so
+ depends = dbus
+ depends = bluez-libs
+ depends = libbluetooth.so
+ depends = libusb
+ depends = libusb-1.0.so
+ depends = libusb-compat
+ depends = v4l-utils
+ depends = opencv
+ provides = psmoveapi
+ provides = libpsmoveapi.so
+ provides = libpsmoveapi_tracker.so
+ conflicts = psmoveapi
+pkgname = python-psmoveapi-git
+ pkgdesc = Python bindings for Playstation Move Motion Controller API (GIT version)
+ arch = any
+ depends = psmoveapi-git=4.0.12.164.g3539912
+ depends = python
+ provides = python-psmoveapi
+ conflicts = python-psmoveapi
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000000000000..a97df690c92f
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,5 @@
+*
+!.gitignore
+!.SRCINFO
+!PKGBUILD
+!add-libv4l2-module.patch
diff --git a/PKGBUILD b/PKGBUILD
index e051c284d14c..3810a436d596 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,59 +1,128 @@
-# Maintainer: Arthur Zamarin <arthurzam@gmail.com>
-# Maintainer: Hermann Mayer <hermann.mayer92@gmail.com>
+# Maintainer: Gustavo Alvarez <sl1pkn07@gmail.com>
+# Contributor: Arthur Zamarin <arthurzam@gmail.com>
+# Contributor: Hermann Mayer <hermann.mayer92@gmail.com>
-_pkgname=psmoveapi
-pkgname=${_pkgname}-git
-pkgver=4.0.4.r7.ge64a766
+pkgbase=psmoveapi-git
+pkgname=(
+ 'psmoveapi-git'
+ 'python-psmoveapi-git'
+)
+pkgver=4.0.12.164.g3539912
pkgrel=1
-pkgdesc="Playstation Move Motion Controller API"
-arch=(i686 x86_64)
-url="http://thp.io/2010/psmove/"
+pkgdesc='Playstation Move Motion Controller API (GIT version)'
+arch=('x86_64')
+url='http://thp.io/2010/psmove'
license=('BSD')
-depends=('udev' 'bluez-libs' 'v4l-utils' 'opencv' 'jdk7-openjdk'
- 'python2' 'mono' 'swig' 'freeglut' 'libusb')
-makedepends=('cmake')
-source=("${_pkgname}::git+https://github.com/thp/psmoveapi.git"
- 'fix-opencv-headers.patch'
- 'add-libv4l2-module.patch')
-sha1sums=('SKIP'
- '383b842942af8f5911d23b4950fe4ef4addbaf67'
- 'f81b484bced325b076ea550b47f2bb145f709a45')
+makedepends=(
+ 'git'
+ 'cmake'
+ 'python-sphinx'
+ 'systemd-libs'
+ 'dbus'
+ 'bluez-libs'
+ 'v4l-utils'
+ 'opencv'
+ 'libusb'
+ 'libusb-compat'
+)
+source=(
+ 'git+https://github.com/thp/psmoveapi.git'
+ 'git+https://github.com/thp/hidapi.git'
+ 'git+https://github.com/inspirit/PS3EYEDriver.git'
+ 'git+https://github.com/libusb/libusb.git'
+ 'add-libv4l2-module.patch'
+ 'https://patch-diff.githubusercontent.com/raw/thp/psmoveapi/pull/488.diff'
+)
+sha256sums=(
+ 'SKIP'
+ 'SKIP'
+ 'SKIP'
+ 'SKIP'
+ '271eaa3f1f5c50045873f1583ebc38eb6c9451440a7c98de5b75731058901480'
+ '80133615f0b17e6f85cb2529823267c1ddd62b3ca9ca4c7ff2f5ee775999c177'
+)
+options=('debug')
pkgver() {
- cd "${srcdir}/${_pkgname}"
- git describe --long --tags | sed -r 's/([^-]*-g)/r\1/;s/-/./g'
+ cd psmoveapi
+ echo "$(git describe --long --tags | tr - . | tr -d v)"
}
prepare() {
- cd "${srcdir}/${_pkgname}"
- git submodule init
- git submodule update
-
- # Add the missing OpenCV includes
- patch -p1 -i "${srcdir}/fix-opencv-headers.patch"
+ cd psmoveapi
+ git config submodule.external/hidapi.url "${srcdir}/hidapi"
+ git config submodule.external/PS3EYEDriver.url "${srcdir}/PS3EYEDriver"
+ git config submodule.external/libusb-1.0.url "${srcdir}/libusb"
+ git -c protocol.file.allow=always submodule update --init \
+ external/hidapi \
+ external/PS3EYEDriver \
+ external/libusb-1.0
# Add the missing cmake libv4l2 linkage
patch -p1 -i "${srcdir}/add-libv4l2-module.patch"
- JAVA_HOME=/usr/lib/jvm/default cmake . \
- -DCMAKE_INSTALL_PREFIX:PATH=/usr \
- -DPSMOVEAPI_LIB_DEST=lib \
- -DPSMOVE_BUILD_EXAMPLES=OFF \
- -DPSMOVE_BUILD_OPENGL_EXAMPLES=OFF \
- -DPSMOVE_BUILD_TESTS=OFF
+ # install missing header
+ patch -p1 -i "${srcdir}/488.diff"
+
+ mkdir -p docs/_static
}
build() {
- cd "${srcdir}/${_pkgname}"
- make
+ cmake -B build -S psmoveapi \
+ -DCMAKE_BUILD_TYPE=Release \
+ -DCMAKE_INSTALL_PREFIX=/usr \
+ -DCMAKE_SKIP_RPATH=ON \
+ -DPSMOVEAPI_LIB_DEST=lib \
+ -DPSMOVE_BUILD_EXAMPLES=ON \
+ -DPSMOVE_BUILD_TRACKER=ON
+
+ cmake --build build
+}
+
+package_psmoveapi-git() {
+ provides=(
+ 'psmoveapi'
+ 'libpsmoveapi.so'
+ 'libpsmoveapi_tracker.so'
+ )
+ conflicts=('psmoveapi')
+ depends=(
+ 'gcc-libs' # libgcc_s.so libstdc++.so
+ 'glibc' # libc.so libm.so
+ 'systemd-libs' 'libudev.so'
+ 'dbus' # libdbus-1.so
+ 'bluez-libs' 'libbluetooth.so'
+ 'libusb' 'libusb-1.0.so'
+ 'libusb-compat' # libusb-0.1.so
+ 'v4l-utils' # libv4l2.so
+ 'opencv' # libopencv_calib3d.so libopencv_core.so libopencv_highgui.so libopencv_imgcodecs.so libopencv_imgproc.so libopencv_videoio.so
+ )
+
+ DESTDIR="${pkgdir}" cmake --install build
+
+ (cd psmoveapi/docs; make BUILDDIR="${pkgdir}/usr/share/doc/${pkgbase}" html)
+
+ mkdir -p "${pkgdir}/usr/share/"{doc,licenses}"/${pkgbase}"
+ mv "${pkgdir}/usr/share/psmoveapi/README.md" "${pkgdir}/usr/share/doc/${pkgbase}/README.md"
+ mv "${pkgdir}/usr/share/psmoveapi/COPYING" "${pkgdir}/usr/share/licenses/${pkgbase}/COPYING"
+ rm -fr "${pkgdir}/usr/share/psmoveapi"
}
-package() {
- cd "${srcdir}/${_pkgname}"
- make DESTDIR="$pkgdir" install
- install -m755 -d "${pkgdir}"/usr/lib/python3.6/site-packages/
- install -D -m644 _psmove.so "${pkgdir}"/usr/lib/python3.6/site-packages/
- install -D -m644 psmove.py "${pkgdir}"/usr/lib/python3.6/site-packages/
- install -D -m644 psmove_config.h "${pkgdir}"/usr/include/psmoveapi/
- install -D -m644 COPYING "${pkgdir}"/usr/share/licenses/${pkgname}/LICENSE
+package_python-psmoveapi-git() {
+ pkgdesc='Python bindings for Playstation Move Motion Controller API (GIT version)'
+ arch=('any')
+ provides=('python-psmoveapi')
+ conflicts=('python-psmoveapi')
+ depends=(
+ "psmoveapi-git=${pkgver}"
+ 'python'
+ )
+
+ _site_packages="$(python -c 'import sysconfig; print(sysconfig.get_paths()["purelib"])')"
+ install -Dm644 psmoveapi/bindings/python/psmoveapi.py "${pkgdir}${_site_packages}/psmoveapi.py"
+ python -m compileall -q -f -d "${_site_packages}" "${pkgdir}${_site_packages}/psmoveapi.py"
+ python -OO -m compileall -q -f -d "${_site_packages}" "${pkgdir}${_site_packages}/psmoveapi.py"
+
+ mkdir -p "${pkgdir}/usr/share/licenses/${pkgname}"
+ ln -s "/usr/share/licenses/${pkgbase}/COPYING" "${pkgdir}/usr/share/licenses/${pkgname}/COPYING"
}
diff --git a/add-libv4l2-module.patch b/add-libv4l2-module.patch
index 7112c704bfff..8b47a9bf7eaa 100644
--- a/add-libv4l2-module.patch
+++ b/add-libv4l2-module.patch
@@ -1,24 +1,13 @@
-diff --git a/examples/c/distance_calibration.c b/examples/c/distance_calibration.c
-index 14f8189..3c209c5 100644
---- a/examples/c/distance_calibration.c
-+++ b/examples/c/distance_calibration.c
-@@ -34,6 +34,7 @@
-
- #include "opencv2/core/core_c.h"
- #include "opencv2/highgui/highgui_c.h"
-+#include "opencv2/imgcodecs/imgcodecs_c.h"
-
- #include "psmove.h"
- #include "psmove_tracker.h"
-diff --git a/src/tracker/camera_control_private.h b/src/tracker/camera_control_private.h
-index a4842b1..86aa8b7 100644
---- a/src/tracker/camera_control_private.h
-+++ b/src/tracker/camera_control_private.h
-@@ -33,6 +33,7 @@
- #include "opencv2/core/core_c.h"
- #include "opencv2/highgui/highgui_c.h"
- #include "opencv2/imgproc/imgproc_c.h"
-+#include "opencv2/videoio/videoio_c.h"
-
- #if defined(WIN32)
- # include <windows.h>
+diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
+index 6e45cae..081c00a 100644
+--- a/src/CMakeLists.txt
++++ b/src/CMakeLists.txt
+@@ -91,5 +91,9 @@ list(APPEND PSMOVEAPI_REQUIRED_LIBS m)
+ include_directories(${UDEV_INCLUDE_DIRS})
+ list(APPEND PSMOVEAPI_REQUIRED_LIBS ${UDEV_LIBRARIES})
+
++ pkg_check_modules(V4L2 REQUIRED libv4l2)
++ include_directories(${V4L2_INCLUDE_DIRS})
++ list(APPEND PSMOVEAPI_REQUIRED_LIBS ${V4L2_LIBRARIES})
++
+ pkg_check_modules(BLUEZ REQUIRED bluez>=5)
diff --git a/fix-opencv-headers.patch b/fix-opencv-headers.patch
deleted file mode 100644
index 8b47a9bf7eaa..000000000000
--- a/fix-opencv-headers.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
-index 6e45cae..081c00a 100644
---- a/src/CMakeLists.txt
-+++ b/src/CMakeLists.txt
-@@ -91,5 +91,9 @@ list(APPEND PSMOVEAPI_REQUIRED_LIBS m)
- include_directories(${UDEV_INCLUDE_DIRS})
- list(APPEND PSMOVEAPI_REQUIRED_LIBS ${UDEV_LIBRARIES})
-
-+ pkg_check_modules(V4L2 REQUIRED libv4l2)
-+ include_directories(${V4L2_INCLUDE_DIRS})
-+ list(APPEND PSMOVEAPI_REQUIRED_LIBS ${V4L2_LIBRARIES})
-+
- pkg_check_modules(BLUEZ REQUIRED bluez>=5)