tortoisehg-4.1.1.ebuild 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. # Copyright 1999-2017 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=6
  4. PYTHON_COMPAT=( python2_7 )
  5. inherit distutils-r1 eutils
  6. if [[ ${PV} != *9999* ]]; then
  7. KEYWORDS="~amd64 ~x86"
  8. SRC_URI="https://www.bitbucket.org/${PN}/targz/downloads/${P}.tar.gz"
  9. HG_DEPEND=">=dev-vcs/mercurial-4.0 <dev-vcs/mercurial-4.2"
  10. else
  11. inherit mercurial
  12. EHG_REPO_URI="https://bitbucket.org/tortoisehg/thg"
  13. EHG_REVISION="stable"
  14. KEYWORDS=""
  15. SRC_URI=""
  16. HG_DEPEND="dev-vcs/mercurial"
  17. fi
  18. DESCRIPTION="Set of graphical tools for Mercurial"
  19. HOMEPAGE="https://tortoisehg.bitbucket.org"
  20. LICENSE="GPL-2"
  21. SLOT="0"
  22. IUSE="doc"
  23. RDEPEND="${HG_DEPEND}
  24. dev-python/iniparse[${PYTHON_USEDEP}]
  25. dev-python/pygments[${PYTHON_USEDEP}]
  26. dev-python/PyQt4[svg,${PYTHON_USEDEP}]
  27. dev-python/qscintilla-python[qt4(+),${PYTHON_USEDEP}]"
  28. DEPEND="${RDEPEND}
  29. doc? ( >=dev-python/sphinx-1.0.3 )"
  30. # Workaround race condition in build_qt
  31. DISTUTILS_IN_SOURCE_BUILD=1
  32. python_prepare_all() {
  33. if [[ ${LINGUAS+set} ]]; then
  34. cd i18n/tortoisehg || die
  35. local x y keep
  36. for x in *.po; do
  37. keep=false
  38. for y in ${LINGUAS}; do
  39. if [[ ${y} == ${x%.po}* ]]; then
  40. keep=true
  41. break
  42. fi
  43. done
  44. ${keep} || rm "${x}" || die
  45. done
  46. cd "${S}" || die
  47. fi
  48. distutils-r1_python_prepare_all
  49. }
  50. python_compile_all() {
  51. use doc && emake -C doc html
  52. }
  53. python_install_all() {
  54. distutils-r1_python_install_all
  55. dodoc doc/ReadMe*.txt doc/TODO contrib/mergetools.rc
  56. if use doc ; then
  57. docinto html
  58. dodoc -r doc/build/html/
  59. fi
  60. newicon -s scalable icons/scalable/apps/thg.svg thg_logo.svg
  61. domenu contrib/thg.desktop
  62. # Remove file that collides with >=mercurial-4.0 (bug #599266).
  63. rm "${ED}"/usr/$(get_libdir)/${EPYTHON}/site-packages/hgext3rd/__init__.py \
  64. || die
  65. }
  66. pkg_postinst() {
  67. elog "When startup of ${PN} fails with an API version mismatch error"
  68. elog "between dev-python/sip and dev-python/PyQt4 please rebuild"
  69. elog "dev-python/qscintilla-python."
  70. }