xdvik-22.87.ebuild 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. # Copyright 1999-2017 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  4. inherit eutils flag-o-matic elisp-common toolchain-funcs multilib
  5. DESCRIPTION="DVI previewer for X Window System"
  6. HOMEPAGE="http://xdvi.sourceforge.net/"
  7. SRC_URI="mirror://sourceforge/xdvi/${P}.tar.gz"
  8. KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~x64-solaris ~x86-solaris"
  9. SLOT="0"
  10. LICENSE="GPL-2"
  11. IUSE="motif neXt Xaw3d emacs"
  12. RDEPEND="media-libs/freetype:2
  13. x11-libs/libXi
  14. x11-libs/libXmu
  15. x11-libs/libXp
  16. x11-libs/libXpm
  17. motif? ( >=x11-libs/motif-2.3:0 )
  18. !motif? (
  19. neXt? ( x11-libs/neXtaw )
  20. !neXt? (
  21. Xaw3d? ( x11-libs/libXaw3d )
  22. !Xaw3d? ( x11-libs/libXaw )
  23. )
  24. )
  25. dev-libs/kpathsea"
  26. DEPEND="sys-devel/flex
  27. virtual/yacc
  28. virtual/pkgconfig
  29. ${RDEPEND}"
  30. RDEPEND="${RDEPEND}
  31. virtual/latex-base
  32. !<app-text/texlive-2007"
  33. S=${WORKDIR}/${P}/texk/xdvik
  34. src_prepare() {
  35. local i
  36. epatch "${FILESDIR}"/${P}-xaw3d.patch
  37. # Make sure system kpathsea headers are used
  38. cd "${WORKDIR}/${P}/texk/kpathsea"
  39. for i in *.h ; do echo "#include_next \"$i\"" > $i; done
  40. }
  41. src_configure() {
  42. has_version '>=dev-libs/kpathsea-6.2.1' && append-cppflags "$($(tc-getPKG_CONFIG) --cflags kpathsea)"
  43. local toolkit
  44. if use motif ; then
  45. toolkit="motif"
  46. use neXt && ewarn "neXt USE flag ignored (superseded by motif)"
  47. use Xaw3d && ewarn "Xaw3d USE flag ignored (superseded by motif)"
  48. elif use neXt ; then
  49. toolkit="neXtaw"
  50. use Xaw3d && ewarn "Xaw3d USE flag ignored (superseded by neXt)"
  51. elif use Xaw3d ; then
  52. toolkit="xaw3d"
  53. else
  54. toolkit="xaw"
  55. fi
  56. econf \
  57. --with-system-freetype2 \
  58. --with-system-kpathsea \
  59. --with-kpathsea-include="${EPREFIX}"/usr/include/kpathsea \
  60. --with-xdvi-x-toolkit="${toolkit}" \
  61. --x-includes="${EPREFIX}"/usr/include \
  62. --x-libraries="${EPREFIX}"/usr/$(get_libdir)
  63. }
  64. src_compile() {
  65. emake kpathsea_dir="${EPREFIX}/usr/include/kpathsea"
  66. use emacs && elisp-compile xdvi-search.el
  67. }
  68. src_install() {
  69. dodir /usr/share/texmf-dist/dvips/config
  70. emake DESTDIR="${D}" install
  71. dosym /usr/share/texmf-dist/xdvi/XDvi /usr/share/X11/app-defaults/XDvi
  72. dodoc BUGS FAQ README.*
  73. use emacs && elisp-install tex-utils *.el *.elc
  74. doicon "${FILESDIR}"/${PN}.xpm
  75. make_desktop_entry xdvi "XDVI" xdvik "Graphics;Viewer"
  76. echo "MimeType=application/x-dvi;" >> "${ED}"usr/share/applications/xdvi-"${PN}".desktop
  77. }
  78. pkg_postinst() {
  79. if use emacs; then
  80. elog "Add"
  81. elog " (add-to-list 'load-path \"${EPREFIX}${SITELISP}/tex-utils\")"
  82. elog " (require 'xdvi-search)"
  83. elog "to your ~/.emacs file"
  84. fi
  85. }