From 032161a54745753595d632ab25fecc2d2ad4a3af Mon Sep 17 00:00:00 2001 From: Antonio Trande Date: Sat, 6 Nov 2021 12:05:18 +0100 Subject: [PATCH] Release 3.1.1 --- .gitignore | 1 + openbabel-3.1.1-bug2378.patch | 44 +++++++++ openbabel-3.1.1-fix_bug2217.patch | 39 ++++++++ openbabel-3.1.1-fix_bug2223.patch | 34 +++++++ openbabel-disable-tests-s390x.patch | 26 +++--- openbabel-disable-tests.patch | 20 ++--- openbabel-fix-libdir-in-pkgconfig.patch | 9 +- openbabel-narrowing-conversion.patch | 33 ------- openbabel-plugindir.patch | 39 ++++++-- openbabel-python-dl.patch | 15 ---- openbabel-taberror.patch | 32 ------- openbabel.spec | 115 +++++++++++++----------- sources | 2 +- 13 files changed, 241 insertions(+), 168 deletions(-) create mode 100644 openbabel-3.1.1-bug2378.patch create mode 100644 openbabel-3.1.1-fix_bug2217.patch create mode 100644 openbabel-3.1.1-fix_bug2223.patch delete mode 100644 openbabel-narrowing-conversion.patch delete mode 100644 openbabel-python-dl.patch delete mode 100644 openbabel-taberror.patch diff --git a/.gitignore b/.gitignore index f4f1a56..d6ae00f 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,4 @@ openbabel-2.0.2.tar.gz /openbabel-3a63a9849f8d9719c5989c43875d51be50c53019.tar.gz /openbabel-2-4-0.tar.gz /openbabel-2-4-1.tar.gz +/openbabel-openbabel-3-1-1.tar.gz diff --git a/openbabel-3.1.1-bug2378.patch b/openbabel-3.1.1-bug2378.patch new file mode 100644 index 0000000..a0d5d8a --- /dev/null +++ b/openbabel-3.1.1-bug2378.patch @@ -0,0 +1,44 @@ +From 4ba2fec17b786afebadfae800a015704ad533843 Mon Sep 17 00:00:00 2001 +From: dkoes +Date: Mon, 7 Jun 2021 11:04:25 -0400 +Subject: [PATCH] Resolve ImportError with make test + +This change will build _openbabel.so in scripts/python/openbabel instead +of the default build/lib. This is necessary because openbabel.py tries +to import _openbabel like this: + +if __package__ or "." in __name__: + from . import _openbabel +else: + import _openbabel + +This results in a circular import error when running make test (the +first branch of the if is triggered). This code appears to be generated by +SWIG with no obvious way to change it to catch the ImportError and call +import _openbabel instead. Note the PYTHONPATH is set to include +build/lib, but it doesn't matter because SWIG is forcing the import to +happen in scripts/python/openbabel. + +I'm not sure why this hasn't been a problem in the past, perhaps there's +been a change in SWIG. This is with SWIG 4.0.1 and cmake 3.18.6. + +I think the best solution is to move all the files that are being built +in /scripts to the build directory rather than polluting the src tree +with them, but this would require changing all the bindings and I'm not +up for building and testing every binding. +--- + scripts/CMakeLists.txt | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt +index b715a546dd..56821641fe 100644 +--- a/scripts/CMakeLists.txt ++++ b/scripts/CMakeLists.txt +@@ -106,6 +106,7 @@ if (DO_PYTHON_BINDINGS) + set_target_properties(bindings_python PROPERTIES + OUTPUT_NAME _openbabel + PREFIX "" ++ LIBRARY_OUTPUT_DIRECTORY "${openbabel_SOURCE_DIR}/scripts/python/openbabel/" + SUFFIX .so ) + execute_process( + COMMAND diff --git a/openbabel-3.1.1-fix_bug2217.patch b/openbabel-3.1.1-fix_bug2217.patch new file mode 100644 index 0000000..2f5aabf --- /dev/null +++ b/openbabel-3.1.1-fix_bug2217.patch @@ -0,0 +1,39 @@ +From 7de27f309db5f7ec026ef5c5235e5b33bf7d1a85 Mon Sep 17 00:00:00 2001 +From: John Bollinger +Date: Thu, 14 May 2020 08:46:40 -0500 +Subject: [PATCH] Fix test failure with Python 3 + +When run with Python 3.6, test/testdistgeom.py fails with a SyntaxError +about a malformed character escape. This arises from a failure to escape +literal backslash characters in single-quoted SMILES strings (several +occurrences). Python 2 accepts this and does the right things with it, +but Python 3 rejects it. + +Fixes #2217 +--- + test/testdistgeom.py | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +diff --git a/test/testdistgeom.py b/test/testdistgeom.py +index 0fa5adb576..fc3a7515b9 100644 +--- a/test/testdistgeom.py ++++ b/test/testdistgeom.py +@@ -42,13 +42,13 @@ def testSMItoSMI(self): + 'C1CC[C@H]2[C@@H](C1)CCCC2', # cis-decalin + 'C1CC[C@@H]2[C@@H](C1)CCCC2', # trans-decalin + '[C@H]1(NC[C@H]2[C@H]1N2)OC', +- 'Clc1cccc(Cl)c1\C=N\NC(=O)c1cccs1', +- 'O=C1NC(=S)S\C1=C/c1ccco1', ++ 'Clc1cccc(Cl)c1\\C=N\\NC(=O)c1cccs1', ++ 'O=C1NC(=S)S\\C1=C/c1ccco1', + 'S=C1NC(=O)/C(=C/c2ccco2)/S1', +- 'O=C1NC(=S)N\C1=C\c1ccncc1', ++ 'O=C1NC(=S)N\\C1=C\\c1ccncc1', + 'S=C1NC(=O)C(=C)N1', +- 'CC(=O)N\N=C\c1ccncc1', +- 'N/N=c/1\sc2c(n1C)cccc2', ++ 'CC(=O)N\\N=C\\c1ccncc1', ++ 'N/N=c/1\\sc2c(n1C)cccc2', + 'OCCN/C=C\\1/C(=NN(C1=O)c1ccccc1)C', + 'Cc1ccc(o1)/C=C/C=O', + # disabled to make test run faster: diff --git a/openbabel-3.1.1-fix_bug2223.patch b/openbabel-3.1.1-fix_bug2223.patch new file mode 100644 index 0000000..332917b --- /dev/null +++ b/openbabel-3.1.1-fix_bug2223.patch @@ -0,0 +1,34 @@ +From b75c392b75b3494d9dae15176f38facf7e61db17 Mon Sep 17 00:00:00 2001 +From: John Bollinger +Date: Fri, 15 May 2020 11:30:27 -0500 +Subject: [PATCH] Fix UB in UFF parameter parsing + +When evaluating atom coordination number, method +OBForceFieldUFF::ParseParamFile() assumed that it may access a third character +of the atom type string, but in fact that produces undefined behavior if the +string is only one character long. A one-character atom type occurs in +practice with the default parameter file (for deuterium). + +This change addresses the issue by verifying that the second character of +each atom type string is not a C string terminator as a precondition for +accessing the third. If the second is a string terminator then the same +default behavior is provided as if the type were two characters long. + +Fixes #2223 +--- + src/forcefields/forcefielduff.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/forcefields/forcefielduff.cpp b/src/forcefields/forcefielduff.cpp +index 9bff879c9c..2e98e0e804 100644 +--- a/src/forcefields/forcefielduff.cpp ++++ b/src/forcefields/forcefielduff.cpp +@@ -1647,7 +1647,7 @@ namespace OpenBabel { + parameter.b = 0; // used for tracking number of angles in 5-coordinate + parameter.c = 0; + +- char coord = vs[1][2]; // 3rd character of atom type ++ char coord = vs[1][1] ? vs[1][2] : '\0'; // 3rd character of atom type, if any + switch (coord) { + case '1': // linear + parameter._ipar.push_back(1); diff --git a/openbabel-disable-tests-s390x.patch b/openbabel-disable-tests-s390x.patch index 6d0dd06..4d82440 100644 --- a/openbabel-disable-tests-s390x.patch +++ b/openbabel-disable-tests-s390x.patch @@ -1,21 +1,21 @@ -diff -up openbabel-openbabel-2-4-1/test/CMakeLists.txt.s390x openbabel-openbabel-2-4-1/test/CMakeLists.txt ---- openbabel-openbabel-2-4-1/test/CMakeLists.txt.s390x 2016-10-10 17:56:17.000000000 +0200 -+++ openbabel-openbabel-2-4-1/test/CMakeLists.txt 2019-01-27 19:32:21.568052461 +0100 -@@ -62,7 +62,7 @@ set(origtests +diff -up a/test/CMakeLists.txt.s390x b/test/CMakeLists.txt +--- a/test/CMakeLists.txt.s390x 2016-10-10 17:56:17.000000000 +0200 ++++ b/test/CMakeLists.txt 2019-01-27 19:32:21.568052461 +0100 +@@ -74,7 +74,7 @@ ) set (atom_parts 1 2 3 4) - set (ffmmff94_parts 1 2) + set (ffmmff94_parts 1 2 3 4 5 6) -set (math_parts 1 2 3 4) +set (math_parts 1 2 3) + set (pdbreadfile_parts 1 2 3 4) if(BUILD_SHARED) - if(LIBXML2_FOUND) -@@ -238,7 +238,7 @@ endif(NOT MINGW AND NOT CYGWIN) - if (PYTHON_BINDINGS) +@@ -250,8 +250,6 @@ include(UsePythonTest) set(pybindtests -- bindings _pybel example) -+ bindings example) - foreach(pybindtest ${pybindtests}) - SET_SOURCE_FILES_PROPERTIES(test${pybindtest}.py PROPERTIES - PYTHONPATH "${CMAKE_SOURCE_DIR}/scripts/python:${CMAKE_BINARY_DIR}/lib${LIB_SUFFIX}" + bindings +- _pybel +- example + obconv_writers + cdjsonformat + pcjsonformat diff --git a/openbabel-disable-tests.patch b/openbabel-disable-tests.patch index 0f15681..05836c8 100644 --- a/openbabel-disable-tests.patch +++ b/openbabel-disable-tests.patch @@ -1,16 +1,16 @@ -diff -up openbabel-openbabel-2-4-0/test/CMakeLists.txt.tests openbabel-openbabel-2-4-0/test/CMakeLists.txt ---- openbabel-openbabel-2-4-0/test/CMakeLists.txt.tests 2016-09-21 21:55:37.000000000 +0200 -+++ openbabel-openbabel-2-4-0/test/CMakeLists.txt 2016-10-10 13:48:52.726803964 +0200 -@@ -34,7 +34,7 @@ set (implicitH_parts 1) - set (lssr_parts 1 2 3 4 5) - set (isomorphism_parts 1 2 3 4 5 6 7 8) +diff -up a/test/CMakeLists.txt.tests b/test/CMakeLists.txt +--- a/test/CMakeLists.txt.tests 2016-09-21 21:55:37.000000000 +0200 ++++ b/test/CMakeLists.txt 2016-10-10 13:48:52.726803964 +0200 +@@ -39,7 +39,7 @@ + set (isomorphism_parts 1 2 3 4 5 6 7 8 9) set (multicml_parts 1) --set (regressions_parts 1 221 222 223 224) + set (periodic_parts 1 2 3 4) +-set (regressions_parts 1 221 222 223 224 225 226 227 228 240 241 242 1794 2111) +set (regressions_parts 222 223 224) set (rotor_parts 1 2 3 4) set (shuffle_parts 1 2 3 4 5) set (smiles_parts 1 2 3) -@@ -177,7 +177,7 @@ if(WITH_INCHI) +@@ -188,7 +188,7 @@ set_target_properties(test_inchiwrite PROPERTIES LINK_SEARCH_END_STATIC TRUE) endif() # files in test/inchi -- both .sdf and .txt @@ -19,11 +19,11 @@ diff -up openbabel-openbabel-2-4-0/test/CMakeLists.txt.tests openbabel-openbabel set(inchidata ${CMAKE_SOURCE_DIR}/test/inchi) foreach(test ${inchitests}) add_test(inchi${test}_Test -@@ -215,7 +215,7 @@ if(NOT MINGW AND NOT CYGWIN) +@@ -226,7 +226,7 @@ include(UsePythonTest) if(PYTHON_EXECUTABLE) set(pytests -- babel sym smartssym fastsearch unique kekule pdbformat) +- babel sym smartssym fastsearch distgeom unique kekule pdbformat RInChI) + babel smartssym fastsearch unique kekule pdbformat) foreach(pytest ${pytests}) SET_SOURCE_FILES_PROPERTIES(test${pytest}.py PROPERTIES diff --git a/openbabel-fix-libdir-in-pkgconfig.patch b/openbabel-fix-libdir-in-pkgconfig.patch index ee52003..f13dd4a 100644 --- a/openbabel-fix-libdir-in-pkgconfig.patch +++ b/openbabel-fix-libdir-in-pkgconfig.patch @@ -1,11 +1,12 @@ -diff -up openbabel-openbabel-2-4-1/openbabel-2.0.pc.cmake.p openbabel-openbabel-2-4-1/openbabel-2.0.pc.cmake ---- openbabel-openbabel-2-4-1/openbabel-2.0.pc.cmake.p 2016-10-10 17:56:17.000000000 +0200 -+++ openbabel-openbabel-2-4-1/openbabel-2.0.pc.cmake 2019-01-27 10:47:00.905546971 +0100 +diff -up a/openbabel-3.pc.cmake.p b/openbabel-3.pc.cmake +--- a/openbabel-3.pc.cmake.p ++++ b/openbabel-3.pc.cmake @@ -1,6 +1,6 @@ prefix=@CMAKE_INSTALL_PREFIX@ exec_prefix=${prefix} -libdir=${exec_prefix}/@LIB_INSTALL_DIR@ +libdir=${exec_prefix}/lib@LIB_SUFFIX@ includedir=${prefix}/include - pkgincludedir=${includedir}/openbabel-2.0 + pkgincludedir=${includedir}/openbabel@BABEL_MAJ_VER@ + diff --git a/openbabel-narrowing-conversion.patch b/openbabel-narrowing-conversion.patch deleted file mode 100644 index 5524bec..0000000 --- a/openbabel-narrowing-conversion.patch +++ /dev/null @@ -1,33 +0,0 @@ -diff -up openbabel-3a63a9849f8d9719c5989c43875d51be50c53019/src/formats/pngformat.cpp.nc openbabel-3a63a9849f8d9719c5989c43875d51be50c53019/src/formats/pngformat.cpp ---- openbabel-3a63a9849f8d9719c5989c43875d51be50c53019/src/formats/pngformat.cpp.nc 2016-02-16 23:47:25.000000000 +0100 -+++ openbabel-3a63a9849f8d9719c5989c43875d51be50c53019/src/formats/pngformat.cpp 2016-02-18 19:01:40.509752461 +0100 -@@ -218,7 +218,7 @@ bool PNGFormat::ReadMolecule(OBBase* pOb - _count=0; - _hasInputPngFile=true; - } -- const char pngheader[] = {-119,80,78,71,13,10,26,10,0}; -+ const signed char pngheader[] = {-119,80,78,71,13,10,26,10,0}; - char readbytes[9]; - ifs.read(readbytes, 8); - -diff -up openbabel-3a63a9849f8d9719c5989c43875d51be50c53019/src/formats/yasaraformat.cpp.nc openbabel-3a63a9849f8d9719c5989c43875d51be50c53019/src/formats/yasaraformat.cpp ---- openbabel-3a63a9849f8d9719c5989c43875d51be50c53019/src/formats/yasaraformat.cpp.nc 2016-02-16 23:47:25.000000000 +0100 -+++ openbabel-3a63a9849f8d9719c5989c43875d51be50c53019/src/formats/yasaraformat.cpp 2016-02-18 23:22:23.786793588 +0100 -@@ -472,7 +472,7 @@ bool YOBFormat::WriteMolecule(OBBase* pO - - // bool hetatom; - char buffer[32],/*resname[4],*/atomname[5]; -- char double1[8]={0,0,0,0,0,0,-16,0x3f}; -+ const signed char double1[8]={0,0,0,0,0,0,-16,0x3f}; - // char *str; - int i,j,/*m,q,*/pos; - int /*resno,chainNum,link,linktype,*/atoms,element,links/*,chain*/; -@@ -500,7 +500,7 @@ bool YOBFormat::WriteMolecule(OBBase* pO - mem_set(buffer,0,8); - for (i=0;i<4;i++) - { for (j=0;j<4;j++) -- { if (i==j) ofs.write(double1,8); -+ { if (i==j) ofs.write(reinterpret_cast(double1),8); - else ofs.write(buffer,8); } } - storeint32le(buffer,MOB_INFOEND); - storeint32le(&buffer[4],MOB_INFOENDSIZE); diff --git a/openbabel-plugindir.patch b/openbabel-plugindir.patch index 6827fd3..beb73a3 100644 --- a/openbabel-plugindir.patch +++ b/openbabel-plugindir.patch @@ -1,12 +1,35 @@ -diff -up openbabel-75414ad4e043f16ba72ae51c7ca60f448576688d/CMakeLists.txt.plugindir openbabel-75414ad4e043f16ba72ae51c7ca60f448576688d/CMakeLists.txt ---- openbabel-75414ad4e043f16ba72ae51c7ca60f448576688d/CMakeLists.txt.plugindir 2015-02-07 21:42:44.431479900 +0100 -+++ openbabel-75414ad4e043f16ba72ae51c7ca60f448576688d/CMakeLists.txt 2015-02-07 21:43:29.000429326 +0100 -@@ -266,7 +266,7 @@ if(NOT MSVC) +diff -up a/CMakeLists.txt.plugindir b/CMakeLists.txt +--- a/CMakeLists.txt.plugindir 2015-02-07 21:42:44.431479900 +0100 ++++ b/CMakeLists.txt 2015-02-07 21:43:29.000429326 +0100 +@@ -24,7 +24,7 @@ + # had too many 1.100.1 releases. :-) + set(BABEL_MAJ_VER 3) + set(BABEL_MIN_VER 1) +-set(BABEL_PATCH_VER 0) ++set(BABEL_PATCH_VER 1) + + # This should be phased out in preference for just using the target name + set(BABEL_LIBRARY openbabel) +@@ -276,7 +276,7 @@ } " SCANDIR_NEEDS_CONST) -- set(OB_MODULE_PATH "${CMAKE_INSTALL_PREFIX}/${OB_PLUGIN_INSTALL_DIR}" -+ set(OB_MODULE_PATH "${OB_PLUGIN_INSTALL_DIR}" - CACHE PATH "Set to system install for bindings only build") - add_definitions(-DOB_MODULE_PATH="\\"${OB_MODULE_PATH}\\"") +- set(OB_MODULE_PATH "${CMAKE_INSTALL_PREFIX}/${OB_PLUGIN_INSTALL_DIR}") ++ set(OB_MODULE_PATH "${LIB_INSTALL_DIR}/openbabel3") + # Add some visibility support when using GCC + # note: Altough MinGW g++ 4.4 passes this test, visibility can't be used +@@ -751,11 +751,11 @@ + + # Now to configure the installed config file. + set(OB_CONFIG_DIR "${LIB_INSTALL_DIR}/cmake/openbabel3") +-set(OpenBabel3_INCLUDE_DIRS "\${OpenBabel3_INSTALL_PREFIX}/${OB_INCLUDE_DIRS}") ++set(OpenBabel3_INCLUDE_DIRS "\${INCLUDE_INSTALL_DIR}/openbabel3") + set(OpenBabel3_LIBRARIES "$") + + set(OB_EXPORTS_FILE +- "\${OpenBabel3_INSTALL_PREFIX}/${OB_CONFIG_DIR}/OpenBabel3_EXPORTS.cmake") ++ "\${LIB_INSTALL_DIR}/cmake/openbabel3/OpenBabel3_EXPORTS.cmake") + set(REL_REF) + if(NOT WIN32) + set(REL_REF "/../../..") diff --git a/openbabel-python-dl.patch b/openbabel-python-dl.patch deleted file mode 100644 index 2c3c5f7..0000000 --- a/openbabel-python-dl.patch +++ /dev/null @@ -1,15 +0,0 @@ -diff -up openbabel-openbabel-2-4-1/scripts/CMakeLists.txt.py3 openbabel-openbabel-2-4-1/scripts/CMakeLists.txt ---- openbabel-openbabel-2-4-1/scripts/CMakeLists.txt.py3 2019-03-04 11:12:54.369464503 +0100 -+++ openbabel-openbabel-2-4-1/scripts/CMakeLists.txt 2019-03-04 11:59:39.323264995 +0100 -@@ -84,7 +84,10 @@ if (DO_PYTHON_BINDINGS) - COMMAND ${CMAKE_COMMAND} -E echo " try:" >> ob.py - COMMAND ${CMAKE_COMMAND} -E echo " import dl" >> ob.py - COMMAND ${CMAKE_COMMAND} -E echo " except ImportError:" >> ob.py -- COMMAND ${CMAKE_COMMAND} -E echo " import DLFCN as dl" >> ob.py -+ COMMAND ${CMAKE_COMMAND} -E echo " try:" >> ob.py -+ COMMAND ${CMAKE_COMMAND} -E echo " import DLFCN as dl" >> ob.py -+ COMMAND ${CMAKE_COMMAND} -E echo " except ImportError:" >> ob.py -+ COMMAND ${CMAKE_COMMAND} -E echo " import ctypes as dl" >> ob.py - COMMAND ${CMAKE_COMMAND} -E echo " sys.setdlopenflags(sys.getdlopenflags() | dl.RTLD_GLOBAL)" >> ob.py - COMMAND cat ${openbabel_SOURCE_DIR}/scripts/python/openbabel.py >> ob.py - COMMAND ${CMAKE_COMMAND} -E copy ob.py ${openbabel_SOURCE_DIR}/scripts/python/openbabel.py diff --git a/openbabel-taberror.patch b/openbabel-taberror.patch deleted file mode 100644 index 116ea1b..0000000 --- a/openbabel-taberror.patch +++ /dev/null @@ -1,32 +0,0 @@ -diff -up openbabel-openbabel-2-4-1/test/testpdbformat.py.taberror openbabel-openbabel-2-4-1/test/testpdbformat.py ---- openbabel-openbabel-2-4-1/test/testpdbformat.py.taberror 2016-10-10 17:56:17.000000000 +0200 -+++ openbabel-openbabel-2-4-1/test/testpdbformat.py 2019-03-04 11:09:24.786801658 +0100 -@@ -24,12 +24,12 @@ class TestPDBFormat(BaseTest): - - def testInsertionCodes(self): - """ -- Testing a PDB entry with insertion codes to distinguish residues -- upon conversion to FASTA. -+ Testing a PDB entry with insertion codes to distinguish residues -+ upon conversion to FASTA. - """ - self.canFindExecutable("babel") - -- self.entryPDBwithInsertioncodes="""ATOM 406 N VAL L 29 58.041 17.797 48.254 1.00 0.00 N -+ self.entryPDBwithInsertioncodes="""ATOM 406 N VAL L 29 58.041 17.797 48.254 1.00 0.00 N - ATOM 407 CA VAL L 29 57.124 18.088 47.170 1.00 0.00 C - ATOM 408 C VAL L 29 55.739 17.571 47.538 1.00 0.00 C - ATOM 409 O VAL L 29 55.535 16.362 47.550 1.00 0.00 O -@@ -100,9 +100,9 @@ ATOM 473 HE1 TYR L 32 48.512 - ATOM 474 HE2 TYR L 32 48.145 19.172 44.648 1.00 0.00 H - ATOM 475 HH TYR L 32 46.462 17.658 44.280 1.00 0.00 H - """ -- output, error = run_exec(self.entryPDBwithInsertioncodes, -- "babel -ipdb -ofasta") -- self.assertEqual(output.rstrip().rsplit("\n",1)[1], "VSSSY") -+ output, error = run_exec(self.entryPDBwithInsertioncodes, -+ "babel -ipdb -ofasta") -+ self.assertEqual(output.rstrip().rsplit("\n",1)[1], "VSSSY") - - if __name__ == "__main__": - testsuite = [] diff --git a/openbabel.spec b/openbabel.spec index d18d86e..6b6d1cc 100644 --- a/openbabel.spec +++ b/openbabel.spec @@ -1,55 +1,54 @@ -%global commit 3a63a9849f8d9719c5989c43875d51be50c53019 -%global shortcommit %(c=%{commit}; echo ${c:0:7}) - %{!?perl_vendorarch:%global perl_vendorarch %(eval "`perl -V:installvendorarch`"; echo $installvendorarch)} # we don't want to provide private Perl or Python extension libs %global __provides_exclude_from ^(%{perl_vendorarch}/auto|%{python3_sitearch})/.*\\.so$ Name: openbabel -Version: 2.4.1 -Release: 39%{?dist} +Version: 3.1.1 +Release: 3%{?dist} Summary: Chemistry software file format converter License: GPLv2 URL: https://openbabel.org/ -Source0: https://github.com/openbabel/openbabel/archive/openbabel-%(echo %{version} | tr '.' '-').tar.gz +Source0: https://github.com/openbabel/openbabel/archive/openbabel-openbabel-%(echo %{version} | tr '.' '-').tar.gz Source1: obgui.desktop # fix perl modules install path -Patch1: openbabel-perl.patch +Patch0: %{name}-perl.patch # fix plugin directory location (#680292, patch by lg) -Patch4: openbabel-plugindir.patch +Patch1: openbabel-plugindir.patch # fix SWIG_init even when not using swig (#772149) -Patch6: openbabel-noswig-rubymethod.patch +Patch2: openbabel-noswig-rubymethod.patch # On F-17, directory for C ruby files changed to use vendorarch directory -Patch7: openbabel-ruby19-vendorarch.patch +Patch3: openbabel-ruby19-vendorarch.patch # temporarily disable some tests on: # - ppc64 and s390(x) to unblock other builds (#1108103) # - ARM (#1094491) # - aarch64 (#1094513) # Upstream bugs: https://sourceforge.net/p/openbabel/bugs/927/ https://sourceforge.net/p/openbabel/bugs/945/ -Patch8: openbabel-disable-tests.patch -Patch9: openbabel-narrowing-conversion.patch +Patch4: openbabel-disable-tests.patch # Fix path to libdir in .pc file # https://bugzilla.redhat.com/show_bug.cgi?id=1669664 -Patch10: openbabel-fix-libdir-in-pkgconfig.patch +Patch5: openbabel-fix-libdir-in-pkgconfig.patch # Math 4 test is failing on s390x only -Patch11: openbabel-disable-tests-s390x.patch +Patch6: openbabel-disable-tests-s390x.patch -# Fix inconsistent whitespace -Patch12: openbabel-taberror.patch - -# Fix import of dl module in python3.7 -# https://github.com/openbabel/openbabel/pull/372 -Patch13: openbabel-python-dl.patch +Patch7: openbabel-3.1.1-fix_bug2223.patch +Patch8: openbabel-3.1.1-fix_bug2217.patch +Patch9: openbabel-3.1.1-bug2378.patch BuildRequires: make +%if 0%{?el7} +BuildRequires: boost169-devel +%else +BuildRequires: boost-devel +%endif +BuildRequires: swig BuildRequires: cmake3 BuildRequires: dos2unix BuildRequires: desktop-file-utils @@ -57,10 +56,10 @@ BuildRequires: eigen3-devel BuildRequires: gcc-c++ BuildRequires: inchi-devel >= 1.0.3 BuildRequires: libxml2-devel -BuildRequires: swig BuildRequires: wxGTK3-devel BuildRequires: ImageMagick -Requires: %{name}-libs%{?_isa} = %{version}-%{release} +BuildRequires: rapidjson-devel +Requires: %{name}-libs%{?_isa} = %{version}-%{release} %description Open Babel is a free, open-source version of the Babel chemistry file @@ -132,7 +131,7 @@ Requires: %{name}-libs%{?_isa} = %{version}-%{release} BuildRequires: python3-devel BuildRequires: python3-setuptools %{?python_provide:%python_provide python3-%{name}} -Obsoletes: python2-%{name} < 2.4.1-21 +Obsoletes: python2-%{name} < 0:%{version}-%{release} %description -n python3-%{name} Python3 wrapper for the Open Babel library. @@ -148,20 +147,21 @@ Ruby wrapper for the Open Babel library. %prep %setup -q -n %{name}-%{name}-%(echo %{version} | tr '.' '-') -%patch1 -p1 -b .perl_path -%patch4 -p1 -b .plugindir -%patch6 -p1 -b .noswig_ruby -%patch7 -p1 -b .ruby_vendor -%ifarch aarch64 %{arm} %{power64} s390 s390x -%patch8 -p1 -b .tests +%patch0 -p1 -b .perl_path +%patch1 -p1 -b .plugindir +%patch2 -p1 -b .noswig_ruby +%patch3 -p1 -b .ruby_vendor +%ifarch aarch64 %{arm} %{power64} s390x +%patch4 -p1 -b .tests %endif +%patch5 -p1 -b .s390x %ifarch s390x -%patch11 -p1 -b .s390x +%patch6 -p1 -b .backup %endif -%patch9 -p1 -b .nc -%patch10 -p1 -%patch12 -p1 -b .taberr -%patch13 -p1 -b .py3dl +%patch7 -p1 -b .backup +%patch8 -p1 -b .backup +%patch9 -p1 -b .backup + # convert to Unix line endings dos2unix -k \ data/chemdrawcdx.h \ @@ -171,8 +171,6 @@ dos2unix -k \ convert src/GUI/babel.xpm -transparent white babel.png -cp -p %{SOURCE1} obgui.desktop - # Remove duplicate html files pushd doc for man in *.1; do @@ -199,11 +197,22 @@ export CXXFLAGS="%{optflags} -DEIGEN_ALTIVEC_DISABLE_MMA" -DPYTHON_EXECUTABLE=%{__python3} \ -DPERL_BINDINGS:BOOL=ON \ -DRUBY_BINDINGS:BOOL=ON \ + -DWITH_MAEPARSER:BOOL=OFF \ + -DWITH_COORDGEN:BOOL=OFF \ -DOPENBABEL_USE_SYSTEM_INCHI=true \ -DENABLE_VERSIONED_FORMATS=false \ -DRUN_SWIG=true \ -DENABLE_TESTS:BOOL=ON \ - -DOPTIMIZE_NATIVE=OFF + -DOPTIMIZE_NATIVE=OFF \ + -DGLIBC_24_COMPATIBLE:BOOL=OFF \ +%if 0%{?el7} + -DBoost_FILESYSTEM_LIBRARY_RELEASE:FILEPATH=%{_libdir}/boost169/libboost_filesystem.so \ + -DBoost_SERIALIZATION_LIBRARY_RELEASE:FILEPATH=%{_libdir}/boost169/libboost_serialization.so \ + -DBoost_SYSTEM_LIBRARY_RELEASE:FILEPATH=%{_libdir}/boost169/libboost_system.so \ + -DBoost_INCLUDE_DIR:PATH=%{_includedir}/boost169 \ + -DBoost_LIBRARY_DIR_RELEASE:PATH=%{_libdir}/boost169 +%endif + %make_build -C %{_target_platform} %install @@ -211,7 +220,7 @@ export CXXFLAGS="%{optflags} -DEIGEN_ALTIVEC_DISABLE_MMA" rm -f %{buildroot}%{_libdir}/cmake/openbabel2/*.cmake -desktop-file-install --dir=%{buildroot}%{_datadir}/applications obgui.desktop +desktop-file-install --dir=%{buildroot}%{_datadir}/applications %{SOURCE1} install -Dpm644 babel.png %{buildroot}%{_datadir}/pixmaps/babel.png %if 1 @@ -222,12 +231,8 @@ pushd %{_vpath_builddir} # rm the built ruby bindings for testsuite to succeed (Red Hat bugzilla ticket #1191173) rm -f %{_lib}/openbabel.so -# needed by openbabel python module -cp -p %{_lib}/_openbabel.so ../scripts/python/ - export CTEST_OUTPUT_ON_FAILURE=1 export PYTHONPATH=%{buildroot}%{python3_sitearch} -export LD_LIBRARY_PATH=%{buildroot}%{libdir}:%{buildroot}%{libdir}/openbabel:%{buildroot}%{perl_vendorarch}/*/Chemistry/OpenBabel:%{buildroot}%{ruby_vendorarchdir} %if 0%{?el7} ctest3 -j1 --force-new-ctest-process -E 'test_cifspacegroup_1|test_cifspacegroup_2' %else @@ -245,7 +250,6 @@ ctest3 -j1 --force-new-ctest-process %endif %files -%{_bindir}/babel %{_bindir}/ob* %{_bindir}/roundtrip %{_mandir}/man1/*.1* @@ -253,9 +257,11 @@ ctest3 -j1 --force-new-ctest-process %exclude %{_mandir}/man1/obgui.1* %files devel -%{_includedir}/%{name}-2.0 +%{_includedir}/%{name}3 %{_libdir}/libopenbabel.so +%{_libdir}/libopenbabel.so.7 %{_libdir}/pkgconfig/*.pc +%{_libdir}/cmake/openbabel3/ %files doc %doc doc/*.html doc/README* doc/dioxin.* @@ -268,10 +274,10 @@ ctest3 -j1 --force-new-ctest-process %files libs %license COPYING -%doc NEWS.md THANKS AUTHORS authors.txt README.md +%doc THANKS AUTHORS authors.txt README.md %{_datadir}/%{name}/ %{_libdir}/%{name}/ -%{_libdir}/libopenbabel.so.* +%{_libdir}/libopenbabel.so.7.0.0 %files -n perl-%{name} %{perl_vendorarch}/Chemistry/OpenBabel.pm @@ -279,21 +285,26 @@ ctest3 -j1 --force-new-ctest-process %{perl_vendorarch}/*/Chemistry/OpenBabel/OpenBabel.so %files -n python3-%{name} -%{python3_sitearch}/_openbabel.so -%{python3_sitearch}/openbabel.py -%{python3_sitearch}/pybel.py -%{python3_sitearch}/__pycache__/* +%{python3_sitearch}/openbabel/ %files -n ruby-%{name} %{ruby_vendorarchdir}/openbabel.so %changelog +* Sat Nov 06 2021 Antonio Trande - 3.1.1-3 +- Fix CMake config file + +* Wed Sep 22 2021 Antonio Trande - 3.1.1-2 +- Fix patches order + +* Thu Sep 02 2021 Antonio Trande - 3.1.1-1 +- Release 3.1.1 + * Wed Sep 01 2021 Antonio Trande - 2.4.1-39 - Install license file and some release documentation -* Wed Sep 01 2021 Antonio Trande - 2.4.1-38 +* Mon Aug 30 2021 Antonio Trande - 2.4.1-38 - Use CMake3 in EPEL7 -- Fix PPC64le builds (rhbz#1996330) * Thu Jul 22 2021 Fedora Release Engineering - 2.4.1-37 - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild diff --git a/sources b/sources index 462606f..a4ba850 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -c0e0aefeef0f9f2bb2c78109d65c30a5 openbabel-2-4-1.tar.gz +SHA512 (openbabel-openbabel-3-1-1.tar.gz) = d46807e8f4e2f0f691e69943e5c5eda9c271271cfca6f66b6df136bbf384502fd3b65a4adf134a4e9e1f2452e1316c9515aa92292b73205b9eb4d7e4d7a85f18