camd-3.3.1.ebuild 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. # Copyright 1999-2024 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/3"
  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. RDEPEND="${DEPEND}"
  17. BDEPEND="doc? ( virtual/latex-base )"
  18. S="${WORKDIR}/${Sparse_P}/${PN^^}"
  19. multilib_src_configure() {
  20. CMAKE_BUILD_TYPE=$(usex debug RelWithDebInfo Release)
  21. local mycmakeargs=(
  22. -DBUILD_SHARED_LIBS=ON
  23. -DBUILD_STATIC_LIBS=$(usex static-libs)
  24. -DSUITESPARSE_DEMOS=$(usex test)
  25. )
  26. cmake_src_configure
  27. }
  28. multilib_src_test() {
  29. # Run demo files
  30. local demofiles=(
  31. camd_demo
  32. camd_l_demo
  33. camd_demo2
  34. camd_simple
  35. )
  36. for i in ${demofiles[@]}; do
  37. ./"${i}" > "${i}.out" || die "failed to run test ${i}"
  38. diff "${S}/Demo/${i}.out" "${i}.out" || die "failed testing ${i}"
  39. done
  40. einfo "All tests passed"
  41. }
  42. multilib_src_install() {
  43. if use doc; then
  44. pushd "${S}/Doc"
  45. emake clean
  46. rm -rf *.pdf
  47. emake
  48. popd
  49. DOCS="${S}/Doc/*.pdf"
  50. fi
  51. cmake_src_install
  52. }
  53. multilib_src_install_all() {
  54. use doc && einstalldocs
  55. use !static-libs && ( find "${ED}" -name "*.a" -delete || die )
  56. # strip .la files
  57. find "${ED}" -name '*.la' -delete || die
  58. }