Skip to content

Commit

Permalink
Merge pull request #6 from Changaco/custom-lib-path
Browse files Browse the repository at this point in the history
Try to get libarchive's path from the `LIBARCHIVE` envvar
  • Loading branch information
Changaco committed Apr 27, 2015
2 parents 2825034 + e575a72 commit 947aec0
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions libarchive/ffi.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@
CFUNCTYPE, POINTER,
)
import ctypes
import ctypes.util
from ctypes.util import find_library
import logging
import mmap
import os

from .exception import ArchiveError

Expand All @@ -21,8 +22,8 @@

page_size = mmap.PAGESIZE

_LIB_FILEPATH = ctypes.util.find_library('archive') or 'libarchive.so'
libarchive = ctypes.cdll.LoadLibrary(_LIB_FILEPATH)
libarchive_path = os.environ.get('LIBARCHIVE') or find_library('archive')
libarchive = ctypes.cdll.LoadLibrary(libarchive_path)


# Constants
Expand Down

0 comments on commit 947aec0

Please sign in to comment.