You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

79 lines
1.7 KiB

  1. # Copyright 1999-2021 Gentoo Authors
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=8
  4. DISTUTILS_OPTIONAL="1"
  5. PYTHON_COMPAT=( python3_{8..10} pypy3 )
  6. inherit cmake-multilib distutils-r1
  7. if [[ ${PV} == *9999* ]] ; then
  8. EGIT_REPO_URI="https://github.com/google/${PN}.git"
  9. inherit git-r3
  10. else
  11. KEYWORDS="~alpha ~amd64 arm arm64 ~hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~x64-macos ~x64-solaris"
  12. SRC_URI="https://github.com/google/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
  13. fi
  14. DESCRIPTION="Generic-purpose lossless compression algorithm"
  15. HOMEPAGE="https://github.com/google/brotli"
  16. LICENSE="MIT python? ( Apache-2.0 )"
  17. SLOT="0/$(ver_cut 1)"
  18. IUSE="python static-libs test"
  19. REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
  20. # tests are currently broken, see https://github.com/google/brotli/issues/850
  21. RESTRICT="test"
  22. DOCS=( README.md CONTRIBUTING.md )
  23. PATCHES=( "${FILESDIR}/${PV}-linker.patch" )
  24. RDEPEND="python? ( ${PYTHON_DEPS} )"
  25. DEPEND="${RDEPEND}"
  26. src_prepare() {
  27. cmake_src_prepare
  28. use python && distutils-r1_src_prepare
  29. }
  30. multilib_src_configure() {
  31. local mycmakeargs=(
  32. -DBUILD_TESTING="$(usex test)"
  33. )
  34. cmake_src_configure
  35. }
  36. src_configure() {
  37. cmake-multilib_src_configure
  38. use python && distutils-r1_src_configure
  39. }
  40. multilib_src_compile() {
  41. cmake_src_compile
  42. }
  43. src_compile() {
  44. cmake-multilib_src_compile
  45. use python && distutils-r1_src_compile
  46. }
  47. python_test() {
  48. esetup.py test || die
  49. }
  50. multilib_src_test() {
  51. cmake_src_test
  52. }
  53. src_test() {
  54. cmake-multilib_src_test
  55. use python && distutils-r1_src_test
  56. }
  57. multilib_src_install() {
  58. cmake_src_install
  59. use static-libs || rm "${ED}"/usr/$(get_libdir)/*.a || die
  60. }
  61. multilib_src_install_all() {
  62. use python && distutils-r1_src_install
  63. }