nvi-1.81.6-r4.ebuild 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. # Copyright 1999-2015 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=4
  4. inherit autotools db-use eutils flag-o-matic
  5. DBVERS="4.8.30 4.7 4.6 4.5 4.4 4.3 4.2"
  6. DBSLOTS=
  7. DBDEPENDS=
  8. for DBVER in ${DBVERS}
  9. do
  10. if [[ ${DBVER} = *.*.* ]]; then
  11. DBSLOTS="${DBSLOTS} ${DBVER%.*}"
  12. DBDEPENDS="${DBDEPENDS} >=sys-libs/db-${DBVER}:${DBVER%.*}"
  13. else
  14. DBSLOTS="${DBSLOTS} ${DBVER}"
  15. DBDEPENDS="${DBDEPENDS} sys-libs/db:${DBVER}"
  16. fi
  17. done
  18. DESCRIPTION="Vi clone"
  19. HOMEPAGE="https://sites.google.com/a/bostic.com/keithbostic/vi"
  20. SRC_URI="http://garage.linux.student.kuleuven.be/~skimo/nvi/devel/${P}.tar.bz2"
  21. LICENSE="BSD"
  22. SLOT="0"
  23. KEYWORDS="alpha amd64 hppa ~mips ppc ppc64 sparc x86"
  24. IUSE="perl tcl unicode"
  25. CDEPEND="|| ( ${DBDEPENDS} )
  26. >=sys-libs/ncurses-5.6-r2
  27. perl? ( dev-lang/perl )
  28. tcl? ( !unicode? ( >=dev-lang/tcl-8.5:0 ) )"
  29. DEPEND="${CDEPEND}
  30. virtual/pkgconfig"
  31. RDEPEND="${CDEPEND}
  32. app-eselect/eselect-vi"
  33. REQUIRED_USE="tcl? ( !unicode )"
  34. src_prepare() {
  35. epatch "${FILESDIR}"/${P}-db44.patch
  36. epatch "${FILESDIR}"/${P}-db.patch
  37. epatch "${FILESDIR}"/${P}-perl-as-needed.patch
  38. epatch "${FILESDIR}"/${P}-perl-shortnames.patch
  39. epatch "${FILESDIR}"/${P}-ac_config_header.patch
  40. epatch "${FILESDIR}"/${P}-use_pkgconfig_for_ncurses.patch
  41. cd dist || die
  42. chmod +x findconfig || die
  43. append-cppflags -I"$(db_includedir ${DBSLOTS})"
  44. sed -i -e "s@-ldb@-l$(db_libname ${DBSLOTS})@" configure.in || die
  45. rm -f configure || die
  46. eautoreconf -Im4
  47. }
  48. src_configure() {
  49. local myconf
  50. use perl && myconf="${myconf} --enable-perlinterp"
  51. use unicode && myconf="${myconf} --enable-widechar"
  52. use tcl && ! use unicode && myconf="${myconf} --enable-tclinterp"
  53. append-cppflags '-D_PATH_MSGCAT="\"/usr/share/vi/catalog/\""'
  54. pushd dist 2>/dev/null
  55. econf \
  56. --program-prefix=n \
  57. ${myconf} \
  58. || die "configure failed"
  59. popd 2>/dev/null
  60. }
  61. src_compile() {
  62. pushd dist 2>/dev/null
  63. emake || die "make failed"
  64. popd 2>/dev/null
  65. }
  66. src_install() {
  67. pushd dist 2>/dev/null
  68. emake -j1 DESTDIR="${D}" install || die "install failed"
  69. popd 2>/dev/null
  70. }
  71. pkg_postinst() {
  72. einfo "Setting /usr/bin/vi symlink"
  73. eselect vi update --if-unset
  74. }
  75. pkg_postrm() {
  76. einfo "Updating /usr/bin/vi symlink"
  77. eselect vi update --if-unset
  78. }