Browse Source

attempt to autodetect location using a few popular ones..

master
John-Mark Gurney 2 years ago
parent
commit
6d4fbd86fc
1 changed files with 7 additions and 0 deletions
  1. +7
    -0
      setup.py

+ 7
- 0
setup.py View File

@@ -38,6 +38,13 @@ except ImportError:

# Use a provided libarchive else default to hard-coded path.
libarchivePrefix = environ.get('LIBARCHIVE_PREFIX')
if libarchivePrefix is None:
import pathlib
for i in [ '/usr', '/usr/local', '/opt/local' ]:
libdir = pathlib.Path(i) / 'lib'
if list(libdir.glob('libarchive.*')):
libarchivePrefix = i
break

if libarchivePrefix:
includePath = libarchivePrefix + '/include'


Loading…
Cancel
Save