mp-5.2.2.ebuild 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. # Copyright 1999-2017 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=4
  4. inherit eutils toolchain-funcs
  5. DESCRIPTION="Minimum Profit: A text editor for programmers"
  6. HOMEPAGE="http://www.triptico.com/software/mp.html"
  7. SRC_URI="http://www.triptico.com/download/${P}.tar.gz"
  8. LICENSE="GPL-2"
  9. SLOT="0"
  10. KEYWORDS="alpha amd64 ia64 ppc ppc64 sparc x86 ~ppc-macos ~sparc-solaris ~x86-solaris"
  11. IUSE="gtk iconv kde ncurses nls pcre qt4"
  12. MP_LINGUAS="de es it nl ru sv"
  13. for mp_lingua in ${MP_LINGUAS}; do
  14. IUSE+=" linguas_${mp_lingua}"
  15. done
  16. RDEPEND="
  17. ncurses? ( sys-libs/ncurses )
  18. gtk? (
  19. || ( x11-libs/gtk+:3 x11-libs/gtk+:2 )
  20. >=x11-libs/pango-1.8.0
  21. dev-libs/atk
  22. dev-libs/glib
  23. media-libs/fontconfig
  24. media-libs/freetype
  25. x11-libs/cairo
  26. )
  27. !gtk? ( sys-libs/ncurses )
  28. app-text/grutatxt
  29. iconv? ( virtual/libiconv )
  30. nls? ( sys-devel/gettext )
  31. pcre? ( dev-libs/libpcre )
  32. "
  33. DEPEND="
  34. ${RDEPEND}
  35. app-text/grutatxt
  36. virtual/pkgconfig
  37. dev-lang/perl
  38. "
  39. src_prepare() {
  40. epatch \
  41. "${FILESDIR}"/${P}-gtk+.patch \
  42. "${FILESDIR}"/${PN}-5.2.1-prll.patch
  43. local mp_lingua
  44. for mp_lingua in ${MP_LINGUAS}; do
  45. if ! use linguas_${mp_lingua}; then
  46. rm po/${mp_lingua/linguas_/}.[mp]o || die
  47. fi
  48. done
  49. [[ $(ls po 2> /dev/null) ]] || \
  50. sed \
  51. -e '/^all/s:$(BUILDMO)::g' \
  52. -e '/^install/s:$(INSTALLMO)::g' \
  53. -i makefile.in || die
  54. }
  55. src_configure() {
  56. local myconf="--prefix=${EPREFIX}/usr --without-win32"
  57. if use gtk; then
  58. ! use ncurses && myconf="${myconf} --without-curses"
  59. else
  60. myconf="${myconf} --without-gtk2"
  61. fi
  62. use iconv || myconf="${myconf} --without-iconv"
  63. use kde || myconf="${myconf} --without-kde4"
  64. use nls || myconfig="${myconf} --without-gettext"
  65. myconf="${myconf} $(use_with pcre)"
  66. use pcre || myconf="${myconf} --with-included-regex"
  67. use qt4 || myconf="${myconf} --without-qt4"
  68. tc-export AR CC
  69. sh config.sh ${myconf} || die "Configure failed"
  70. for i in "${S}" "${S}"/mpsl "${S}"/mpdm;do
  71. echo ${CFLAGS} >> $i/config.cflags
  72. echo ${CFLAGS} >> $i/config.ldflags
  73. echo ${LDFLAGS} >> $i/config.ldflags
  74. done
  75. }
  76. src_compile() {
  77. emake CPP="$(tc-getCXX)" CCLINK="$(tc-getCXX)"
  78. }
  79. src_install() {
  80. dodir /usr/bin
  81. sh config.sh --prefix="${EPREFIX}/usr"
  82. emake DESTDIR="${D}" install
  83. }