aboutsummaryrefslogtreecommitdiff
path: root/nixpkgs/pkgs/development/python-modules/pybind11/0001-Find-include-directory.patch
blob: d5b669dab7a91b675b3e517b1f2fd5e018b8cce7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
From a027e2590d5d2d384d23568a8d47b7095054b6b7 Mon Sep 17 00:00:00 2001
From: Frederik Rietdijk <fridh@fridh.nl>
Date: Thu, 19 Dec 2019 19:51:07 +0100
Subject: [PATCH] Find include directory

---
 pybind11/__init__.py | 33 +--------------------------------
 1 file changed, 1 insertion(+), 32 deletions(-)

diff --git a/pybind11/__init__.py b/pybind11/__init__.py
index c625e8c..c8a707b 100644
--- a/pybind11/__init__.py
+++ b/pybind11/__init__.py
@@ -2,35 +2,4 @@ from ._version import version_info, __version__  # noqa: F401 imported but unuse
 
 
 def get_include(user=False):
-    from distutils.dist import Distribution
-    import os
-    import sys
-
-    # Are we running in a virtual environment?
-    virtualenv = hasattr(sys, 'real_prefix') or \
-        sys.prefix != getattr(sys, "base_prefix", sys.prefix)
-
-    # Are we running in a conda environment?
-    conda = os.path.exists(os.path.join(sys.prefix, 'conda-meta'))
-
-    if virtualenv:
-        return os.path.join(sys.prefix, 'include', 'site',
-                            'python' + sys.version[:3])
-    elif conda:
-        if os.name == 'nt':
-            return os.path.join(sys.prefix, 'Library', 'include')
-        else:
-            return os.path.join(sys.prefix, 'include')
-    else:
-        dist = Distribution({'name': 'pybind11'})
-        dist.parse_config_files()
-
-        dist_cobj = dist.get_command_obj('install', create=True)
-
-        # Search for packages in user's home directory?
-        if user:
-            dist_cobj.user = user
-            dist_cobj.prefix = ""
-        dist_cobj.finalize_options()
-
-        return os.path.dirname(dist_cobj.install_headers)
+    return "@include@"
-- 
2.23.0