pysize-0.2-r1.ebuild 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. # Copyright 1999-2015 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  4. PYTHON_COMPAT=( python2_7 pypy )
  5. inherit distutils-r1
  6. DESCRIPTION="A graphical and console tool for exploring the size of directories"
  7. HOMEPAGE="http://guichaz.free.fr/pysize/"
  8. SRC_URI="http://guichaz.free.fr/${PN}/files/${P}.tar.bz2"
  9. LICENSE="GPL-2"
  10. SLOT="0"
  11. KEYWORDS="amd64 x86 ~amd64-linux ~x86-linux"
  12. IUSE="gtk ncurses"
  13. REQUIRED_USE="${PYTHON_REQUIRED_USE}"
  14. RDEPEND="
  15. gtk? ( dev-python/pygtk:2 )
  16. ncurses? ( sys-libs/ncurses:0= )"
  17. DEPEND="${RDEPEND}
  18. dev-python/setuptools[${PYTHON_USEDEP}]"
  19. PATCHES=(
  20. "${FILESDIR}"/psyco-${PV}-automagic.patch
  21. "${FILESDIR}"/${PV}-setuptools-automagic.patch
  22. )
  23. python_prepare_all() {
  24. if ! use gtk; then
  25. sed \
  26. -e '/^from pysize.ui.gtk/d' \
  27. -e "s~'gtk': ui_gtk.run,~~g" \
  28. -e 's:ui_gtk.run,::g' \
  29. -i pysize/main.py || die "Failed to remove gtk support"
  30. rm -rf pysize/ui/gtk || die "Failed to remove gtk support"
  31. fi
  32. if ! use ncurses; then
  33. sed \
  34. -e '/^from pysize.ui.curses/d' \
  35. -e "s~'curses': ui_curses.run,~~g" \
  36. -e 's:ui_curses.run,::g' \
  37. -i pysize/main.py || die "Failed to remove ncurses support"
  38. rm -rf pysize/ui/curses || die "Failed to remove ncurses support"
  39. fi
  40. sed \
  41. -e '/for ui_run in/s:ui_ascii.run:ui_ascii.run, ui_ascii.run:g' \
  42. -i pysize/main.py || die
  43. distutils-r1_python_prepare_all
  44. }
  45. python_test() {
  46. pushd "${S}"/tests > /dev/null
  47. PYTHONPATH=.:../ "${PYTHON}" pysize_tests.py || die "tests failed under ${EPYTHON}"
  48. popd > /dev/null
  49. }