libmygpo-qt-9999.ebuild 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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. pkg_setup() {
  37. MULTIBUILD_VARIANTS=( $(usev qt4) $(usev qt5) )
  38. if use qt5; then
  39. ewarn "Please note that Qt5 support is still experimental."
  40. ewarn "If you find anything to not work with Qt5, please report a bug."
  41. fi
  42. }
  43. src_configure() {
  44. myconfigure() {
  45. local mycmakeargs=(
  46. -DMYGPO_BUILD_TESTS=$(usex test)
  47. )
  48. if [[ ${MULTIBUILD_VARIANT} = qt4 ]]; then
  49. mycmakeargs+=(-DBUILD_WITH_QT4=ON)
  50. fi
  51. if [[ ${MULTIBUILD_VARIANT} = qt5 ]]; then
  52. mycmakeargs+=(-DBUILD_WITH_QT4=OFF)
  53. fi
  54. cmake-utils_src_configure
  55. }
  56. multibuild_foreach_variant myconfigure
  57. }
  58. src_compile() {
  59. multibuild_foreach_variant cmake-utils_src_compile
  60. }
  61. src_test() {
  62. multibuild_foreach_variant cmake-utils_src_test
  63. }
  64. src_install() {
  65. multibuild_foreach_variant cmake-utils_src_install
  66. }