amgcl-9999.ebuild 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. Copyright 1999-2024 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=8
  4. inherit cmake
  5. DESCRIPTION="An accelerated algebraic multigrid for C++"
  6. HOMEPAGE="https://github.com/ddemidov/amgcl"
  7. if [[ ${PV} == *9999 ]]; then
  8. inherit git-r3
  9. EGIT_REPO_URI="https://github.com/ddemidov/amgcl"
  10. EGIT_BRANCH="master"
  11. else
  12. SRC_URI="https://github.com/ddemidov/amgcl/archive/${PV}.tar.gz -> ${P}.tar.gz"
  13. KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos"
  14. S="${WORKDIR}/${PN}-${PV}"
  15. fi
  16. LICENSE="MIT"
  17. SLOT="0"
  18. KEYWORDS="~x86 ~amd64"
  19. IUSE="doc examples icb icbexmm -lp64 mpi python"
  20. RDEPEND="
  21. virtual/blas
  22. virtual/lapack
  23. icbexmm? ( dev-cpp/eigen )
  24. mpi? ( virtual/mpi )
  25. icb? ( virtual/mpi[cxx] )
  26. python? (
  27. ${PYTHON_DEPS}
  28. $(python_gen_cond_dep 'dev-libs/boost:=[numpy,python,${PYTHON_USEDEP}]')
  29. )
  30. "
  31. DEPEND="${RDEPEND}"
  32. BDEPEND="virtual/pkgconfig"
  33. REQUIRED_USE="
  34. icb? ( mpi )
  35. python? (
  36. ${PYTHON_REQUIRED_USE}
  37. icbexmm
  38. )
  39. "
  40. RESTRICT="mirror"
  41. src_configure() {
  42. local mycmakeargs=(
  43. -DBUILD_SHARED_LIBS=ON
  44. -DEXAMPLES=$(usex examples)
  45. -DICB=$(usex icb)
  46. -DICBEXMM=$(usex icbexmm)
  47. -DINTERFACE64=$(usex lp64)
  48. -DMPI=$(usex mpi)
  49. -DPYTHON3=$(usex python)
  50. )
  51. cmake_src_configure
  52. }
  53. src_install() {
  54. cmake_src_install
  55. dodoc DOCUMENTS/*.doc
  56. newdoc DOCUMENTS/README README.doc
  57. use doc && dodoc "${WORKDIR}"/*.ps
  58. if use examples; then
  59. for i in BAND COMPLEX NONSYM SIMPLE SVD SYM ; do
  60. exeinto "/usr/libexec/${PN}/examples/${i}"
  61. doexe "${BUILD_DIR}/EXAMPLES/${i}"/*
  62. done
  63. if use mpi; then
  64. exeinto "/usr/libexec/${PN}/examples/MPI"
  65. doexe "${BUILD_DIR}"/PARPACK/EXAMPLES/MPI/*
  66. fi
  67. if use python; then
  68. docinto examples/pyarpack
  69. dodoc "${BUILD_DIR}"/*.py
  70. fi
  71. docompress -x "/usr/share/doc/${PF}/examples"
  72. fi
  73. if use icbexmm; then
  74. exeinto "/usr/libexec/${PN}/examples/MATRIX_MARKET"
  75. doexe "${BUILD_DIR}/EXAMPLES/MATRIX_MARKET/arpackmm"
  76. rm "${BUILD_DIR}/EXAMPLES/MATRIX_MARKET/arpackmm" || die
  77. docinto examples
  78. dodoc -r "${BUILD_DIR}/EXAMPLES/MATRIX_MARKET"
  79. fi
  80. if use python; then
  81. python_domodule "${ED}/usr/$(get_libdir)/pyarpack"
  82. rm -r "${ED}/usr/$(get_libdir)/pyarpack" || die
  83. fi
  84. }