http://bugs.gentoo.org/414063 http://cgit.sukimashita.com/libimobiledevice.git/commit/?id=70dfe8ad1766990386f1db04bbe5a4826bcde4e5 http://cgit.sukimashita.com/libimobiledevice.git/commit/?id=84235e0834e57551028329723f4510e1dbe7bc11 http://cgit.sukimashita.com/libimobiledevice.git/commit/?id=849ea066426b8f5f6e6d1aea9804e095edca3b49 --- configure.ac +++ configure.ac @@ -83,10 +83,20 @@ CYTHON=false fi if [test "x$CYTHON" != "xfalse"]; then - CYTHON_SUB=cython + AC_MSG_CHECKING([for libplist Cython bindings]) CYTHON_PLIST_INCLUDE_DIR=$($PKG_CONFIG --variable=includedir libplist)/plist/cython - AC_SUBST([CYTHON_PLIST_INCLUDE_DIR]) - cython_python_bindings=yes + if [test ! -d "$CYTHON_PLIST_INCLUDE_DIR"]; then + CYTHON=false + CYTHON_SUB= + cython_python_bindings=no + AC_MSG_RESULT([no]) + AC_MSG_WARN([cannot find libplist Cython bindings. You should install your distribution specific libplist Cython bindings package.]) + else + AC_SUBST([CYTHON_PLIST_INCLUDE_DIR]) + AC_MSG_RESULT([$CYTHON_PLIST_INCLUDE_DIR]) + CYTHON_SUB=cython + cython_python_bindings=yes + fi else CYTHON_SUB= cython_python_bindings=no --- cython/afc.pxi +++ cython/afc.pxi @@ -162,7 +162,7 @@ err = afc_client_free(self._c_client) self.handle_error(err) - cdef inline BaseError _error(self, int16_t ret): + cdef BaseError _error(self, int16_t ret): return AfcError(ret) cpdef list get_device_info(self): --- cython/imobiledevice.pxd +++ cython/imobiledevice.pxd @@ -51,8 +51,8 @@ cdef class PropertyListService(BaseService): cpdef send(self, plist.Node node) cpdef object receive(self) - cdef inline int16_t _send(self, plist.plist_t node) - cdef inline int16_t _receive(self, plist.plist_t* c_node) + cdef int16_t _send(self, plist.plist_t node) + cdef int16_t _receive(self, plist.plist_t* c_node) cdef extern from "libimobiledevice/lockdown.h": cdef struct lockdownd_client_private: --- cython/imobiledevice.pyx +++ cython/imobiledevice.pyx @@ -25,9 +25,8 @@ return 0 cdef BaseError err = self._error(ret) raise err - return -1 - cdef inline BaseError _error(self, int16_t ret): pass + cdef BaseError _error(self, int16_t ret): pass cdef extern from "libimobiledevice/libimobiledevice.h": ctypedef enum idevice_error_t: @@ -211,10 +210,10 @@ plist.plist_free(c_node) raise - cdef inline int16_t _send(self, plist.plist_t node): + cdef int16_t _send(self, plist.plist_t node): raise NotImplementedError("send is not implemented") - cdef inline int16_t _receive(self, plist.plist_t* c_node): + cdef int16_t _receive(self, plist.plist_t* c_node): raise NotImplementedError("receive is not implemented") cdef class DeviceLinkService(PropertyListService): --- cython/mobilesync.pxi +++ cython/mobilesync.pxi @@ -149,10 +149,10 @@ plist.plist_free(remapping) raise - cdef inline int16_t _send(self, plist.plist_t node): + cdef int16_t _send(self, plist.plist_t node): return mobilesync_send(self._c_client, node) - cdef inline int16_t _receive(self, plist.plist_t* node): + cdef int16_t _receive(self, plist.plist_t* node): return mobilesync_receive(self._c_client, node) cdef inline BaseError _error(self, int16_t ret): --- m4/ac_pkg_cython.m4 +++ m4/ac_pkg_cython.m4 @@ -6,8 +6,11 @@ CYTHON=false elif test -n "$1" ; then AC_MSG_CHECKING([for Cython version]) - [cython_version=`$CYTHON --version 2>&1 | grep 'Cython version' | sed 's/.*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*/\1/g'`] + [cython_version=`$CYTHON --version 2>&1 | sed 's/Cython version \(.*\)$/\1/g'`] AC_MSG_RESULT([$cython_version]) + + # Setup extra version string for parsing + [cython_version_stripped=`echo $cython_version | sed 's/\([0-9]\+\)\.\([0-9]\+\)[^\.]*\(\.\([0-9]\+\)\)\?.*/0\1.0\2.0\4/g'`] if test -n "$cython_version" ; then # Calculate the required version number components [required=$1] @@ -25,8 +28,9 @@ if test -z "$required_patch" ; then [required_patch=0] fi + # Calculate the available version number components - [available=$cython_version] + [available=$cython_version_stripped] [available_major=`echo $available | sed 's/[^0-9].*//'`] if test -z "$available_major" ; then [available_major=0] @@ -41,6 +45,7 @@ if test -z "$available_patch" ; then [available_patch=0] fi + if test $available_major -gt $required_major || \ ( test $available_major -eq $required_major && \ test $available_minor -gt $required_minor ) || \