summaryrefslogtreecommitdiffstats
path: root/academic/avogadrolibs/fix_mmtfformat_cpp.diff
diff options
context:
space:
mode:
Diffstat (limited to 'academic/avogadrolibs/fix_mmtfformat_cpp.diff')
-rw-r--r--academic/avogadrolibs/fix_mmtfformat_cpp.diff31
1 files changed, 31 insertions, 0 deletions
diff --git a/academic/avogadrolibs/fix_mmtfformat_cpp.diff b/academic/avogadrolibs/fix_mmtfformat_cpp.diff
new file mode 100644
index 0000000000..03b3994b29
--- /dev/null
+++ b/academic/avogadrolibs/fix_mmtfformat_cpp.diff
@@ -0,0 +1,31 @@
+Ref: https://github.com/OpenChemistry/avogadrolibs/commit/0db79eb15b2f1dda1dd07a807b98086698cfee7a
+Thanks to StefanBruens from OpenChemistry project
+
+--- avogadrolibs-1.97.0/avogadro/io/mmtfformat.cpp 2023-20-03 18:50:00.000000000 +0200
++++ avogadrolibs-1.97.0-fixed/avogadro/io/mmtfformat.cpp 2023-20-03 18:50:01.000000000 +0200
+@@ -33,21 +33,25 @@
+
+ MMTFFormat::~MMTFFormat() = default;
+
++namespace {
+ // from latest MMTF code, under the MIT license
+ // https://github.com/rcsb/mmtf-cpp/blob/master/include/mmtf/structure_data.hpp
++#if MMTF_SPEC_VERSION_MAJOR <= 1 && MMTF_SPEC_VERSION_MINOR < 1
+ bool is_polymer(const unsigned int chain_index,
+ const std::vector<mmtf::Entity>& entity_list)
+ {
+ for (const auto & i : entity_list) {
+ if (std::find(i.chainIndexList.begin(),
+ i.chainIndexList.end(),
+ chain_index) != i.chainIndexList.end()) {
+ return (i.type == "polymer" ||
+ i.type == "POLYMER");
+ }
+ }
+ return false;
+ }
++#endif
++} // namespace
+
+ bool MMTFFormat::read(std::istream& file, Molecule& molecule)
+ {