or Create a profile
11 Mar, 2010 04:54 PM
I've been puzzling on how to do this correctly all morning. I am
packaging up a gem that can optionally use a shared library to
enhance the functionality. If that library exists the gem I compile
a small c file that has a ruby binding for that library, I can then
try to require that wrapper when I want to use the extra
functionality. If it doesn't exist a warning would be a bonus I
would just like it to keep installing without failing. How am I
supposed to do this? I have resorted to just commenting out the
extension line and changing platform in the gem spec for now but
that seems like a heavy handed approach when it isn't really a
platform specific issue.
extension_name = 'sasl'
if find_library("c", "main") and find_library("sasl2")
have_library("c", "main") have_library("sasl2")
puts "Package cyrus-sasl-devel not found, SASL support disabled"
It correctly notices that the library isn't there but then
considers it to have failed anyways and stops the install there.
Whats the best way to make this happen?
2 Posted by Eric Hodel on 11 Mar, 2010 09:12 PM
You need to generate a Makefile that does nothing in the else
case, and be sure to have a wrapper around the require of sasl.so
that rescues the LoadError.
John Barnette closed this discussion
on 17 Nov, 2010 07:22 AM.
Comments are currently closed for this discussion.
You can start a new one.
2 people watching.
No more actions from RubyGems.org or the discussion starter are required.
This discussion is private.
Only you and RubyGems.org support staff can see and reply to it.
This discussion is public. Everyone can see and reply to it.
Powered by Tender™.