commit:     bf5dd7c748cd41b6fa540780d668045d1836db0b
Author:     Anna (cybertailor) Vyalkova <cyber+gentoo <AT> sysrq <DOT> in>
AuthorDate: Tue Jan  9 10:19:33 2024 +0000
Commit:     Anna Vyalkova <cyber+gentoo <AT> sysrq <DOT> in>
CommitDate: Tue Jan  9 10:19:50 2024 +0000
URL:        https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=bf5dd7c7

sci-biology/cmdock: fix build

Closes: https://bugs.gentoo.org/901345
Signed-off-by: Anna (cybertailor) Vyalkova <cyber+gentoo <AT> sysrq.in>

 sci-biology/cmdock/cmdock-0.2.0-r1.ebuild          | 119 ++++++++++++++++++++
 .../cmdock/files/cmdock-0.2.0-cxxopts.patch        | 122 +++++++++++++++++++++
 .../cmdock/files/cmdock-0.2.0-include.patch        |  19 ++++
 3 files changed, 260 insertions(+)

diff --git a/sci-biology/cmdock/cmdock-0.2.0-r1.ebuild 
b/sci-biology/cmdock/cmdock-0.2.0-r1.ebuild
new file mode 100644
index 0000000000..e01a7ecf70
--- /dev/null
+++ b/sci-biology/cmdock/cmdock-0.2.0-r1.ebuild
@@ -0,0 +1,119 @@
+# Copyright 2021-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{10..12} )
+BOINC_APP_OPTIONAL="true"
+inherit boinc-app flag-o-matic meson optfeature python-any-r1
+
+DESCRIPTION="Program for docking ligands to proteins and nucleic acids"
+HOMEPAGE="https://gitlab.com/Jukic/cmdock";
+SRC_URI="https://gitlab.com/Jukic/${PN}/-/archive/v${PV}/${PN}-v${PV}.tar.bz2";
+S="${WORKDIR}/${PN}-v${PV}"
+
+LICENSE="LGPL-3 ZLIB"
+SLOT="0/${PV}"
+KEYWORDS="~amd64"
+IUSE="apidoc boinc cpu_flags_x86_sse2 doc test"
+
+# Flaky tests
+RESTRICT="test"
+
+RDEPEND="
+       boinc? ( sci-misc/boinc-wrapper )
+"
+DEPEND="
+       dev-cpp/eigen:3
+       >=dev-cpp/indicators-2.3-r1
+       >=dev-cpp/pcg-cpp-0.98.1_p20210406-r1
+       >=dev-libs/cxxopts-3
+"
+BDEPEND="
+       apidoc? (
+               app-doc/doxygen
+               dev-texlive/texlive-fontutils
+       )
+       doc? (
+               $(python_gen_any_dep '
+                       dev-python/insipid-sphinx-theme[${PYTHON_USEDEP}]
+                       dev-python/sphinx[${PYTHON_USEDEP}]
+               ')
+       )
+       test? ( ${PYTHON_DEPS} )
+"
+
+PATCHES=(
+       "${FILESDIR}"/${P}-include.patch
+       "${FILESDIR}"/${P}-cxxopts.patch
+)
+
+DOCS=( README.md changelog.md )
+
+BOINC_MASTER_URL="https://www.sidock.si/sidock/";
+BOINC_INVITATION_CODE="Crunch_4Science"
+BOINC_APP_HELPTEXT=\
+"The easiest way to do something useful with this application
+is to attach it to SiDock@home BOINC project."
+
+INSTALL_PREFIX="${EPREFIX}/opt/${P}"
+
+python_check_deps() {
+       use doc || return 0
+
+       python_has_version "dev-python/sphinx[${PYTHON_USEDEP}]" &&
+       python_has_version "dev-python/insipid-sphinx-theme[${PYTHON_USEDEP}]"
+}
+
+foreach_wrapper_job() {
+       sed -e "s:@PREFIX@:${INSTALL_PREFIX}:g" -i "${1}" || die
+}
+
+src_prepare() {
+       default
+       python_fix_shebang "${S}"/bin
+}
+
+src_configure() {
+       # very weird directory layout
+       local emesonargs=(
+               --prefix="${INSTALL_PREFIX}"
+               $(meson_use apidoc)
+               $(meson_use doc)
+               $(meson_use test tests)
+               -Ddocdir="${EPREFIX}"/usr/share/doc/${PF}
+       )
+       meson_src_configure
+
+       use cpu_flags_x86_sse2 || append-cppflags "-DBUNDLE_NO_SSE"
+}
+
+src_install() {
+       meson_src_install
+       python_optimize "${D}${INSTALL_PREFIX}"/bin
+
+       if use boinc; then
+               doappinfo "${FILESDIR}"/app_info_${PV}.xml
+               dowrapper cmdock-l
+
+               # install cmdock executable
+               exeinto "$(get_project_root)"
+               exeopts --owner root --group boinc
+               newexe "${D}${INSTALL_PREFIX}"/bin/cmdock cmdock-${PV}
+
+               # install a blank file
+               touch "${T}"/docking_out || die
+               insinto "$(get_project_root)"
+               insopts --owner root --group boinc
+               doins "${T}"/docking_out
+       fi
+}
+
+pkg_postinst() {
+       optfeature "sdtether.py and sdrmsd.py scripts" "dev-python/numpy 
sci-chemistry/openbabel[python]"
+       use boinc && boinc-app_pkg_postinst
+}
+
+pkg_postrm() {
+       use boinc && boinc-app_pkg_postrm
+}

diff --git a/sci-biology/cmdock/files/cmdock-0.2.0-cxxopts.patch 
b/sci-biology/cmdock/files/cmdock-0.2.0-cxxopts.patch
new file mode 100644
index 0000000000..4d7f227957
--- /dev/null
+++ b/sci-biology/cmdock/files/cmdock-0.2.0-cxxopts.patch
@@ -0,0 +1,122 @@
+Update to cxxopts 3.0
+
+--- a/meson.build
++++ b/meson.build
+@@ -40,7 +40,7 @@ if cpp_compiler.get_id() == 'msvc'
+   message('Applying workaround for MSVC by adding flag /Zc:twoPhase-: 
https://stackoverflow.com/questions/56782470/why-do-i-have-warning-c4199-two-phase-name-lookup-is-not-supported-for-c-cli')
+ endif
+ 
+-cxxopts_dep = dependency('cxxopts', fallback : ['cxxopts', 'cxxopts_dep'])
++cxxopts_dep = dependency('cxxopts', version : '>=3.0', fallback : ['cxxopts', 
'cxxopts_dep'])
+ eigen3_dep = dependency('eigen3', fallback : ['eigen', 'eigen_dep'])
+ openmp_dep = dependency('openmp', required : false)
+ 
+diff --git a/src/exe/cmcavity.cxx b/src/exe/cmcavity.cxx
+index 427d3c0..3a5c747 100644
+--- a/src/exe/cmcavity.cxx
++++ b/src/exe/cmcavity.cxx
+@@ -41,7 +41,7 @@ void PrintHeaderAddon(std::ostream &outputStream) {
+ // MAIN PROGRAM STARTS HERE
+ /////////////////////////////////////////////////////////////////////
+ 
+-int main(int argc, char *argv[]) {
++int main(const int argc, const char *argv[]) {
+   // Handle obsolete arguments, if any
+   for (int i = 0; i < argc; i++) {
+     std::string opt = argv[i];
+@@ -451,7 +451,7 @@ int main(int argc, char *argv[]) {
+ 
+       logFile.close();
+     }
+-  } catch (const cxxopts::OptionException &e) {
++  } catch (const cxxopts::exceptions::exception &e) {
+     std::cout << "Error parsing options: " << e.what() << std::endl;
+     return 1;
+   } catch (RbtError &e) {
+@@ -463,4 +463,4 @@ int main(int argc, char *argv[]) {
+   _RBTOBJECTCOUNTER_DUMP_(std::cout)
+ 
+   return 0;
+-}
+\ No newline at end of file
++}
+diff --git a/src/exe/cmdock.cxx b/src/exe/cmdock.cxx
+index 10e18ca..86bbff1 100644
+--- a/src/exe/cmdock.cxx
++++ b/src/exe/cmdock.cxx
+@@ -80,7 +80,7 @@ void printHelpFooter() {
+ // MAIN PROGRAM STARTS HERE
+ /////////////////////////////////////////////////////////////////////
+ 
+-int main(int argc, char *argv[]) {
++int main(const int argc, const char *argv[]) {
+   // Handle premature termination
+   signal (SIGINT, terminator);
+   
+@@ -941,7 +941,7 @@ int main(int argc, char *argv[]) {
+     log << "Thank you for using " << Rbt::GetProgramName() << " "
+               << Rbt::GetVersion() << "." << std::endl;
+     logFile.close();
+-  } catch (const cxxopts::OptionException &e) {
++  } catch (const cxxopts::exceptions::exception &e) {
+     std::cout << "Error parsing options: " << e.what() << std::endl;
+     return 1;
+   } catch (RbtError &e) {
+@@ -953,4 +953,4 @@ int main(int argc, char *argv[]) {
+   _RBTOBJECTCOUNTER_DUMP_(std::cout)
+ 
+   return 0;
+-}
+\ No newline at end of file
++}
+diff --git a/src/exe/cmmoegrid.cxx b/src/exe/cmmoegrid.cxx
+index 4bff8f3..bf74b52 100644
+--- a/src/exe/cmmoegrid.cxx
++++ b/src/exe/cmmoegrid.cxx
+@@ -57,7 +57,7 @@ RbtModelList CreateProbes(std::string anAtomTypeStr) {
+ // MAIN PROGRAM STARTS HERE
+ /////////////////////////////////////////////////////////////////////
+ 
+-int main(int argc, char *argv[]) {
++int main(const int argc, const char *argv[]) {
+   std::cout.setf(std::ios_base::left, std::ios_base::adjustfield);
+ 
+   // Strip off the path to the executable, leaving just the file name
+@@ -268,7 +268,7 @@ int main(int argc, char *argv[]) {
+       }
+       std::cout << "done." << std::endl;
+     }
+-  } catch (const cxxopts::OptionException &e) {
++  } catch (const cxxopts::exceptions::exception &e) {
+     std::cout << "Error parsing options: " << e.what() << std::endl;
+     return 1;
+   } catch (RbtError &e) {
+diff --git a/src/exe/cmzip.cxx b/src/exe/cmzip.cxx
+index 1d1f69a..043d7be 100644
+--- a/src/exe/cmzip.cxx
++++ b/src/exe/cmzip.cxx
+@@ -504,7 +504,7 @@ void rescue(cxxopts::ParseResult result){
+ }
+ 
+ // ENTRY POINT
+-int main(int argc, char *argv[]) {
++int main(const int argc, const char *argv[]) {
+   // Handle premature termination
+   signal (SIGINT, terminator);
+ 
+@@ -580,7 +580,7 @@ Use this if CmDock terminates prematurely. CmZIP will 
search for records in the
+       return 0;
+     }
+ 
+-  } catch (const cxxopts::OptionException &e) {
++  } catch (const cxxopts::exceptions::exception &e) {
+     std::cout << "Error parsing options: " << e.what() << std::endl;
+     return 1;
+   } catch (const std::exception &exc) {
+@@ -589,4 +589,4 @@ Use this if CmDock terminates prematurely. CmZIP will 
search for records in the
+   /*} catch (...) {
+       std::cout << "Unknown exception" << std::endl;
+   }*/
+-}
+\ No newline at end of file
++}

diff --git a/sci-biology/cmdock/files/cmdock-0.2.0-include.patch 
b/sci-biology/cmdock/files/cmdock-0.2.0-include.patch
new file mode 100644
index 0000000000..b4a6e80bb0
--- /dev/null
+++ b/sci-biology/cmdock/files/cmdock-0.2.0-include.patch
@@ -0,0 +1,19 @@
+Rbt.cxx: Add missing include
+
+--- a/src/lib/Rbt.cxx
++++ b/src/lib/Rbt.cxx
+@@ -15,6 +15,7 @@
+ #include <algorithm> //For sort
+ #include <climits>   //For PATH_MAX
+ #include <cstdlib>   //For getenv
++#include <cstdint>   //For int types
+ #include <ctime>     //For time functions
+ #include <dirent.h>  //For directory handling
+ #include <fstream>   //For ifstream
+@@ -581,4 +582,4 @@ bool Rbt::endsWith (std::string const &fullString, 
std::string const &ending) {
+     } else {
+         return false;
+     }
+-}
+\ No newline at end of file
++}

Reply via email to