summaryrefslogtreecommitdiffstats
path: root/recipes-extended/ceph/ceph/0001-ceph-fix-build-errors-for-cross-compile.patch
blob: 9686becbb1e906a83ef50f5f33c1632e71405953 (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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
From 4712fe18405ffea31405308357a8e7fca358bcce Mon Sep 17 00:00:00 2001
From: Dengke Du <dengke.du@windriver.com>
Date: Mon, 11 Mar 2019 09:14:09 +0800
Subject: [PATCH] ceph: fix build errors for cross compile

1. set the cross compile sysroot to find the rocksdb library
2. correct the install path for library in Distutils.cmake

Upstream-Status: Inappropriate [oe specific]

Signed-off-by: Dengke Du <dengke.du@windriver.com>

Adjust context for v14.2.3

Signed-off-by: He Zhe <zhe.he@windriver.com>
Signed-off-by: Sakib Sajal <sakib.sajal@windriver.com>
---
 cmake/modules/Distutils.cmake      | 25 +++++--------------------
 cmake/modules/FindRocksDB.cmake    |  4 ++--
 src/compressor/zstd/CMakeLists.txt |  2 +-
 src/pybind/cephfs/setup.py         |  8 --------
 src/pybind/rados/setup.py          |  8 --------
 src/pybind/rbd/setup.py            |  8 --------
 src/pybind/rgw/setup.py            |  8 --------
 7 files changed, 8 insertions(+), 55 deletions(-)

Index: ceph-18.2.0/cmake/modules/Distutils.cmake
===================================================================
--- ceph-18.2.0.orig/cmake/modules/Distutils.cmake
+++ ceph-18.2.0/cmake/modules/Distutils.cmake
@@ -29,17 +29,10 @@
   cmake_parse_arguments(DU "" "INSTALL_SCRIPT" "" ${ARGN})
   install(CODE "
     set(options --prefix=${CMAKE_INSTALL_PREFIX})
-    if(DEFINED ENV{DESTDIR})
-      if(EXISTS /etc/debian_version)
-        list(APPEND options --install-layout=deb)
-      endif()
-      list(APPEND options
-        --root=\$ENV{DESTDIR}
-        --single-version-externally-managed)
-    endif()
     if(NOT \"${DU_INSTALL_SCRIPT}\" STREQUAL \"\")
       list(APPEND options --install-script=${DU_INSTALL_SCRIPT})
-    endif()
+    list(APPEND options --root=${CMAKE_DESTDIR})
+    list(APPEND options --install-lib=${PYTHON_SITEPACKAGES_DIR})
     execute_process(
     COMMAND ${Python3_EXECUTABLE}
         setup.py install \${options}
@@ -65,7 +58,7 @@
   if(DU_DISABLE_VTA AND HAS_VTA)
     list(APPEND PY_CFLAGS -fno-var-tracking-assignments)
   endif()
-  list(APPEND PY_CPPFLAGS -iquote${CMAKE_SOURCE_DIR}/src/include -w)
+  list(APPEND PY_CPPFLAGS -iquote${CMAKE_SOURCE_DIR}/src/include -w --sysroot=${CMAKE_SYSROOT})
   # This little bit of magic wipes out __Pyx_check_single_interpreter()
   # Note: this is reproduced in distutils_install_cython_module
   list(APPEND PY_CPPFLAGS -D'void0=dead_function\(void\)')
@@ -135,14 +128,8 @@
     set(ENV{CEPH_LIBDIR} \"${CMAKE_LIBRARY_OUTPUT_DIRECTORY}\")
 
     set(options --prefix=${CMAKE_INSTALL_PREFIX})
-    if(DEFINED ENV{DESTDIR})
-      if(EXISTS /etc/debian_version)
-        list(APPEND options --install-layout=deb)
-      endif()
-      list(APPEND options --root=\$ENV{DESTDIR})
-    else()
-      list(APPEND options --root=/)
-    endif()
+    list(APPEND options --root=${CMAKE_DESTDIR})
+    list(APPEND options --install-lib=${PYTHON_SITEPACKAGES_DIR})
     execute_process(
        COMMAND
            ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/setup.py
Index: ceph-18.2.0/cmake/modules/FindRocksDB.cmake
===================================================================
--- ceph-18.2.0.orig/cmake/modules/FindRocksDB.cmake
+++ ceph-18.2.0/cmake/modules/FindRocksDB.cmake
@@ -9,9 +9,9 @@
 #  ROCKSDB_VERSION_MINOR
 #  ROCKSDB_VERSION_PATCH
 
-find_path(ROCKSDB_INCLUDE_DIR rocksdb/db.h)
+find_path(ROCKSDB_INCLUDE_DIR rocksdb/db.h ${CMAKE_SYSROOT})
 
-find_library(ROCKSDB_LIBRARIES rocksdb)
+find_library(ROCKSDB_LIBRARIES rocksdb ${CMAKE_SYSROOT})
 
 if(ROCKSDB_INCLUDE_DIR AND EXISTS "${ROCKSDB_INCLUDE_DIR}/rocksdb/version.h")
   foreach(ver "MAJOR" "MINOR" "PATCH")
Index: ceph-18.2.0/src/pybind/cephfs/setup.py
===================================================================
--- ceph-18.2.0.orig/src/pybind/cephfs/setup.py
+++ ceph-18.2.0/src/pybind/cephfs/setup.py
@@ -135,20 +135,6 @@
     finally:
         shutil.rmtree(tmp_dir)
 
-
-if 'BUILD_DOC' in os.environ or 'READTHEDOCS' in os.environ:
-    ext_args = {}
-    cython_constants = dict(BUILD_DOC=True)
-    cythonize_args = dict(compile_time_env=cython_constants)
-elif check_sanity():
-    ext_args = get_python_flags(['cephfs'])
-    cython_constants = dict(BUILD_DOC=False)
-    include_path = [os.path.join(os.path.dirname(__file__), "..", "rados")]
-    cythonize_args = dict(compile_time_env=cython_constants,
-                          include_path=include_path)
-else:
-    sys.exit(1)
-
 cmdclass = {}
 try:
     from Cython.Build import cythonize
Index: ceph-18.2.0/src/pybind/rados/setup.py
===================================================================
--- ceph-18.2.0.orig/src/pybind/rados/setup.py
+++ ceph-18.2.0/src/pybind/rados/setup.py
@@ -130,17 +130,6 @@
     finally:
         shutil.rmtree(tmp_dir)
 
-
-if 'BUILD_DOC' in os.environ or 'READTHEDOCS' in os.environ:
-    ext_args = {}
-    cython_constants = dict(BUILD_DOC=True)
-elif check_sanity():
-    ext_args = get_python_flags(['rados'])
-    cython_constants = dict(BUILD_DOC=False)
-else:
-    sys.exit(1)
-
-cmdclass = {}
 try:
     from Cython.Build import cythonize
     from Cython.Distutils import build_ext
Index: ceph-18.2.0/src/pybind/rbd/setup.py
===================================================================
--- ceph-18.2.0.orig/src/pybind/rbd/setup.py
+++ ceph-18.2.0/src/pybind/rbd/setup.py
@@ -133,20 +133,6 @@
     finally:
         shutil.rmtree(tmp_dir)
 
-
-if 'BUILD_DOC' in os.environ or 'READTHEDOCS' in os.environ:
-    ext_args = {}
-    cython_constants = dict(BUILD_DOC=True)
-    cythonize_args = dict(compile_time_env=cython_constants)
-elif check_sanity():
-    ext_args = get_python_flags(['rados', 'rbd'])
-    cython_constants = dict(BUILD_DOC=False)
-    include_path = [os.path.join(os.path.dirname(__file__), "..", "rados")]
-    cythonize_args = dict(compile_time_env=cython_constants,
-                          include_path=include_path)
-else:
-    sys.exit(1)
-
 cmdclass = {}
 try:
     from Cython.Build import cythonize
Index: ceph-18.2.0/src/pybind/rgw/setup.py
===================================================================
--- ceph-18.2.0.orig/src/pybind/rgw/setup.py
+++ ceph-18.2.0/src/pybind/rgw/setup.py
@@ -134,20 +134,6 @@
     finally:
         shutil.rmtree(tmp_dir)
 
-
-if 'BUILD_DOC' in os.environ or 'READTHEDOCS' in os.environ:
-    ext_args = {}
-    cython_constants = dict(BUILD_DOC=True)
-    cythonize_args = dict(compile_time_env=cython_constants)
-elif check_sanity():
-    ext_args = get_python_flags(['rados', 'rgw'])
-    cython_constants = dict(BUILD_DOC=False)
-    include_path = [os.path.join(os.path.dirname(__file__), "..", "rados")]
-    cythonize_args = dict(compile_time_env=cython_constants,
-                          include_path=include_path)
-else:
-    sys.exit(1)
-
 cmdclass = {}
 try:
     from Cython.Build import cythonize