koraktor / rbzip2

bzip2 for Ruby
BSD 3-Clause "New" or "Revised" License
40 stars 10 forks source link

Add ‘libbz2.so.1’ alternate library name for FFI #9

Closed rykov closed 6 years ago

rykov commented 6 years ago

I was investigating why FFI version was not activating in spite of having libbz2 (1.0.6-8) installed on Ubuntu. I found that only "libbz2.so.1" symlink is created, and not "libbz2.so" when this package is installed. The latter is only created by the "libbz2-dev" package.

Without "libbz2.so", calling ffi_lib 'bz2' fails.

This PR is to alternatively try to load "libbz2.so.1" to handle this case.

This technique is described here: https://github.com/ffi/ffi/wiki/Loading-Libraries#linux-packages

koraktor commented 6 years ago

Thanks! Sounds reasonable.

But would you please update your PR to not change the version?

rykov commented 6 years ago

@koraktor Sure thing. Updated now.