Added
Link Here
|
1 |
--- setup.py.orig 2022-09-18 11:39:45 UTC |
2 |
+++ setup.py |
3 |
@@ -127,29 +127,12 @@ def pkg_version(package: str) -> Tuple[int, int]: |
4 |
|
5 |
|
6 |
def libcrypto_flags() -> Tuple[List[str], List[str]]: |
7 |
- # Apple use their special snowflake TLS libraries and additionally |
8 |
- # have an ancient broken system OpenSSL, so we need to check for one |
9 |
- # installed by all the various macOS package managers. |
10 |
- extra_pc_dir = '' |
11 |
+ _prefix = sys.prefix |
12 |
|
13 |
- try: |
14 |
- cflags = pkg_config('libcrypto', '--cflags-only-I', fatal=False) |
15 |
- except subprocess.CalledProcessError: |
16 |
- if is_macos: |
17 |
- import ssl |
18 |
- v = ssl.OPENSSL_VERSION_INFO |
19 |
- pats = f'{v[0]}.{v[1]}', f'{v[0]}' |
20 |
- for pat in pats: |
21 |
- q = f'opt/openssl@{pat}/lib/pkgconfig' |
22 |
- openssl_dirs = glob.glob(f'/opt/homebrew/{q}') + glob.glob(f'/usr/local/{q}') |
23 |
- if openssl_dirs: |
24 |
- break |
25 |
- if not openssl_dirs: |
26 |
- raise SystemExit(f'Failed to find OpenSSL version {v[0]}.{v[1]} on your system') |
27 |
- extra_pc_dir = os.pathsep.join(openssl_dirs) |
28 |
- cflags = pkg_config('libcrypto', '--cflags-only-I', extra_pc_dir=extra_pc_dir) |
29 |
- return cflags, pkg_config('libcrypto', '--libs', extra_pc_dir=extra_pc_dir) |
30 |
+ cflags = [f"-I{_prefix}/include"] |
31 |
+ libs = [f"-L{_prefix}/lib", "-lcrypto"] |
32 |
|
33 |
+ return cflags, libs |
34 |
|
35 |
def at_least_version(package: str, major: int, minor: int = 0) -> None: |
36 |
q = f'{major}.{minor}' |