Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add MinGW hidapi library name #22

Merged
merged 1 commit into from
Apr 19, 2019
Merged

Add MinGW hidapi library name #22

merged 1 commit into from
Apr 19, 2019

Conversation

EchterAgo
Copy link
Contributor

This adds the correct library name to make it work on MinGW.

@apmorton
Copy link
Owner

Is this for native python loading a hidapi dll built with mingw?

That doesn't sound like a great idea, especially considering the signal11 hidapi specifically supports being built with msvc on windows.

Maybe there is some other motivating case here I am missing?

@EchterAgo
Copy link
Contributor Author

No, it is for MinGW python loading a MinGW hidapi dll. pip install hid in MSYS2 results in an install that is not working, even though mingw-w64-x86_64-hidapi is installed.

$ pip install hid
Collecting hid
  Downloading https://files.pythonhosted.org/packages/45/36/6c6f8403b0c892f9b8c4a6bb32970a817904b8eb48d932120f8f1c0e93b9/hid-1.0.0.tar.gz
Installing collected packages: hid
  Running setup.py install for hid ... done
Successfully installed hid-1.0.0

axel@AgoDesk MINGW64 ~
$ python
Python 3.7.2 (default, Dec 26 2018, 08:10:46)
[GCC 7.4.0] on msys
Type "help", "copyright", "credits" or "license" for more information.
>>> import hid
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3.7/site-packages/hid/__init__.py", line 29, in <module>
    raise ImportError(error)
ImportError: Unable to load any of the following libraries:libhidapi-hidraw.so libhidapi-hidraw.so.0 libhidapi-libusb.so libhidapi-libusb.so.0 libhidapi-iohidmanager.so libhidapi-iohidmanager.so.0 libhidapi.dylib hidapi.dll
>>>

axel@AgoDesk MINGW64 ~
$ pacman -Ql mingw-w64-x86_64-hidapi
mingw-w64-x86_64-hidapi /mingw64/
mingw-w64-x86_64-hidapi /mingw64/bin/
mingw-w64-x86_64-hidapi /mingw64/bin/libhidapi-0.dll
mingw-w64-x86_64-hidapi /mingw64/include/
mingw-w64-x86_64-hidapi /mingw64/include/hidapi/
mingw-w64-x86_64-hidapi /mingw64/include/hidapi/hidapi.h
mingw-w64-x86_64-hidapi /mingw64/lib/
mingw-w64-x86_64-hidapi /mingw64/lib/libhidapi.a
mingw-w64-x86_64-hidapi /mingw64/lib/libhidapi.dll.a
mingw-w64-x86_64-hidapi /mingw64/lib/pkgconfig/
mingw-w64-x86_64-hidapi /mingw64/lib/pkgconfig/hidapi.pc
mingw-w64-x86_64-hidapi /mingw64/share/
mingw-w64-x86_64-hidapi /mingw64/share/doc/
mingw-w64-x86_64-hidapi /mingw64/share/doc/hidapi/
mingw-w64-x86_64-hidapi /mingw64/share/doc/hidapi/AUTHORS.txt
mingw-w64-x86_64-hidapi /mingw64/share/doc/hidapi/LICENSE-bsd.txt
mingw-w64-x86_64-hidapi /mingw64/share/doc/hidapi/LICENSE-gpl3.txt
mingw-w64-x86_64-hidapi /mingw64/share/doc/hidapi/LICENSE-orig.txt
mingw-w64-x86_64-hidapi /mingw64/share/doc/hidapi/LICENSE.txt
mingw-w64-x86_64-hidapi /mingw64/share/doc/hidapi/README.txt

With this patch it is working.

@apmorton
Copy link
Owner

Thanks for the explanation - I will merge and push a release to pypi when I am at my desk next.

@apmorton apmorton merged commit cd9a84a into apmorton:master Apr 19, 2019
@EchterAgo EchterAgo deleted the mingw branch April 19, 2019 03:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants