|
@@ -50,11 +50,11 @@ from setuptools import setup, find_packages, Extension
|
|
|
from setuptools.command.sdist import sdist
|
|
|
|
|
|
compress_source = 'src/borg/compress.pyx'
|
|
|
-crypto_source = 'src/borg/crypto.pyx'
|
|
|
-chunker_source = 'src/borg/chunker.pyx'
|
|
|
+crypto_ll_source = 'src/borg/crypto/low_level.pyx'
|
|
|
+chunker_source = 'src/borg/algorithms/chunker.pyx'
|
|
|
hashindex_source = 'src/borg/hashindex.pyx'
|
|
|
item_source = 'src/borg/item.pyx'
|
|
|
-crc32_source = 'src/borg/crc32.pyx'
|
|
|
+crc32_source = 'src/borg/algorithms/crc32.pyx'
|
|
|
platform_posix_source = 'src/borg/platform/posix.pyx'
|
|
|
platform_linux_source = 'src/borg/platform/linux.pyx'
|
|
|
platform_darwin_source = 'src/borg/platform/darwin.pyx'
|
|
@@ -62,7 +62,7 @@ platform_freebsd_source = 'src/borg/platform/freebsd.pyx'
|
|
|
|
|
|
cython_sources = [
|
|
|
compress_source,
|
|
|
- crypto_source,
|
|
|
+ crypto_ll_source,
|
|
|
chunker_source,
|
|
|
hashindex_source,
|
|
|
item_source,
|
|
@@ -87,12 +87,12 @@ try:
|
|
|
def make_distribution(self):
|
|
|
self.filelist.extend([
|
|
|
'src/borg/compress.c',
|
|
|
- 'src/borg/crypto.c',
|
|
|
- 'src/borg/chunker.c', 'src/borg/_chunker.c',
|
|
|
+ 'src/borg/crypto/low_level.c',
|
|
|
+ 'src/borg/algorithms/chunker.c', 'src/borg/algorithms/buzhash.c',
|
|
|
'src/borg/hashindex.c', 'src/borg/_hashindex.c',
|
|
|
'src/borg/item.c',
|
|
|
- 'src/borg/crc32.c',
|
|
|
- 'src/borg/_crc32/crc32.c', 'src/borg/_crc32/clmul.c', 'src/borg/_crc32/slice_by_8.c',
|
|
|
+ 'src/borg/algorithms/crc32.c',
|
|
|
+ 'src/borg/algorithms/crc32_dispatch.c', 'src/borg/algorithms/crc32_clmul.c', 'src/borg/algorithms/crc32_slice_by_8.c',
|
|
|
'src/borg/platform/posix.c',
|
|
|
'src/borg/platform/linux.c',
|
|
|
'src/borg/platform/freebsd.c',
|
|
@@ -106,7 +106,7 @@ except ImportError:
|
|
|
raise Exception('Cython is required to run sdist')
|
|
|
|
|
|
compress_source = compress_source.replace('.pyx', '.c')
|
|
|
- crypto_source = crypto_source.replace('.pyx', '.c')
|
|
|
+ crypto_ll_source = crypto_ll_source.replace('.pyx', '.c')
|
|
|
chunker_source = chunker_source.replace('.pyx', '.c')
|
|
|
hashindex_source = hashindex_source.replace('.pyx', '.c')
|
|
|
item_source = item_source.replace('.pyx', '.c')
|
|
@@ -117,7 +117,7 @@ except ImportError:
|
|
|
platform_darwin_source = platform_darwin_source.replace('.pyx', '.c')
|
|
|
from distutils.command.build_ext import build_ext
|
|
|
if not on_rtd and not all(os.path.exists(path) for path in [
|
|
|
- compress_source, crypto_source, chunker_source, hashindex_source, item_source, crc32_source,
|
|
|
+ compress_source, crypto_ll_source, chunker_source, hashindex_source, item_source, crc32_source,
|
|
|
platform_posix_source, platform_linux_source, platform_freebsd_source, platform_darwin_source]):
|
|
|
raise ImportError('The GIT version of Borg needs Cython. Install Cython or use a released version.')
|
|
|
|
|
@@ -578,11 +578,12 @@ ext_modules = []
|
|
|
if not on_rtd:
|
|
|
ext_modules += [
|
|
|
Extension('borg.compress', [compress_source], libraries=['lz4'], include_dirs=include_dirs, library_dirs=library_dirs, define_macros=define_macros),
|
|
|
- Extension('borg.crypto', [crypto_source], libraries=crypto_libraries, include_dirs=include_dirs, library_dirs=library_dirs, define_macros=define_macros),
|
|
|
- Extension('borg.chunker', [chunker_source]),
|
|
|
+ Extension('borg.crypto', [crypto_ll_source], libraries=crypto_libraries, include_dirs=include_dirs, library_dirs=library_dirs, define_macros=define_macros),
|
|
|
+ Extension('borg.crypto.low_level', [crypto_ll_source], libraries=crypto_libraries, include_dirs=include_dirs, library_dirs=library_dirs, define_macros=define_macros),
|
|
|
Extension('borg.hashindex', [hashindex_source]),
|
|
|
Extension('borg.item', [item_source]),
|
|
|
- Extension('borg.crc32', [crc32_source]),
|
|
|
+ Extension('borg.algorithms.chunker', [chunker_source]),
|
|
|
+ Extension('borg.algorithms.crc32', [crc32_source]),
|
|
|
]
|
|
|
if not sys.platform.startswith(('win32', )):
|
|
|
ext_modules.append(Extension('borg.platform.posix', [platform_posix_source]))
|