aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--academic/avogadrolibs/avogadrolibs.SlackBuild5
-rw-r--r--academic/avogadrolibs/fix_mmtfformat_cpp.diff31
2 files changed, 35 insertions, 1 deletions
diff --git a/academic/avogadrolibs/avogadrolibs.SlackBuild b/academic/avogadrolibs/avogadrolibs.SlackBuild
index 9226a8cc3f5ed..8910378f05452 100644
--- a/academic/avogadrolibs/avogadrolibs.SlackBuild
+++ b/academic/avogadrolibs/avogadrolibs.SlackBuild
@@ -26,7 +26,7 @@ cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=avogadrolibs
VERSION=${VERSION:-1.97.0}
-BUILD=${BUILD:-1}
+BUILD=${BUILD:-2}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
MVERSION=${MVERSION:-1.0.0}
@@ -105,6 +105,9 @@ find -L . \
# fix issues that generate cmake warnings
patch -p1 < $CWD/fix_cmake-find-package.diff
+# fix build error cause ambiguous definition in source code
+# (thanks to StefanBruens from OpenChemistry in GitHub)
+patch -p1 < $CWD/fix_mmtfformat_cpp.diff
mkdir -p build
# Following steps prevent the download of the executable genXrdPattern
diff --git a/academic/avogadrolibs/fix_mmtfformat_cpp.diff b/academic/avogadrolibs/fix_mmtfformat_cpp.diff
new file mode 100644
index 0000000000000..03b3994b29917
--- /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)
+ {