nano-9999.ebuild 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. # Copyright 1999-2017 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI="6"
  4. inherit eutils flag-o-matic
  5. if [[ ${PV} == "9999" ]] ; then
  6. EGIT_REPO_URI="git://git.sv.gnu.org/nano.git"
  7. inherit git-r3 autotools
  8. else
  9. MY_P=${PN}-${PV/_}
  10. SRC_URI="https://www.nano-editor.org/dist/v${PV:0:3}/${MY_P}.tar.gz"
  11. KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
  12. fi
  13. DESCRIPTION="GNU GPL'd Pico clone with more functionality"
  14. HOMEPAGE="https://www.nano-editor.org/ https://wiki.gentoo.org/wiki/Nano/Basics_Guide"
  15. LICENSE="GPL-3"
  16. SLOT="0"
  17. IUSE="debug justify +magic minimal ncurses nls slang +spell static unicode"
  18. LIB_DEPEND=">=sys-libs/ncurses-5.9-r1:0=[unicode?]
  19. sys-libs/ncurses:0=[static-libs(+)]
  20. magic? ( sys-apps/file[static-libs(+)] )
  21. nls? ( virtual/libintl )
  22. !ncurses? ( slang? ( sys-libs/slang[static-libs(+)] ) )"
  23. RDEPEND="!static? ( ${LIB_DEPEND//\[static-libs(+)]} )"
  24. DEPEND="${RDEPEND}
  25. nls? ( sys-devel/gettext )
  26. virtual/pkgconfig
  27. static? ( ${LIB_DEPEND} )"
  28. src_prepare() {
  29. if [[ ${PV} == "9999" ]] ; then
  30. eautoreconf
  31. fi
  32. default
  33. }
  34. src_configure() {
  35. use static && append-ldflags -static
  36. local myconf=()
  37. case ${CHOST} in
  38. *-gnu*|*-uclibc*) myconf+=( "--with-wordbounds" ) ;; #467848
  39. esac
  40. econf \
  41. --bindir="${EPREFIX}"/bin \
  42. --htmldir=/trash \
  43. $(use_enable !minimal color) \
  44. $(use_enable !minimal multibuffer) \
  45. $(use_enable !minimal nanorc) \
  46. --disable-wrapping-as-root \
  47. $(use_enable magic libmagic) \
  48. $(use_enable spell speller) \
  49. $(use_enable justify) \
  50. $(use_enable debug) \
  51. $(use_enable nls) \
  52. $(use_enable unicode utf8) \
  53. $(use_enable minimal tiny) \
  54. $(usex ncurses --without-slang $(use_with slang)) \
  55. "${myconf[@]}"
  56. }
  57. src_install() {
  58. default
  59. rm -rf "${D}"/trash
  60. dodoc doc/sample.nanorc
  61. docinto html
  62. dodoc doc/faq.html
  63. insinto /etc
  64. newins doc/sample.nanorc nanorc
  65. if ! use minimal ; then
  66. # Enable colorization by default.
  67. sed -i \
  68. -e '/^# include /s:# *::' \
  69. "${ED}"/etc/nanorc || die
  70. fi
  71. dodir /usr/bin
  72. dosym /bin/nano /usr/bin/nano
  73. }