mg-20160421.ebuild 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. # Copyright 1999-2017 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=6
  4. inherit toolchain-funcs
  5. DESCRIPTION="MicroGnuEmacs, a port from the BSDs"
  6. HOMEPAGE="http://homepage.boetes.org/software/mg/"
  7. SRC_URI="http://homepage.boetes.org/software/mg/${P}.tar.gz"
  8. LICENSE="public-domain"
  9. SLOT="0"
  10. KEYWORDS="alpha amd64 arm hppa ppc ~ppc64 sparc x86 ~amd64-fbsd ~x86-fbsd"
  11. IUSE="livecd"
  12. RDEPEND="sys-libs/ncurses:0
  13. !elibc_FreeBSD? ( >=dev-libs/libbsd-0.7.0 )"
  14. DEPEND="${RDEPEND}
  15. virtual/pkgconfig"
  16. src_prepare() {
  17. # remove OpenBSD specific easter egg
  18. sed -i -e 's/theo\.o//' GNUmakefile || die
  19. sed -i -e '/theo_init/d' main.c || die
  20. # fix path to tutorial in man page
  21. sed -i -e "s:doc/mg/:doc/${PF}/:" mg.1 || die
  22. eapply_user
  23. }
  24. src_compile() {
  25. emake CC="$(tc-getCC)" \
  26. CFLAGS="${CFLAGS}" \
  27. CURSES_LIBS="$("$(tc-getPKG_CONFIG)" --libs ncurses)"
  28. }
  29. src_install() {
  30. dobin mg
  31. doman mg.1
  32. dodoc README tutorial
  33. # don't compress the tutorial, otherwise mg cannot open it
  34. docompress -x /usr/share/doc/${PF}/tutorial
  35. }
  36. pkg_postinst() {
  37. if use livecd; then
  38. [[ -e ${EROOT}/usr/bin/emacs ]] || ln -s mg "${EROOT}"/usr/bin/emacs
  39. fi
  40. }