Skip to content
This repository was archived by the owner on Aug 5, 2025. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions lib/zbar/lib.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ module ZBar
extend FFI::Library

search_string = '/{opt,usr}/{,local/}lib{,64}/{,x86_64-linux-gnu/,i386-linux-gnu/}libzbar.{dylib,so*}'
paths =
Array(
ENV['ZBAR_LIB'] ||
Dir[search_string]
)
paths = Dir[search_string]

if paths.empty?
paths = [ENV['ZBAR_LIB'] || 'zbar']
end

begin
ffi_lib(*paths)
rescue LoadError => le
Expand Down