ccolamd-3.3.2.ebuild 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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="Constrained Column approximate minimum degree ordering algorithm"
  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="debug doc static-libs test"
  14. RESTRICT="!test? ( test ) mirror"
  15. BDEPEND="
  16. virtual/pkgconfig
  17. doc? ( virtual/latex-base )
  18. "
  19. DEPEND=">=sci-libs/suitesparseconfig-${Sparse_PV}"
  20. REPEND="${DEPEND}"
  21. S="${WORKDIR}/${Sparse_P}/${PN^^}"
  22. multilib_src_configure() {
  23. CMAKE_BUILD_TYPE=$(usex debug RelWithDebInfo Release)
  24. local mycmakeargs=(
  25. -DBUILD_STATIC_LIBS=$(usex static-libs OFF ON)
  26. -DSUITESPARSE_DEMOS=$(usex test)
  27. )
  28. cmake_src_configure
  29. }
  30. multilib_src_test() {
  31. # Run demo files
  32. ./ccolamd_example > ccolamd_example.out || die "failed to run test ccolamd_example"
  33. diff "${S}"/Demo/ccolamd_example.out ccolamd_example.out || die "failed testing ccolamd_example"
  34. ./ccolamd_l_example > ccolamd_l_example.out || die "failed to run test ccolamd_l_example"
  35. diff "${S}"/Demo/ccolamd_l_example.out ccolamd_l_example.out || die "failed testing ccolamd_l_example"
  36. }
  37. multilib_src_install() {
  38. if use doc; then
  39. pushd "${S}/Doc"
  40. emake clean
  41. rm -rf *.pdf
  42. emake
  43. popd
  44. DOCS="${S}/Doc/*.pdf"
  45. fi
  46. cmake_src_install
  47. }
  48. multilib_src_install_all() {
  49. use doc && einstalldocs
  50. use !static-libs && ( find "${ED}" -name "*.a" -delete || die )
  51. # strip .la files
  52. find "${ED}" -name '*.la' -delete || die
  53. }