Salome HOME
spns #33691 : fix boost compilation issue on debian 10 - python 3.7
authorNabil Ghodbane <nabil.ghodbane@cea.fr>
Wed, 15 Feb 2023 12:20:53 +0000 (13:20 +0100)
committerNabil Ghodbane <nabil.ghodbane@cea.fr>
Wed, 15 Feb 2023 12:20:53 +0000 (13:20 +0100)
applications/MEDCOUPLING-9.7.0.pyconf
products/boost.pyconf
products/patches/boost-1.58.0-python-3.7.patch [new file with mode: 0644]

index f376d70de7c17a70a9f7448fefe43044c1ded37c..456b7c04da4d2a6ac7af3583a8df8c9384cfb2db 100644 (file)
@@ -88,4 +88,8 @@ __overwrite__ :
     __condition__ : "VARS.dist in ['FD32']"
     'APPLICATION.products.scipy' : '1.5.2' # gcc https://github.com/scipy/scipy/issues/11611 - either patch numpy to include -fallow-argument-mismatch or move to that version
   }
+  {
+    __condition__ : "VARS.dist in ['DB10']"
+      'APPLICATION.products.boost': {tag:'1.58.0',   base: 'no', section: 'version_1_58_0_DB10'}
+  }
 ]
index 85ed6a45ba47644dad7e171b5efdde82bc4f574c..ef40ee221f0bf40520bee90324e48f52b2c1e018 100644 (file)
@@ -57,6 +57,12 @@ version_1_71_0_FD36 :
     patches : ['boost-1.71-pthread-gcc-11.patch']
 }
 
+version_1_58_0_DB10 :
+{
+    patches : ['boost-1.58.0-python-3.7.patch']
+}
+
+
 version_1_52_0 :
 {
     patches : 
diff --git a/products/patches/boost-1.58.0-python-3.7.patch b/products/patches/boost-1.58.0-python-3.7.patch
new file mode 100644 (file)
index 0000000..976fed4
--- /dev/null
@@ -0,0 +1,20 @@
+--- boost-1.58.0_ref/libs/python/src/converter/builtin_converters.cpp  2015-03-26 14:16:15.000000000 +0100
++++ boost-1.58.0_dev/libs/python/src/converter/builtin_converters.cpp  2023-02-15 13:08:31.233047962 +0100
+@@ -45,11 +45,16 @@
+   {
+       return PyString_Check(obj) ? PyString_AsString(obj) : 0;
+   }
+-#else
++#elif PY_VERSION_HEX < 0x03070000
+   void* convert_to_cstring(PyObject* obj)
+   {
+       return PyUnicode_Check(obj) ? _PyUnicode_AsString(obj) : 0;
+   }
++#else
++  void* convert_to_cstring(PyObject* obj)
++  {
++      return PyUnicode_Check(obj) ? const_cast<void*>(reinterpret_cast<const void*>(_PyUnicode_AsString(obj))) : 0;
++  }
+ #endif
+   // Given a target type and a SlotPolicy describing how to perform a