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

Fixed library finding for other platforms/package managers. #32

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
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
9 changes: 5 additions & 4 deletions libarchive/library.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

_LOGGER = logging.getLogger(__name__)

_LIBRARY_NAME = 'libarchive'
_LIBRARY_NAME = ['libarchive', 'archive']
ajsyp marked this conversation as resolved.
Show resolved Hide resolved
_LIBRARY_FILENAME = 'libarchive.so'

def find_and_load_library():
Expand All @@ -29,9 +29,10 @@ def find_and_load_library():
# Search for our library using whatever search-path ctypes uses (not the same
# as `LD_LIBRARY_PATH`).

filepath = ctypes.util.find_library(_LIBRARY_NAME)
if filepath is not None:
search_filepaths.append(filepath)
for library_name in _LIBRARY_NAME:
filepath = ctypes.util.find_library(library_name)
if filepath is not None:
search_filepaths.append(filepath)

# Load the first one available.

Expand Down