mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2026-01-22 19:47:27 -08:00
Package-Manager: portage-2.3.0_rc1 Closes: https://github.com/gentoo/gentoo/pull/1603 Signed-off-by: Patrice Clement <monsieurp@gentoo.org>
34 lines
1.3 KiB
Diff
34 lines
1.3 KiB
Diff
diff -Naur python/setup.py python/setup.py
|
|
--- python/setup.py 2015-12-30 22:21:46.000000000 +0100
|
|
+++ python/setup.py 2016-04-18 00:51:49.490809789 +0200
|
|
@@ -190,15 +190,27 @@
|
|
extra_compile_args.append('-Werror')
|
|
sys.argv.remove(warnings_as_errors)
|
|
|
|
+ inclD = ['.', '../src']
|
|
+ libD = []
|
|
+ try:
|
|
+ subprocess.check_call(['pkg-config', '--exists', 'protobuf'])
|
|
+ inclD += subprocess.check_output(['pkg-config','--variable=includedir','protobuf']).split()
|
|
+ libD = subprocess.check_output(['pkg-config','--variable=libdir','protobuf']).split()
|
|
+ except OSError as osex:
|
|
+ if osex.errno == errno.ENOENT:
|
|
+ info('pkg-config not found')
|
|
+ else:
|
|
+ warn("Running pkg-config failed - %s." % osex)
|
|
+ libD = ['../src/.libs']
|
|
# C++ implementation extension
|
|
ext_module_list.extend([
|
|
Extension(
|
|
"google.protobuf.pyext._message",
|
|
glob.glob('google/protobuf/pyext/*.cc'),
|
|
- include_dirs=[".", "../src"],
|
|
+ include_dirs=inclD,
|
|
libraries=libraries,
|
|
extra_objects=extra_objects,
|
|
- library_dirs=['../src/.libs'],
|
|
+ library_dirs=libD,
|
|
extra_compile_args=extra_compile_args,
|
|
),
|
|
Extension(
|