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

Package request: libusb #655

Open
dive-gozo opened this issue Jun 3, 2024 · 2 comments
Open

Package request: libusb #655

dive-gozo opened this issue Jun 3, 2024 · 2 comments
Labels
help wanted Extra attention is needed package request a new rubygem to be added

Comments

@dive-gozo
Copy link
Contributor

What gem should be added
LIBUSB is a Ruby binding that gives Ruby programmers access to arbitrary USB devices.

I'd like to add a PR for this gem, but ran into problems when bitbaking the recipe (see here)
dive-gozo@6251273

The error message says

ERROR: failed to build gem native extension
extconf failed, exit code 1
in 'require': cannot load such file -- ffi (LoadError)
from extconf.rb:4:in '<main>'

libusb has build dependencies on rubygems-ffi-native and rubygems-mini-portile2-native.
The problem with rubygems-ffi-native is, that libusb's ext/extconf.rb requires 'ffi' in line 4, which is not in Ruby's $LOAD_PATH.

bitbake rubygems-ffi and bitbake rubygems-ffi-native are running successfully.

As a result ffi is available in poky/build/tmp/work/x86_64-linux/rubygems-libusb-native/0.7.1/recipe-sysroot-native/usr/lib/ruby/gems/3.3.0/gems/ffi-1.16.3/lib/ffi

Unfortunately, I didn't find a solution to tell Ruby where to find ffi, when compiling the extension for libusb.

Any help is very appreciated.

Link to gem on rubygems.org

https://rubygems.org/gems/libusb

@dive-gozo dive-gozo added the package request a new rubygem to be added label Jun 3, 2024
@priv-kweihmann priv-kweihmann added the help wanted Extra attention is needed label Jun 3, 2024
@priv-kweihmann
Copy link
Owner

See #309.
The problem is that the implementation does not provide the entire cross compiling toolchain.
It can for a single gem (incl. as many as possible cross compiled extensions) compile the target code, but
it cannot use the results to cross-link against those results in a gem extension that depends on that.

This would require a full cross-compiled ruby, which is still pretty annoying to patch in on every patch of the ruby runtime.

I haven't spend time on that, and likely won't any time soon, but I'm open to accept PRs (libusb being the perfect example).

For now I will but this ticket on hold

@dive-gozo
Copy link
Contributor Author

Thank you Konrad, for your very fast response and the link to the older issue.
Unfortunately, I'm not a Ruby expert and can't provide the needed patches to make libusb cross-compile.
If you like, you can close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed package request a new rubygem to be added
Projects
None yet
Development

No branches or pull requests

2 participants