libmygpo-qt-1.0.9.ebuild 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. # Copyright 1999-2016 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=6
  4. inherit cmake-utils multibuild
  5. DESCRIPTION="Qt/C++ library wrapping the gpodder.net webservice"
  6. HOMEPAGE="http://wiki.gpodder.org/wiki/Libmygpo-qt"
  7. if [[ ${PV} == *9999* ]]; then
  8. EGIT_REPO_URI="https://github.com/gpodder/libmygpo-qt.git"
  9. inherit git-r3
  10. else
  11. SRC_URI="https://github.com/gpodder/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
  12. KEYWORDS="amd64 x86"
  13. fi
  14. LICENSE="LGPL-2.1"
  15. SLOT="0"
  16. IUSE="+qt4 qt5 test"
  17. REQUIRED_USE="|| ( qt4 qt5 )"
  18. RDEPEND="
  19. qt4? (
  20. >=dev-libs/qjson-0.5[qt4(+)]
  21. dev-qt/qtcore:4
  22. )
  23. qt5? (
  24. dev-qt/qtcore:5
  25. dev-qt/qtnetwork:5
  26. )
  27. "
  28. DEPEND="${RDEPEND}
  29. virtual/pkgconfig
  30. test? (
  31. qt4? ( dev-qt/qttest:4 )
  32. qt5? ( dev-qt/qttest:5 )
  33. )
  34. "
  35. DOCS=( AUTHORS README )
  36. PATCHES=( ${FILESDIR}/${PN}-1.0.8-fix-JsonCreatorTest-failure.patch )
  37. pkg_setup() {
  38. MULTIBUILD_VARIANTS=( $(usev qt4) $(usev qt5) )
  39. if use qt5; then
  40. ewarn "Please note that Qt5 support is still experimental."
  41. ewarn "If you find anything to not work with Qt5, please report a bug."
  42. fi
  43. }
  44. src_configure() {
  45. myconfigure() {
  46. local mycmakeargs=(
  47. -DMYGPO_BUILD_TESTS=$(usex test)
  48. )
  49. if [[ ${MULTIBUILD_VARIANT} = qt4 ]]; then
  50. mycmakeargs+=(-DBUILD_WITH_QT4=ON)
  51. fi
  52. if [[ ${MULTIBUILD_VARIANT} = qt5 ]]; then
  53. mycmakeargs+=(-DBUILD_WITH_QT4=OFF)
  54. fi
  55. cmake-utils_src_configure
  56. }
  57. multibuild_foreach_variant myconfigure
  58. }
  59. src_compile() {
  60. multibuild_foreach_variant cmake-utils_src_compile
  61. }
  62. src_test() {
  63. multibuild_foreach_variant cmake-utils_src_test
  64. }
  65. src_install() {
  66. multibuild_foreach_variant cmake-utils_src_install
  67. }