arpack-3.9.1.ebuild 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. # Copyright 1999-2023 Gentoo Authors
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=8
  4. PYTHON_COMPAT=( python3_{10..12} )
  5. inherit cmake flag-o-matic fortran-2 python-single-r1
  6. if [[ ${PV} == *9999 ]]; then
  7. inherit git-r3
  8. EGIT_REPO_URI="https://github.com/opencollab/arpack-ng"
  9. else
  10. SRC_URI="https://github.com/opencollab/${PN}-ng/archive/${PV}.tar.gz -> ${P}.tar.gz"
  11. KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos"
  12. S="${WORKDIR}/${PN}-ng-${PV}"
  13. fi
  14. DESCRIPTION="Arnoldi package library to solve large scale eigenvalue problems"
  15. HOMEPAGE="http://www.caam.rice.edu/software/ARPACK/ https://github.com/opencollab/arpack-ng"
  16. LICENSE="BSD"
  17. SLOT="0"
  18. IUSE="doc examples icb icbexmm -lp64 mpi python"
  19. RDEPEND="
  20. virtual/blas
  21. virtual/lapack
  22. icbexmm? ( dev-cpp/eigen )
  23. mpi? ( virtual/mpi )
  24. icb? ( virtual/mpi[cxx] )
  25. python? (
  26. ${PYTHON_DEPS}
  27. $(python_gen_cond_dep 'dev-libs/boost:=[numpy,python,${PYTHON_USEDEP}]')
  28. )
  29. "
  30. DEPEND="${RDEPEND}"
  31. BDEPEND="virtual/pkgconfig"
  32. REQUIRED_USE="
  33. icb? ( mpi )
  34. python? (
  35. ${PYTHON_REQUIRED_USE}
  36. icbexmm
  37. )
  38. "
  39. RESTRICT="mirror"
  40. src_configure() {
  41. append-fflags '-fallow-argument-mismatch'
  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. }