From b523eada0ec5af76d8770af8005de338f8b8000b Mon Sep 17 00:00:00 2001 From: Cameron Nemo Date: Tue, 31 Dec 2019 16:03:55 -0800 Subject: [PATCH] libimobiledevice: port to python3 --- .../libimobiledevice/patches/python3.patch | 30 +++++++++++++++++++ srcpkgs/libimobiledevice/template | 12 ++++---- 2 files changed, 35 insertions(+), 7 deletions(-) create mode 100644 srcpkgs/libimobiledevice/patches/python3.patch diff --git a/srcpkgs/libimobiledevice/patches/python3.patch b/srcpkgs/libimobiledevice/patches/python3.patch new file mode 100644 index 00000000000000..dbe0d1281f1b2b --- /dev/null +++ b/srcpkgs/libimobiledevice/patches/python3.patch @@ -0,0 +1,30 @@ +From 6198152e8708a36782d48bc9d3a5835b19be3330 Mon Sep 17 00:00:00 2001 +From: Andrew Udvare +Date: Tue, 22 May 2018 17:02:38 -0400 +Subject: [PATCH] Fix for Python 3 + +--- + cython/debugserver.pxi | 7 +++---- + 1 file changed, 3 insertions(+), 4 deletions(-) + +diff --git cython/debugserver.pxi cython/debugserver.pxi +index ddbe0667..42430113 100644 +--- cython/debugserver.pxi ++++ cython/debugserver.pxi +@@ -43,14 +43,13 @@ cdef class DebugServerError(BaseError): + BaseError.__init__(self, *args, **kwargs) + + +-# from http://stackoverflow.com/a/17511714 +-from cpython.string cimport PyString_AsString ++from cpython.bytes cimport PyBytes_AS_STRING + cdef char ** to_cstring_array(list_str): + if not list_str: + return NULL + cdef char **ret = malloc(len(list_str) * sizeof(char *)) + for i in xrange(len(list_str)): +- ret[i] = PyString_AsString(list_str[i]) ++ ret[i] = PyBytes_AS_STRING(list_str[i]) + return ret + + diff --git a/srcpkgs/libimobiledevice/template b/srcpkgs/libimobiledevice/template index 2737579f278c3f..e671cf4768943c 100644 --- a/srcpkgs/libimobiledevice/template +++ b/srcpkgs/libimobiledevice/template @@ -1,10 +1,10 @@ # Template file for 'libimobiledevice' pkgname=libimobiledevice version=1.2.0 -revision=14 +revision=15 build_style=gnu-configure -hostmakedepends="automake libtool pkgconf python-Cython" -makedepends="python-devel libglib-devel libressl-devel libusb-devel +hostmakedepends="automake libtool pkgconf python3-Cython" +makedepends="python3-devel libglib-devel libressl-devel libusb-devel libplist-devel libusbmuxd-devel" short_desc="Library to communicate with Apple devices" maintainer="Orphaned " @@ -13,8 +13,6 @@ homepage="https://github.com/libimobiledevice/libimobiledevice" distfiles="https://github.com/libimobiledevice/libimobiledevice/archive/${version}.tar.gz" checksum=8ba1ea817691b3548b83371f8ec22d73d1e37f8fda7c899ac9c7121d924ca830 -CFLAGS="-I/usr/include/python3.6" - if [ "$CROSS_BUILD" ]; then configure_args="ac_cv_sys_file_offset_bits=yes ac_cv_sys_large_file=yes" fi @@ -22,8 +20,8 @@ fi pre_configure() { sed -i 's,SSLv3_,SSLv23_,g' src/idevice.c sed -i 's,-L$(libdir),,g' cython/Makefile.am - export PYTHON_CPPFLAGS="-I${XBPS_CROSS_BASE}/usr/include/python2.7" - export PYTHON_LDFLAGS="-L${XBPS_CROSS_BASE}/usr/lib -lpython2.7" + export PYTHON_CPPFLAGS="-I${XBPS_CROSS_BASE}/usr/include/python${py3_ver}" + export PYTHON_LDFLAGS="-L${XBPS_CROSS_BASE}/usr/lib -lpython${py3_ver}" autoreconf -fi }