From 6d2d08db00b39b81e531c9fa974fd00aa2ef1185 Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Fri, 2 Oct 2020 09:56:54 -0400 Subject: [PATCH] fix: conda-forge patch (#2540) --- tools/setup_global.py.in | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/tools/setup_global.py.in b/tools/setup_global.py.in index 3325cd0ea..4cf040b2d 100644 --- a/tools/setup_global.py.in +++ b/tools/setup_global.py.in @@ -39,15 +39,25 @@ headers = main_headers + detail_headers cmdclass = {"install_headers": InstallHeadersNested} $extra_cmd +# This will _not_ affect installing from wheels, +# only building wheels or installing from SDist. +# Primarily intended on Windows, where this is sometimes +# customized (for example, conda-forge uses Library/) +base = os.environ.get("PYBIND11_GLOBAL_PREFIX", "") + +# Must have a separator +if base and not base.endswith("/"): + base += "/" + setup( name="pybind11_global", version="$version", packages=[], headers=headers, data_files=[ - ("share/cmake/pybind11", cmake_files), - ("include/pybind11", main_headers), - ("include/pybind11/detail", detail_headers), + (base + "share/cmake/pybind11", cmake_files), + (base + "include/pybind11", main_headers), + (base + "include/pybind11/detail", detail_headers), ], cmdclass=cmdclass, )