gsl-9999.ebuild 934 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. # Copyright 2019-2023 Gentoo Authors
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=8
  4. inherit cmake
  5. DESCRIPTION="C++ Core Guidelines Support Library"
  6. HOMEPAGE="https://github.com/microsoft/GSL"
  7. if [[ ${PV} == 9999 ]]; then
  8. inherit git-r3
  9. EGIT_REPO_URI="https://github.com/microsoft/GSL"
  10. EGIT_BRANCH="main"
  11. EGIT_SUBMODULES=()
  12. KEYWORDS=""
  13. DOCS=( docs/headers.md )
  14. else
  15. SRC_URI="https://github.com/microsoft/GSL/archive/v${PV}.tar.gz -> ${P}.tar.gz"
  16. KEYWORDS="~amd64 ~x86"
  17. S=${WORKDIR}/${P^^}
  18. DOCS=( README.md CONTRIBUTING.md LICENSE )
  19. fi
  20. IUSE="test"
  21. LICENSE="MIT"
  22. SLOT="0"
  23. BDEPEND="
  24. test? ( dev-cpp/gtest )
  25. "
  26. RESTRICT="
  27. !test? ( test )
  28. mirror
  29. "
  30. src_configure() {
  31. CMAKE_BUILD_TYPE=Release
  32. local mycmakeargs=(
  33. -DCMAKE_INSTALL_PREFIX=/usr
  34. -DGSL_TEST=$(usex test)
  35. -DGSL_INSTALL=ON
  36. )
  37. cmake_src_configure
  38. }
  39. src_test() {
  40. cd ${BUILD_DIR}/tests && (./gsl_tests || die "Tests failed")
  41. }