setup_checksums.py 657 B

1234567891011121314151617
  1. # Support code for building a C extension with checksums code
  2. import os
  3. def xxhash_ext_kwargs(pc, system_prefix):
  4. if system_prefix:
  5. print('Detected and preferring libxxhash [via BORG_LIBXXHASH_PREFIX]')
  6. return dict(include_dirs=[os.path.join(system_prefix, 'include')],
  7. library_dirs=[os.path.join(system_prefix, 'lib')],
  8. libraries=['xxhash'])
  9. if pc and pc.installed('libxxhash', '>= 0.7.3'):
  10. print('Detected and preferring libxxhash [via pkg-config]')
  11. return pc.parse('libxxhash')
  12. raise Exception('Could not find xxhash lib/headers, please set BORG_LIBXXHASH_PREFIX')