|
13 | 13 | import tarfile
|
14 | 14 | import zipfile
|
15 | 15 |
|
| 16 | +from distutils.dir_util import copy_tree |
16 | 17 | from distutils.util import get_platform
|
17 | 18 | from setuptools import setup
|
18 | 19 | from setuptools.command.install import install as install_
|
@@ -93,6 +94,11 @@ def get_libname():
|
93 | 94 | libname = "parasail.dll"
|
94 | 95 | return libname
|
95 | 96 |
|
| 97 | +def get_includes(): |
| 98 | + return ["include/*.h", |
| 99 | + "include/parasail/*.h", |
| 100 | + "include/parasail/matrices/*.h"] |
| 101 | + |
96 | 102 | def unzip(archive, destdir):
|
97 | 103 | thefile=zipfile.ZipFile(archive)
|
98 | 104 | thefile.extractall(destdir)
|
@@ -364,6 +370,16 @@ def build_parasail(libname):
|
364 | 370 | print("copying {} to {}".format(src,dst))
|
365 | 371 | shutil.copy(src,dst)
|
366 | 372 |
|
| 373 | + # copy headers into the parasail directory, so they can be added to the wheel |
| 374 | + parasail_headers = os.path.join(parasail_root, "parasail") |
| 375 | + dst = os.path.join("parasail", "include", "parasail") |
| 376 | + print("copying {} to {}".format(parasail_headers, dst)) |
| 377 | + copy_tree(parasail_headers, dst) |
| 378 | + parasail_h = os.path.join(parasail_root, "parasail.h") |
| 379 | + dst = os.path.join("parasail", "include") |
| 380 | + print("copying {} to {}".format(parasail_h, dst)) |
| 381 | + shutil.copy(parasail_h, dst) |
| 382 | + |
367 | 383 | def github_api_json(address):
|
368 | 384 | import json
|
369 | 385 | import sys
|
@@ -431,6 +447,12 @@ def download_windows_dll():
|
431 | 447 | print("copying {} to {}".format(src,dst))
|
432 | 448 | shutil.copy(src,dst)
|
433 | 449 |
|
| 450 | + # copy headers into the parasail directory, so they can be added to the wheel |
| 451 | + headers_src = os.path.join(root, "..", "include") |
| 452 | + dst = os.path.join("parasail", "include") |
| 453 | + print("copying {} to {}".format(headers_src, dst)) |
| 454 | + copy_tree(headers_src, dst) |
| 455 | + |
434 | 456 | def prepare_shared_lib():
|
435 | 457 | libname = get_libname()
|
436 | 458 | libpath = os.path.join("parasail", libname)
|
@@ -488,7 +510,7 @@ def finalize_options(self):
|
488 | 510 | maintainer_email=find_meta("email"),
|
489 | 511 | keywords=KEYWORDS,
|
490 | 512 | packages=PACKAGES,
|
491 |
| - package_data={"parasail": [get_libname()]}, |
| 513 | + package_data={"parasail": [get_libname()] + get_includes()}, |
492 | 514 | cmdclass=cmdclass,
|
493 | 515 | zip_safe=False,
|
494 | 516 | classifiers=CLASSIFIERS,
|
|
0 commit comments