spex-2.3.2.ebuild 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. # Copyright 1999-2023 Gentoo Authors
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=8
  4. inherit cmake-multilib
  5. Sparse_PV="7.6.0"
  6. Sparse_P="SuiteSparse-${Sparse_PV}"
  7. DESCRIPTION="Library to order a sparse matrix prior to Cholesky factorization"
  8. HOMEPAGE="https://people.engr.tamu.edu/davis/suitesparse.html"
  9. SRC_URI="https://github.com/DrTimothyAldenDavis/SuiteSparse/archive/refs/tags/v${Sparse_PV}.tar.gz -> ${Sparse_P}.gh.tar.gz"
  10. LICENSE="BSD"
  11. SLOT="0/2"
  12. KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux"
  13. IUSE="doc debug test static-libs"
  14. RESTRICT="!test? ( test )"
  15. DEPEND=">=sci-libs/suitesparseconfig-${Sparse_PV}
  16. >=sci-libs/amd-3.3.1
  17. >=sci-libs/colamd-3.3.1
  18. >=dev-libs/gmp-6.1.2
  19. >=dev-libs/mpfr-4.0.2
  20. "
  21. RDEPEND="${DEPEND}"
  22. BDEPEND="doc? ( virtual/latex-base )"
  23. S="${WORKDIR}/${Sparse_P}/${PN^^}"
  24. multilib_src_configure() {
  25. CMAKE_BUILD_TYPE=$(usex debug RelWithDebInfo Release)
  26. local mycmakeargs=(
  27. -DBUILD_SHARED_LIBS=ON
  28. -DBUILD_STATIC_LIBS=$(usex static-libs)
  29. -DSUITESPARSE_DEMOS=$(usex test)
  30. )
  31. cmake_src_configure
  32. }
  33. multilib_src_test() {
  34. # Run demo files
  35. local demofiles=(
  36. spexlu_demo
  37. example
  38. example2
  39. )
  40. for i in ${demofiles[@]}; do
  41. ./"${i}" > "${i}.out" || die "failed to run test ${i}"
  42. diff "${S}/Demo/${i}.out" "${i}.out" || die "failed testing ${i}"
  43. done
  44. einfo "All tests passed"
  45. }
  46. multilib_src_install() {
  47. if use doc; then
  48. pushd "${S}/Doc"
  49. emake clean
  50. rm -rf *.pdf
  51. emake
  52. popd
  53. DOCS="${S}/Doc/*.pdf"
  54. fi
  55. cmake_src_install
  56. }
  57. multilib_src_install_all() {
  58. use doc && einstalldocs
  59. use !static-libs && ( find "${ED}" -name "*.a" -delete || die )
  60. # strip .la files
  61. find "${ED}" -name '*.la' -delete || die
  62. }