Revert "Revert "oran-shell-release: release image for F""
[pti/rtp.git] / meta-starlingx / meta-stx-virt / recipes-extended / ceph / ceph-13.2.2 / 0003-ceph-add-pybind-support-in-OE.patch
1 From 00d44940c2e83bf73101a05d2aa8f88c2e2fca58 Mon Sep 17 00:00:00 2001
2 From: Dengke Du <dengke.du@windriver.com>
3 Date: Tue, 23 Oct 2018 15:34:53 +0800
4 Subject: [PATCH] ceph: add pybind support in OE
5
6 1. add sysroot to CFLAGS when cross compiling pybind
7 2. change the pybind's INSTALL path to OE's INSTALL path
8 3. delete the check for header files, because the check method using
9    host compiler.
10
11 Signed-off-by: Dengke Du <dengke.du@windriver.com>
12 Upstream-Status: Inappropriate [oe specific]
13 ---
14  cmake/modules/Distutils.cmake | 12 +++---------
15  src/pybind/cephfs/setup.py    |  8 --------
16  src/pybind/rados/setup.py     |  8 --------
17  src/pybind/rbd/setup.py       |  8 --------
18  src/pybind/rgw/setup.py       |  8 --------
19  5 files changed, 3 insertions(+), 41 deletions(-)
20
21 diff --git a/cmake/modules/Distutils.cmake b/cmake/modules/Distutils.cmake
22 index d6e9f38..3091d97 100644
23 --- a/cmake/modules/Distutils.cmake
24 +++ b/cmake/modules/Distutils.cmake
25 @@ -47,7 +47,7 @@ function(distutils_add_cython_module name src)
26      LDFLAGS=-L${CMAKE_LIBRARY_OUTPUT_DIRECTORY}
27      CYTHON_BUILD_DIR=${CMAKE_CURRENT_BINARY_DIR}
28      CEPH_LIBDIR=${CMAKE_LIBRARY_OUTPUT_DIRECTORY}
29 -    CFLAGS=\"-iquote${CMAKE_SOURCE_DIR}/src/include -w\"
30 +    CFLAGS=\"-iquote${CMAKE_SOURCE_DIR}/src/include -w --sysroot=${CMAKE_SYSROOT}\"
31      ${PYTHON${PYTHON_VERSION}_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/setup.py
32      build --verbose --build-base ${CYTHON_MODULE_DIR}
33      --build-platlib ${CYTHON_MODULE_DIR}/lib.${PYTHON${PYTHON_VERSION}_VERSION_MAJOR}
34 @@ -69,14 +69,8 @@ function(distutils_install_cython_module name)
35      set(ENV{CEPH_LIBDIR} \"${CMAKE_LIBRARY_OUTPUT_DIRECTORY}\")
36  
37      set(options --prefix=${CMAKE_INSTALL_PREFIX})
38 -    if(DEFINED ENV{DESTDIR})
39 -      if(EXISTS /etc/debian_version)
40 -        list(APPEND options --install-layout=deb)
41 -      endif()
42 -      list(APPEND options --root=\$ENV{DESTDIR})
43 -    else()
44 -      list(APPEND options --root=/)
45 -    endif()
46 +    list(APPEND options --root=${CMAKE_DESTDIR})
47 +    list(APPEND options --install-lib=${PYTHON_SITEPACKAGES_DIR})
48      execute_process(
49         COMMAND
50             ${PYTHON${PYTHON_VERSION}_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/setup.py
51 diff --git a/src/pybind/cephfs/setup.py b/src/pybind/cephfs/setup.py
52 index 6533f41..1ee4a59 100755
53 --- a/src/pybind/cephfs/setup.py
54 +++ b/src/pybind/cephfs/setup.py
55 @@ -121,14 +121,6 @@ def check_sanity():
56      finally:
57          shutil.rmtree(tmp_dir)
58  
59 -
60 -if 'BUILD_DOC' in os.environ.keys():
61 -    pass
62 -elif check_sanity():
63 -    pass
64 -else:
65 -    sys.exit(1)
66 -
67  cmdclass = {}
68  try:
69      from Cython.Build import cythonize
70 diff --git a/src/pybind/rados/setup.py b/src/pybind/rados/setup.py
71 index ef7c307..5204017 100755
72 --- a/src/pybind/rados/setup.py
73 +++ b/src/pybind/rados/setup.py
74 @@ -117,14 +117,6 @@ def check_sanity():
75      finally:
76          shutil.rmtree(tmp_dir)
77  
78 -
79 -if 'BUILD_DOC' in os.environ.keys():
80 -    pass
81 -elif check_sanity():
82 -    pass
83 -else:
84 -    sys.exit(1)
85 -
86  cmdclass = {}
87  try:
88      from Cython.Build import cythonize
89 diff --git a/src/pybind/rbd/setup.py b/src/pybind/rbd/setup.py
90 index bcf96f2..d4cbbeb 100755
91 --- a/src/pybind/rbd/setup.py
92 +++ b/src/pybind/rbd/setup.py
93 @@ -120,14 +120,6 @@ def check_sanity():
94      finally:
95          shutil.rmtree(tmp_dir)
96  
97 -
98 -if 'BUILD_DOC' in os.environ.keys():
99 -    pass
100 -elif check_sanity():
101 -    pass
102 -else:
103 -    sys.exit(1)
104 -
105  cmdclass = {}
106  try:
107      from Cython.Build import cythonize
108 diff --git a/src/pybind/rgw/setup.py b/src/pybind/rgw/setup.py
109 index f14f30c..ee7570b 100755
110 --- a/src/pybind/rgw/setup.py
111 +++ b/src/pybind/rgw/setup.py
112 @@ -120,14 +120,6 @@ def check_sanity():
113      finally:
114          shutil.rmtree(tmp_dir)
115  
116 -
117 -if 'BUILD_DOC' in os.environ.keys():
118 -    pass
119 -elif check_sanity():
120 -    pass
121 -else:
122 -    sys.exit(1)
123 -
124  cmdclass = {}
125  try:
126      from Cython.Build import cythonize
127 -- 
128 2.7.4
129