btf-2.3.1.ebuild 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. # Copyright 1999-2024 Gentoo Authors
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=8
  4. FORTRAN_NEEDED="fortran"
  5. inherit cmake-multilib fortran-2
  6. Sparse_PV="7.6.0"
  7. Sparse_P="SuiteSparse-${Sparse_PV}"
  8. DESCRIPTION="BTF is a library for permuting a matrix into block upper triangular form"
  9. HOMEPAGE="https://people.engr.tamu.edu/davis/suitesparse.html"
  10. SRC_URI="https://github.com/DrTimothyAldenDavis/SuiteSparse/archive/refs/tags/v${Sparse_PV}.tar.gz -> ${Sparse_P}.gh.tar.gz"
  11. LICENSE="BSD"
  12. SLOT="0/2"
  13. KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux"
  14. IUSE="debug doc fortran static-libs test"
  15. RESTRICT="!test? ( test ) mirror"
  16. BDEPEND="
  17. virtual/pkgconfig
  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. btf_demo
  36. btf_l_demo
  37. btf_demo2
  38. btf_simple
  39. )
  40. if use fortran; then
  41. demofiles+=(
  42. btf_f77simple
  43. btf_f77demo
  44. )
  45. fi
  46. for i in ${demofiles[@]}; do
  47. ./"${i}" > "${i}.out" || die "failed to run test ${i}"
  48. diff "${S}/Demo/${i}.out" "${i}.out" || die "failed testing ${i}"
  49. done
  50. einfo "All tests passed"
  51. }
  52. multilib_src_install() {
  53. if use doc; then
  54. pushd "${S}/Doc"
  55. emake clean
  56. rm -rf *.pdf
  57. emake
  58. popd
  59. DOCS="${S}/Doc/*.pdf"
  60. fi
  61. cmake_src_install
  62. }
  63. multilib_src_install_all() {
  64. use doc && einstalldocs
  65. use !static-libs && ( find "${ED}" -name "*.a" -delete || die )
  66. # strip .la files
  67. find "${ED}" -name '*.la' -delete || die
  68. }