suitesparseconfig-7.6.0.ebuild 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. # Copyright 1999-2023 Gentoo Authors
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=8
  4. inherit cmake-multilib toolchain-funcs
  5. DESCRIPTION="Common configurations for all packages in suitesparse"
  6. HOMEPAGE="http://faculty.cse.tamu.edu/davis/suitesparse.html"
  7. SRC_URI="https://github.com/DrTimothyAldenDavis/SuiteSparse/archive/v${PV}.tar.gz -> SuiteSparse-${PV}.gh.tar.gz"
  8. # No licensing restrictions apply to this file or to the SuiteSparse_config directory.
  9. LICENSE="public-domain"
  10. SLOT="0"
  11. KEYWORDS="amd64 arm arm64 ~hppa ~ia64 ~mips ppc ppc64 sparc x86"
  12. IUSE="doc debug openmp cuda static-libs"
  13. RESTRICT="mirror"
  14. S=${WORKDIR}/SuiteSparse-${PV}/SuiteSparse_config
  15. src_prepare() {
  16. tc-export CC CXX AR RANLIB
  17. multilib_copy_sources
  18. cmake_src_prepare
  19. }
  20. multilib_src_configure() {
  21. CMAKE_BUILD_TYPE=$(usex debug RelWithDebInfo Release)
  22. local mycmakeargs=(
  23. -DBLA_VENDOR=Generic
  24. -DBUILD_SHARED_LIBS=ON
  25. -DBUILD_STATIC_LIBS=$(use static-libs)
  26. -DSUITESPARSE_CONFIG_USE_OPENMP=$(usex openmp)
  27. -DSUITESPARSE_HAS_CUDA=$(usex cuda)
  28. )
  29. cmake_src_configure
  30. }
  31. src_configure() {
  32. cmake-multilib_src_configure
  33. }
  34. multilib_src_compile() {
  35. cmake_src_compile
  36. }
  37. src_compile() {
  38. cmake-multilib_src_compile
  39. }
  40. multilib_src_install() {
  41. cmake_src_install
  42. if multilib_is_native_abi; then
  43. use static-libs && ( dolib.a libsuitesparseconfig.a || die )
  44. fi
  45. }
  46. multilib_src_install_all() {
  47. use doc && einstalldocs
  48. use !static-libs && ( find "${ED}" -name "*.a" -delete || die )
  49. # strip .la files
  50. find "${ED}" -name '*.la' -delete || die
  51. }