Skip to content
This repository has been archived by the owner on Jan 16, 2025. It is now read-only.

Problem enabling Python bindings for libimobiledevice #20033

Closed
aried3r opened this issue May 23, 2013 · 3 comments
Closed

Problem enabling Python bindings for libimobiledevice #20033

aried3r opened this issue May 23, 2013 · 3 comments
Labels

Comments

@aried3r
Copy link
Contributor

aried3r commented May 23, 2013

I was trying to enable the cython python bindings for libimobiledevice, now that libplist is able to build with them.

Here's my current progress. As you can see, I had to add a patch so that the python bindings would compile as well as add env: userpaths to have the cython binary found.

It now compiles just fine, but when I try to import the library, I get the following error:

Python 2.7.5 (default, May 20 2013, 22:29:41)
[GCC 4.2.1 Compatible Apple LLVM 4.2 (clang-425.0.28)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import imobiledevice
Fatal Python error: PyThreadState_Get: no current thread
[1]    95803 abort (core dumped)  python

This is, if I recall correctly, the same error I had when compiling libplist with python bindings. I fixed it by using the workaround for CMake that opencv also uses. However, this project does not use CMake and I do not see any output while compiling that brewed and system python might both be involved in the process (which caused the problems with libplist).

Here the ouput of the compilation. Split into two "files", one being the output for libimobiledevice, the other for libplist.

@mistydemeo suggested I ping @samueljohn.

@samueljohn
Copy link
Contributor

Hi, @aried3r. The Error Fatal Python error: PyThreadState_Get: no current thread is because during build system python was obviously picked up and during execution you are using brewed python. Both cannot be mixed unfortunately.

To have the PATHs during build as the user has set it up, you may want to try env :std in the formula.

Either you wait until I finished #18588 or you have to find out how libimobiledevice finds python and its libs/includes. In that pull request, we aim to greatly simplify building python extensions by mostly only adding a depends_on :python and then - if needed - using the convenience methods python.libdir etc. to teach the build systems of the correct python to use.

@samueljohn
Copy link
Contributor

I left some comments in your fork.
I don't have the time right now to check the output of your build right now. I put every free minute in #18588 (and found two python bugs in the process already).

@samueljohn
Copy link
Contributor

#18588 has been released. To enable python support, just add depends_on :python to your formula instead of env :userpaths. I updated/added some comments on your repo. Please open a PR if ready. Ask me for further questions/support if you need.

@ghost ghost assigned samueljohn Jun 11, 2013
@Homebrew Homebrew locked and limited conversation to collaborators Feb 16, 2016
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants