xdvik-22.85-r1.ebuild 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. # Copyright 1999-2017 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=4
  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/t1lib-5.0.2
  13. x11-libs/libXmu
  14. x11-libs/libXp
  15. x11-libs/libXpm
  16. motif? ( >=x11-libs/motif-2.3:0 )
  17. !motif? (
  18. neXt? ( x11-libs/neXtaw )
  19. !neXt? (
  20. Xaw3d? ( x11-libs/libXaw3d )
  21. !Xaw3d? ( x11-libs/libXaw )
  22. )
  23. )
  24. dev-libs/kpathsea"
  25. DEPEND="sys-devel/flex
  26. virtual/yacc
  27. ${RDEPEND}"
  28. RDEPEND="${RDEPEND}
  29. virtual/latex-base
  30. !<app-text/texlive-2007"
  31. TEXMF_PATH=/usr/share/texmf
  32. S=${WORKDIR}/${P}/texk/xdvik
  33. src_prepare() {
  34. epatch "${FILESDIR}/${P}-mksedscript.patch" \
  35. "${FILESDIR}/${P}-mksedscript_gentoo.patch"
  36. # Make sure system kpathsea headers are used
  37. cd "${WORKDIR}/${P}/texk/kpathsea"
  38. for i in *.h ; do echo "#include_next \"$i\"" > $i; done
  39. }
  40. src_configure() {
  41. local toolkit
  42. if use motif ; then
  43. toolkit="motif"
  44. use neXt && ewarn "neXt USE flag ignored (superseded by motif)"
  45. use Xaw3d && ewarn "Xaw3d USE flag ignored (superseded by motif)"
  46. elif use neXt ; then
  47. toolkit="neXtaw"
  48. use Xaw3d && ewarn "Xaw3d USE flag ignored (superseded by neXt)"
  49. elif use Xaw3d ; then
  50. toolkit="xaw3d"
  51. else
  52. toolkit="xaw"
  53. fi
  54. econf \
  55. --with-system-t1lib \
  56. --with-system-kpathsea \
  57. --with-kpathsea-include="${EPREFIX}"/usr/include/kpathsea \
  58. --with-xdvi-x-toolkit="${toolkit}" \
  59. --x-includes="${EPREFIX}"/usr/include \
  60. --x-libraries="${EPREFIX}"/usr/$(get_libdir)
  61. }
  62. src_compile() {
  63. emake kpathsea_dir="${EPREFIX}/usr/include/kpathsea" texmf="${EPREFIX}${TEXMF_PATH}"
  64. use emacs && elisp-compile xdvi-search.el
  65. }
  66. src_install() {
  67. emake DESTDIR="${D}" install
  68. dodir /etc/texmf/xdvi /usr/share/X11/app-defaults
  69. mv "${ED}${TEXMF_PATH}/xdvi/XDvi" "${ED}usr/share/X11/app-defaults" || die "failed to move config file"
  70. dosym {/usr/share/X11/app-defaults,"${TEXMF_PATH}/xdvi"}/XDvi
  71. for i in $(find "${ED}${TEXMF_PATH}/xdvi" -maxdepth 1 -type f) ; do
  72. mv ${i} "${ED}etc/texmf/xdvi" || die "failed to move $i"
  73. dosym {/etc/texmf,"${TEXMF_PATH}"}/xdvi/$(basename ${i})
  74. done
  75. dodoc BUGS FAQ README.*
  76. use emacs && elisp-install tex-utils *.el *.elc
  77. doicon "${FILESDIR}"/${PN}.xpm
  78. make_desktop_entry xdvi "XDVI" xdvik "Graphics;Viewer"
  79. echo "MimeType=application/x-dvi;" >> "${ED}"usr/share/applications/xdvi-"${PN}".desktop
  80. }
  81. pkg_postinst() {
  82. if use emacs; then
  83. elog "Add"
  84. elog " (add-to-list 'load-path \"${EPREFIX}${SITELISP}/tex-utils\")"
  85. elog " (require 'xdvi-search)"
  86. elog "to your ~/.emacs file"
  87. fi
  88. }