34 lines
1 KiB
Text
34 lines
1 KiB
Text
From https://github.com/stamparm/pcapy-ng/commit/84a15d2faefaae410198f5739d6ed3c69daa17ec
|
|
Don't monkeypatch internal function sysconfig._init_posix
|
|
Breaks with newer setuptools
|
|
|
|
Index: setup.py
|
|
--- setup.py.orig
|
|
+++ setup.py
|
|
@@ -44,26 +44,6 @@ if sys.platform == 'win32':
|
|
sources.append(os.path.join('win32', 'dllmain.cc'))
|
|
macros.append(('WIN32', '1'))
|
|
|
|
-# HACK replace linker gcc with g++
|
|
-from distutils import sysconfig
|
|
-save_init_posix = sysconfig._init_posix
|
|
-
|
|
-
|
|
-def my_init_posix():
|
|
- save_init_posix()
|
|
- g = sysconfig._config_vars
|
|
- compiler = g['LDSHARED'].split()[0]
|
|
- flags = g['LDSHARED'].split()[1:]
|
|
- if compiler == 'gcc':
|
|
- g['LDSHARED'] = ' '.join(['g++'] + flags)
|
|
- elif compiler == 'clang':
|
|
- g['LDSHARED'] = ' '.join(['clang++'] + flags)
|
|
- print('my_init_posix: changing LDSHARED =',
|
|
- repr(g['LDSHARED']))
|
|
- print('to', repr(g['LDSHARED']))
|
|
-sysconfig._init_posix = my_init_posix
|
|
-
|
|
-
|
|
def read(fname):
|
|
return open(os.path.join(os.path.dirname(__file__), fname)).read()
|
|
|