autojump-22.2.4-r4.ebuild 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. # Copyright 1999-2016 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  4. PYTHON_COMPAT=( python{2_7,3_4} )
  5. inherit bash-completion-r1 python-r1 vcs-snapshot
  6. DESCRIPTION="change directory command that learns"
  7. HOMEPAGE="https://github.com/joelthelion/autojump"
  8. SRC_URI="https://github.com/joelthelion/${PN}/archive/release-v${PV}.tar.gz -> ${P}.tar.gz"
  9. LICENSE="GPL-3"
  10. SLOT="0"
  11. KEYWORDS="amd64 ~ppc ~ppc64 x86"
  12. IUSE="ipython test"
  13. # Not all tests pass. Need investigation.
  14. RESTRICT="test"
  15. RDEPEND="ipython? ( ${PYTHON_DEPS} )"
  16. DEPEND="test? ( dev-python/flake8 dev-python/tox )"
  17. PATCHES=(
  18. "${FILESDIR}/${P}-fix-autojump.fish-bugs.patch"
  19. "${FILESDIR}/${P}-fix-__aj_error-typo.patch"
  20. )
  21. src_prepare() {
  22. sed -e "s: \(/etc/profile.d\): \"${EPREFIX}\1\":" \
  23. -e "s:/usr/local/share:/usr/share:" \
  24. -i bin/autojump.sh || die
  25. # autojump_argparse is only there for Python 2.6 compatibility
  26. sed -e "s:autojump_argparse:argparse:" \
  27. -i bin/autojump || die
  28. # upstream fixes to the autojump.fish script; the first patch is needed for
  29. # the second patch to apply
  30. epatch "${PATCHES[@]}"
  31. }
  32. src_compile() {
  33. :
  34. }
  35. src_install() {
  36. dobin bin/"${PN}"
  37. python_replicate_script "${ED}"/usr/bin/"${PN}"
  38. insinto /etc/profile.d
  39. doins bin/"${PN}".sh
  40. insinto /usr/share/"${PN}"/
  41. doins bin/"${PN}.bash"
  42. doins bin/"${PN}.zsh"
  43. doins bin/"${PN}.fish"
  44. insinto /usr/share/zsh/site-functions
  45. doins bin/_j
  46. python_foreach_impl python_domodule bin/autojump_data.py bin/autojump_utils.py
  47. if use ipython; then
  48. python_foreach_impl python_domodule tools/autojump_ipython.py
  49. fi
  50. doman docs/"${PN}.1"
  51. dodoc README.md
  52. }
  53. pkg_postinst() {
  54. if use ipython; then
  55. elog 'This tool provides "j" for ipython, please add'
  56. elog '"import autojump_ipython" to your ipy_user_conf.py.'
  57. elog
  58. fi
  59. elog 'If you use app-shells/fish, add the following code to your'
  60. elog 'config.fish to get autojump support:'
  61. elog 'if test -f /usr/share/autojump/autojump.fish'
  62. elog ' source /usr/share/autojump/autojump.fish'
  63. elog 'end'
  64. }