Skip to content

Commit 6d4fbd8

Browse files
committed
attempt to autodetect location using a few popular ones..
1 parent e666329 commit 6d4fbd8

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

setup.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,13 @@
3838

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

4249
if libarchivePrefix:
4350
includePath = libarchivePrefix + '/include'

0 commit comments

Comments
 (0)