klu-2.3.2.ebuild 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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="Sparse LU factorization for circuit simulation"
  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="LGPL-2.1+"
  11. SLOT="0/2"
  12. KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~x86-linux"
  13. IUSE="+cholmod debug doc static-libs test"
  14. RESTRICT="!test? ( test ) mirror"
  15. DEPEND=">=sci-libs/suitesparseconfig-${Sparse_PV}
  16. >=sci-libs/amd-3.3.1
  17. >=sci-libs/btf-2.3.1
  18. >=sci-libs/colamd-3.3.1
  19. cholmod? ( >=sci-libs/cholmod-5.2.0 )
  20. virtual/blas"
  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_STATIC_LIBS=$(usex static-libs)
  28. -DKLU_USE_CHOLMOD=$(usex cholmod)
  29. -DSUITESPARSE_DEMOS=$(usex test)
  30. )
  31. cmake_src_configure
  32. }
  33. multilib_src_test() {
  34. # Run demo files
  35. ./klu_simple || die "failed testing"
  36. ./kludemo < "${S}"/Matrix/1c.mtx || die "failed testing"
  37. ./kludemo < "${S}"/Matrix/arrowc.mtx || die "failed testing"
  38. ./kludemo < "${S}"/Matrix/arrow.mtx || die "failed testing"
  39. ./kludemo < "${S}"/Matrix/impcol_a.mtx || die "failed testing"
  40. ./kludemo < "${S}"/Matrix/w156.mtx || die "failed testing"
  41. ./kludemo < "${S}"/Matrix/ctina.mtx || die "failed testing"
  42. ./kluldemo < "${S}"/Matrix/1c.mtx || die "failed testing"
  43. ./kluldemo < "${S}"/Matrix/arrowc.mtx || die "failed testing"
  44. ./kluldemo < "${S}"/Matrix/arrow.mtx || die "failed testing"
  45. ./kluldemo < "${S}"/Matrix/impcol_a.mtx || die "failed testing"
  46. ./kluldemo < "${S}"/Matrix/w156.mtx || die "failed testing"
  47. ./kluldemo < "${S}"/Matrix/ctina.mtx || die "failed testing"
  48. }
  49. multilib_src_install() {
  50. if use doc; then
  51. pushd "${S}/Doc"
  52. emake clean
  53. rm -rf *.pdf
  54. emake
  55. popd
  56. DOCS="${S}/Doc/*.pdf"
  57. fi
  58. cmake_src_install
  59. }
  60. multilib_src_install_all() {
  61. use doc && einstalldocs
  62. use !static-libs && ( find "${ED}" -name "*.a" -delete || die )
  63. # strip .la files
  64. find "${ED}" -name '*.la' -delete || die
  65. }