ldl-3.3.1.ebuild 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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 LDL' factorization and solve library"
  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 fortran static-libs test"
  14. RESTRICT="!test? ( test ) mirror"
  15. BDEPEND="
  16. virtual/pkgconfig
  17. >=sci-libs/amd-3.3.1
  18. doc? ( virtual/latex-base )
  19. "
  20. DEPEND=">=sci-libs/suitesparseconfig-${Sparse_PV}"
  21. REPEND="${DEPEND}"
  22. S="${WORKDIR}/${Sparse_P}/${PN^^}"
  23. multilib_src_configure() {
  24. CMAKE_BUILD_TYPE=$(usex debug RelWithDebInfo Release)
  25. local mycmakeargs=(
  26. -DBUILD_STATIC_LIBS=$(usex static-libs)
  27. -DSUITESPARSE_HAS_FORTRAN=$(usex fortran)
  28. -DSUITESPARSE_DEMOS=$(usex test)
  29. )
  30. cmake_src_configure
  31. }
  32. multilib_src_test() {
  33. # Run demo files
  34. local demofiles=(
  35. ldl_simple
  36. ldll_simple
  37. ldl_main
  38. ldll_main
  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. }