From f07d5069d86e31ecf195664850f79fb00c445bd3 Mon Sep 17 00:00:00 2001 From: Jason Lowe-Power Date: Fri, 17 Nov 2017 17:02:05 -0800 Subject: ext: Upgrade PyBind11 to version 2.2.1 This upgrade is necessary for pybind to build with GCC 7.2. We still need to add the patch for stl.h. MSC_FULL_VER change is no longer needed. See https://gem5-review.googlesource.com/c/public/gem5/+/2230 Change-Id: I806729217d022070583994c2dfcaa74476aef30f Signed-off-by: Jason Lowe-Power Reviewed-on: https://gem5-review.googlesource.com/5801 Reviewed-by: Andreas Sandberg Maintainer: Andreas Sandberg --- ext/pybind11/setup.py | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) (limited to 'ext/pybind11/setup.py') diff --git a/ext/pybind11/setup.py b/ext/pybind11/setup.py index 0cf4e47ce..b76120573 100644 --- a/ext/pybind11/setup.py +++ b/ext/pybind11/setup.py @@ -3,6 +3,7 @@ # Setup script for PyPI; use CMakeFile.txt to build extension modules from setuptools import setup +from distutils.command.install_headers import install_headers from pybind11 import __version__ import os @@ -12,16 +13,23 @@ if os.environ.get('PYBIND11_USE_CMAKE'): headers = [] else: headers = [ + 'include/pybind11/detail/class.h', + 'include/pybind11/detail/common.h', + 'include/pybind11/detail/descr.h', + 'include/pybind11/detail/init.h', + 'include/pybind11/detail/internals.h', + 'include/pybind11/detail/typeid.h', 'include/pybind11/attr.h', + 'include/pybind11/buffer_info.h', 'include/pybind11/cast.h', 'include/pybind11/chrono.h', - 'include/pybind11/class_support.h', 'include/pybind11/common.h', 'include/pybind11/complex.h', - 'include/pybind11/descr.h', 'include/pybind11/eigen.h', + 'include/pybind11/embed.h', 'include/pybind11/eval.h', 'include/pybind11/functional.h', + 'include/pybind11/iostream.h', 'include/pybind11/numpy.h', 'include/pybind11/operators.h', 'include/pybind11/options.h', @@ -29,9 +37,24 @@ else: 'include/pybind11/pytypes.h', 'include/pybind11/stl.h', 'include/pybind11/stl_bind.h', - 'include/pybind11/typeid.h' ] + +class InstallHeaders(install_headers): + """Use custom header installer because the default one flattens subdirectories""" + def run(self): + if not self.distribution.headers: + return + + for header in self.distribution.headers: + subdir = os.path.dirname(os.path.relpath(header, 'include/pybind11')) + install_dir = os.path.join(self.install_dir, subdir) + self.mkpath(install_dir) + + (out, _) = self.copy_file(header, install_dir) + self.outfiles.append(out) + + setup( name='pybind11', version=__version__, @@ -43,6 +66,7 @@ setup( packages=['pybind11'], license='BSD', headers=headers, + cmdclass=dict(install_headers=InstallHeaders), classifiers=[ 'Development Status :: 5 - Production/Stable', 'Intended Audience :: Developers', -- cgit v1.2.3