summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2015-08-08 13:49:04 -0700
committerRobin H. Johnson <robbat2@gentoo.org>2015-08-08 17:38:18 -0700
commit56bd759df1d0c750a065b8c845e93d5dfa6b549d (patch)
tree3f91093cdb475e565ae857f1c5a7fd339e2d781e /app-text/xdvik
downloadgentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.gz
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.bz2
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.zip
proj/gentoo: Initial commit
This commit represents a new era for Gentoo: Storing the gentoo-x86 tree in Git, as converted from CVS. This commit is the start of the NEW history. Any historical data is intended to be grafted onto this point. Creation process: 1. Take final CVS checkout snapshot 2. Remove ALL ChangeLog* files 3. Transform all Manifests to thin 4. Remove empty Manifests 5. Convert all stale $Header$/$Id$ CVS keywords to non-expanded Git $Id$ 5.1. Do not touch files with -kb/-ko keyword flags. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> X-Thanks: Alec Warner <antarus@gentoo.org> - did the GSoC 2006 migration tests X-Thanks: Robin H. Johnson <robbat2@gentoo.org> - infra guy, herding this project X-Thanks: Nguyen Thai Ngoc Duy <pclouds@gentoo.org> - Former Gentoo developer, wrote Git features for the migration X-Thanks: Brian Harring <ferringb@gentoo.org> - wrote much python to improve cvs2svn X-Thanks: Rich Freeman <rich0@gentoo.org> - validation scripts X-Thanks: Patrick Lauer <patrick@gentoo.org> - Gentoo dev, running new 2014 work in migration X-Thanks: Michał Górny <mgorny@gentoo.org> - scripts, QA, nagging X-Thanks: All of other Gentoo developers - many ideas and lots of paint on the bikeshed
Diffstat (limited to 'app-text/xdvik')
-rw-r--r--app-text/xdvik/Manifest3
-rw-r--r--app-text/xdvik/files/xdvik-22.85-mksedscript.patch15
-rw-r--r--app-text/xdvik/files/xdvik-22.85-mksedscript_gentoo.patch20
-rw-r--r--app-text/xdvik/files/xdvik-22.87-xaw3d.patch22
-rw-r--r--app-text/xdvik/files/xdvik.xpm89
-rw-r--r--app-text/xdvik/metadata.xml13
-rw-r--r--app-text/xdvik/xdvik-22.85-r1.ebuild104
-rw-r--r--app-text/xdvik/xdvik-22.86.ebuild97
-rw-r--r--app-text/xdvik/xdvik-22.87.ebuild103
9 files changed, 466 insertions, 0 deletions
diff --git a/app-text/xdvik/Manifest b/app-text/xdvik/Manifest
new file mode 100644
index 000000000000..fb266ac326b5
--- /dev/null
+++ b/app-text/xdvik/Manifest
@@ -0,0 +1,3 @@
+DIST xdvik-22.85.tar.gz 4128828 SHA256 91f08103e53ab46efc83053e648bdd07aa100043233dadcb7384efc83fa2dde8 SHA512 9220bac0dea21d617b4ea7129ca8133fd447fb1adc26c699970cae7d3e168e32f4745b0936d18d8f769f3926c526e085f0c92a4d99d5faff8301e3c4ebc297b5 WHIRLPOOL 57ffc2d6a326b754b63aed54836c05b2e9431b01faba6d9bdc347b07094a62a7569d7746f556366b282808cc93a41a81cbda4fd82cdf4972133f8addc74e4e75
+DIST xdvik-22.86.tar.gz 4412419 SHA256 a3dffb8d878e6039ebc168d3bd82d194912dac53177673f818d0baac2dc27203 SHA512 f2cf15b8f94ae1a43b749fc9355eac1b427a41d690299ad4a221d51ef21eb0adcf6986c13f03d8c681e6cc2522229a2843b5c6f1ad359c5f0a28933e6d11c8eb WHIRLPOOL 8031f1ddc0eb8de415446752c07c0b7a22f35ffcd6f44a2b025cdb1bf1593bbe37306da5c93d620fe9f00b14fd6fc061c0f432afd7294ccf774e5e4e4fbd8f9d
+DIST xdvik-22.87.tar.gz 4600576 SHA256 920a20928b4360a1ab83843cffb98c129a54c6462ee014d0e5c4b209b8840ea7 SHA512 cb0c15e88ce42b25cd5edfc8fb84a8afdcc821a6444ba1c5f9f1365a7f62e57cbf37729b276de033b4abfd0f6fe32fa5789f6efd5a0c042e1195c4dc971c8b9f WHIRLPOOL 06ff8d6920ece92d711a432ed19998290f7bda30ad545b3c2bceb505f0fa3a03d680d6694f60a49c44d1b13b1429b45f6c451ec3f0d8f2723b74190065fc9417
diff --git a/app-text/xdvik/files/xdvik-22.85-mksedscript.patch b/app-text/xdvik/files/xdvik-22.85-mksedscript.patch
new file mode 100644
index 000000000000..356b2f1246e4
--- /dev/null
+++ b/app-text/xdvik/files/xdvik-22.85-mksedscript.patch
@@ -0,0 +1,15 @@
+Index: texk/xdvik/mksedscript
+===================================================================
+--- texk/xdvik/mksedscript (revision 25824)
++++ texk/xdvik/mksedscript (revision 25826)
+@@ -43,7 +43,9 @@
+
+ # Get arguments from c-auto.h
+
+-eval "`awk '/^#define/ { print "mk_"$2"="$3 }' c-auto.h`"
++eval "`awk '/^#define/ { printf "mk_%s=%s", $2, $3
++ for (i = 4; i <= NF; i++) printf " %s", $i
++ print "" }' c-auto.h`"
+
+ # eval "`cat c-auto.h \
+ # | grep '^[ ]*#[ ]*define[ ]' \
diff --git a/app-text/xdvik/files/xdvik-22.85-mksedscript_gentoo.patch b/app-text/xdvik/files/xdvik-22.85-mksedscript_gentoo.patch
new file mode 100644
index 000000000000..69873731dd4e
--- /dev/null
+++ b/app-text/xdvik/files/xdvik-22.85-mksedscript_gentoo.patch
@@ -0,0 +1,20 @@
+This used to eval something like:
+foo=char **
+so, the first match to * would be executed
+causing: https://bugs.gentoo.org/show_bug.cgi?id=410695
+
+remove the quotes and quote again so that we always get foo="char **"
+
+Index: xdvik-22.85/texk/xdvik/mksedscript
+===================================================================
+--- xdvik-22.85.orig/texk/xdvik/mksedscript
++++ xdvik-22.85/texk/xdvik/mksedscript
+@@ -45,7 +45,7 @@ done
+
+ eval "`awk '/^#define/ { printf "mk_%s=%s", $2, $3
+ for (i = 4; i <= NF; i++) printf " %s", $i
+- print "" }' c-auto.h`"
++ print "" }' c-auto.h | tr -d '"' |sed -e 's/\(.*\)=\(.*\)$/\1="\2"/'`"
+
+ # eval "`cat c-auto.h \
+ # | grep '^[ ]*#[ ]*define[ ]' \
diff --git a/app-text/xdvik/files/xdvik-22.87-xaw3d.patch b/app-text/xdvik/files/xdvik-22.87-xaw3d.patch
new file mode 100644
index 000000000000..79e7893a19b8
--- /dev/null
+++ b/app-text/xdvik/files/xdvik-22.87-xaw3d.patch
@@ -0,0 +1,22 @@
+diff --git a/events.c b/events.c
+index dbb46f0..f9990f9 100644
+--- a/events.c
++++ b/events.c
+@@ -5311,7 +5311,7 @@ xi2_emulate_action(struct xdvi_action *actp, struct xi2_valinfo *valinfo,
+ }
+
+ if (actp->proc == Act_wheel) {
+-# if XAW
++# if !MOTIF
+ if (globals.widgets.y_bar != NULL)
+ XtCallCallbacks(globals.widgets.y_bar, XtNscrollProc,
+ cast_int_to_XtPointer(dist));
+@@ -5322,7 +5322,7 @@ xi2_emulate_action(struct xdvi_action *actp, struct xi2_valinfo *valinfo,
+ # endif /* MOTIF */
+ }
+ else { /* Act_hwheel */
+-# if XAW
++# if !MOTIF
+ if (globals.widgets.x_bar != NULL)
+ XtCallCallbacks(globals.widgets.x_bar, XtNscrollProc,
+ cast_int_to_XtPointer(dist));
diff --git a/app-text/xdvik/files/xdvik.xpm b/app-text/xdvik/files/xdvik.xpm
new file mode 100644
index 000000000000..456335ec52e1
--- /dev/null
+++ b/app-text/xdvik/files/xdvik.xpm
@@ -0,0 +1,89 @@
+/* XPM */
+static char *xdvik[] = {
+/* columns rows colors chars-per-pixel */
+"48 48 35 1 ",
+" c #080808",
+". c #2F261C",
+"X c #343434",
+"o c #3C3B3C",
+"O c #493415",
+"+ c #523611",
+"@ c #64471A",
+"# c #6D4E1E",
+"$ c #65513A",
+"% c #444444",
+"& c #4C4C4C",
+"* c #505050",
+"= c #665641",
+"- c #696159",
+"; c #626262",
+": c #7D7D7D",
+"> c #946924",
+", c #8D7757",
+"< c #8F7C5A",
+"1 c #B78833",
+"2 c #D59E39",
+"3 c #D7A03A",
+"4 c #9F896C",
+"5 c #E9B345",
+"6 c #EBB345",
+"7 c #FDC54E",
+"8 c #808080",
+"9 c #848484",
+"0 c #9C9C9B",
+"q c #A9A5A2",
+"w c #C7BFB5",
+"e c #DAD6D1",
+"r c #EFEEEE",
+"t c #FEFEFE",
+"y c None",
+/* pixels */
+"9 XyyyyyyyyyyyyyyyyyyyyyyyyyyyyyX Xyy",
+"y8 yyyyyyyyyyyyyyyyyyyyyyyyyyy oyyy",
+"yyo XyyyyyyyyyyyyyyyyyyyyyyyyyX yyyy",
+"yyyX :yyyyy yy yyy yyyy* yyyyy",
+"yyyy yyyy >777 y 77 y 77 y+9 9yyyyy",
+"yyyyy Xyyy 77.#7 777 y 77 =yyyyyy",
+"yyyyy8 *yyy 6#.77 777 77 7 77 7 y yyy",
+"yyyyyyX yyyy 6>#7 77 77 77 7 6 66 yy",
+"yyyyyyy yyy4 77777777 77 777+66 66 yy",
+"yyyyyyyy Xyy++++177777777 777+7 66 6 y",
+"yyyyyyyyX ;+qtte+73777777771+7 76 y",
+"yyyyyyyyy +qtttt+4+++17777771 166> yy",
+"yyyyyyyyyy +t4.tw+wtte+177771 77777 +yy",
+"yyyyyyyyyyy .++#+t..4+etttte+7773 77>+>7 7 y",
+"yyyyyyyyyy>+O@137776+ew++etttttt+777 71# 37 6 y",
+"yyyyyyyy>>77777777771+++,ttteetw+77777 17 66 y",
+"yyyyyyy>777777777777773>-tte..r+37773 +177 1 >y",
+"yyyyyy>77>>3777777777773+ete..-+777777777 1666+y",
+"yyyyy> 7>7777777777777771+etee+777777 17 676+",
+"yyyyy76 777>37777777777773++++77777777777777 y",
+"yyyyy1>++7>7777 >3777777777777777777777 777 -",
+"yyyyy66# #777 377777777777777777777777777 777 ",
+"yyyyy666 #77777777777777777777777 77777 7 y",
+"yyyyyy6>+> 66 7777777777777777777777 7777 yyy",
+"yyyyyy 6>77 66 17777777777777777777777 777 yy",
+"yyyyyy7. 7777 1777777777777+77777777777777 7 y",
+"yyyyyy377 7777777777777777+ 77777 77777777 7#y",
+"yyyyyyy177 77777777777777+ 77777777 7777777 -",
+"yyyyyyyy777 +37777777777+ 777777 7777 777777 y",
+"yyyyyyyy1777# >777777+ +7777777+ 777777 7 yy",
+"yyyyyyyyy177777 77777+77777 777777 7yy",
+"yyyyyyyyyyy177777777777777777 777777 777777 +y",
+"yyyyyyyyyyyyy<37777777777777 +7777 77 777777 y",
+"yyyyyyyyyyyyy9 37737777 77 7777 77+77 $y",
+"yyyyyyyyyyyy9 X#7#7+7+yyX 6+77 777 777+7 yy",
+"yyyyyyyyyyyyX 0,#+#2+yyyyX 6+7 777 777+7 yy",
+"yyyyyyyyyyy; 9yyyyyyyyyyyy 777 77 777+7 y",
+"yyyyyyyyyy9 8yyyyyyyyyyyyyy 77 777+ yy",
+"yyyyyyyyyy %yyyyyyyyyyyyyyy8 yyy",
+"yyyyyyyyyX 9yyyyyyyyyyyyyyyyX +yyyyyy",
+"yyyyyyyy& yyyyyyyyyyyyyyyyyyy *yyyyy",
+"yyyyyyy9 8yyyyyyyyyyyyyyyyyyyy 9yyyy",
+"yyyyyyy 8yyyyyyyyyyyyyyyyyyyyyX yyyy",
+"yyyyyy %yyyyyyyyyyyyyyyyyyyyyyy Xyyy",
+"yyyyyX 9yyyyyyyyyyyyyyyyyyyyyyyy ;yy",
+"yyyy& 9yyyyyyyyyyyyyyyyyyyyyyyyyy 8y",
+"yyy8 8yyyyyyyyyyyyyyyyyyyyyyyyyyy *y",
+"yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy 9"
+};
diff --git a/app-text/xdvik/metadata.xml b/app-text/xdvik/metadata.xml
new file mode 100644
index 000000000000..1de599fc5b27
--- /dev/null
+++ b/app-text/xdvik/metadata.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>cjk</herd>
+ <herd>tex</herd>
+ <longdescription lang="en">
+ XDVIK is a dvi previewer on X with kpathsea support. It also supports
+ multibyte character rendering via Xft2 (or VFlib2).
+ </longdescription>
+ <upstream>
+ <remote-id type="sourceforge">xdvi</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/app-text/xdvik/xdvik-22.85-r1.ebuild b/app-text/xdvik/xdvik-22.85-r1.ebuild
new file mode 100644
index 000000000000..2c6864d17064
--- /dev/null
+++ b/app-text/xdvik/xdvik-22.85-r1.ebuild
@@ -0,0 +1,104 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+inherit eutils flag-o-matic elisp-common toolchain-funcs multilib
+
+DESCRIPTION="DVI previewer for X Window System"
+HOMEPAGE="http://xdvi.sourceforge.net/"
+SRC_URI="mirror://sourceforge/xdvi/${P}.tar.gz"
+
+KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 s390 sh sparc x86 ~amd64-fbsd ~x86-fbsd ~x86-freebsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~x64-solaris ~x86-solaris"
+SLOT="0"
+LICENSE="GPL-2"
+IUSE="motif neXt Xaw3d emacs"
+
+RDEPEND=">=media-libs/t1lib-5.0.2
+ x11-libs/libXmu
+ x11-libs/libXp
+ x11-libs/libXpm
+ motif? ( >=x11-libs/motif-2.3:0 )
+ !motif? (
+ neXt? ( x11-libs/neXtaw )
+ !neXt? (
+ Xaw3d? ( x11-libs/libXaw3d )
+ !Xaw3d? ( x11-libs/libXaw )
+ )
+ )
+ dev-libs/kpathsea"
+DEPEND="sys-devel/flex
+ virtual/yacc
+ ${RDEPEND}"
+RDEPEND="${RDEPEND}
+ virtual/latex-base
+ !<app-text/texlive-2007"
+TEXMF_PATH=/usr/share/texmf
+S=${WORKDIR}/${P}/texk/xdvik
+
+src_prepare() {
+ epatch "${FILESDIR}/${P}-mksedscript.patch" \
+ "${FILESDIR}/${P}-mksedscript_gentoo.patch"
+ # Make sure system kpathsea headers are used
+ cd "${WORKDIR}/${P}/texk/kpathsea"
+ for i in *.h ; do echo "#include_next \"$i\"" > $i; done
+}
+
+src_configure() {
+ local toolkit
+
+ if use motif ; then
+ toolkit="motif"
+ use neXt && ewarn "neXt USE flag ignored (superseded by motif)"
+ use Xaw3d && ewarn "Xaw3d USE flag ignored (superseded by motif)"
+ elif use neXt ; then
+ toolkit="neXtaw"
+ use Xaw3d && ewarn "Xaw3d USE flag ignored (superseded by neXt)"
+ elif use Xaw3d ; then
+ toolkit="xaw3d"
+ else
+ toolkit="xaw"
+ fi
+
+ econf \
+ --with-system-t1lib \
+ --with-system-kpathsea \
+ --with-kpathsea-include="${EPREFIX}"/usr/include/kpathsea \
+ --with-xdvi-x-toolkit="${toolkit}" \
+ --x-includes="${EPREFIX}"/usr/include \
+ --x-libraries="${EPREFIX}"/usr/$(get_libdir)
+}
+
+src_compile() {
+ emake kpathsea_dir="${EPREFIX}/usr/include/kpathsea" texmf="${EPREFIX}${TEXMF_PATH}"
+ use emacs && elisp-compile xdvi-search.el
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+
+ dodir /etc/texmf/xdvi /usr/share/X11/app-defaults
+ mv "${ED}${TEXMF_PATH}/xdvi/XDvi" "${ED}usr/share/X11/app-defaults" || die "failed to move config file"
+ dosym {/usr/share/X11/app-defaults,"${TEXMF_PATH}/xdvi"}/XDvi
+ for i in $(find "${ED}${TEXMF_PATH}/xdvi" -maxdepth 1 -type f) ; do
+ mv ${i} "${ED}etc/texmf/xdvi" || die "failed to move $i"
+ dosym {/etc/texmf,"${TEXMF_PATH}"}/xdvi/$(basename ${i})
+ done
+
+ dodoc BUGS FAQ README.*
+
+ use emacs && elisp-install tex-utils *.el *.elc
+
+ doicon "${FILESDIR}"/${PN}.xpm
+ make_desktop_entry xdvi "XDVI" xdvik "Graphics;Viewer"
+ echo "MimeType=application/x-dvi;" >> "${ED}"usr/share/applications/xdvi-"${PN}".desktop
+}
+
+pkg_postinst() {
+ if use emacs; then
+ elog "Add"
+ elog " (add-to-list 'load-path \"${EPREFIX}${SITELISP}/tex-utils\")"
+ elog " (require 'xdvi-search)"
+ elog "to your ~/.emacs file"
+ fi
+}
diff --git a/app-text/xdvik/xdvik-22.86.ebuild b/app-text/xdvik/xdvik-22.86.ebuild
new file mode 100644
index 000000000000..0d43f34381d8
--- /dev/null
+++ b/app-text/xdvik/xdvik-22.86.ebuild
@@ -0,0 +1,97 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+inherit eutils flag-o-matic elisp-common toolchain-funcs multilib
+
+DESCRIPTION="DVI previewer for X Window System"
+HOMEPAGE="http://xdvi.sourceforge.net/"
+SRC_URI="mirror://sourceforge/xdvi/${P}.tar.gz"
+
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~x86-freebsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~x64-solaris ~x86-solaris"
+SLOT="0"
+LICENSE="GPL-2"
+IUSE="motif neXt Xaw3d emacs"
+
+RDEPEND="media-libs/freetype:2
+ x11-libs/libXmu
+ x11-libs/libXp
+ x11-libs/libXpm
+ motif? ( >=x11-libs/motif-2.3:0 )
+ !motif? (
+ neXt? ( x11-libs/neXtaw )
+ !neXt? (
+ Xaw3d? ( x11-libs/libXaw3d )
+ !Xaw3d? ( x11-libs/libXaw )
+ )
+ )
+ dev-libs/kpathsea"
+DEPEND="sys-devel/flex
+ virtual/yacc
+ ${RDEPEND}"
+RDEPEND="${RDEPEND}
+ virtual/latex-base
+ !<app-text/texlive-2007"
+S=${WORKDIR}/${P}/texk/xdvik
+
+src_prepare() {
+ # Make sure system kpathsea headers are used
+ cd "${WORKDIR}/${P}/texk/kpathsea"
+ for i in *.h ; do echo "#include_next \"$i\"" > $i; done
+}
+
+src_configure() {
+ local toolkit
+
+ if use motif ; then
+ toolkit="motif"
+ use neXt && ewarn "neXt USE flag ignored (superseded by motif)"
+ use Xaw3d && ewarn "Xaw3d USE flag ignored (superseded by motif)"
+ elif use neXt ; then
+ toolkit="neXtaw"
+ use Xaw3d && ewarn "Xaw3d USE flag ignored (superseded by neXt)"
+ elif use Xaw3d ; then
+ toolkit="xaw3d"
+ else
+ toolkit="xaw"
+ fi
+
+ econf \
+ --with-system-freetype2 \
+ --with-system-kpathsea \
+ --with-kpathsea-include="${EPREFIX}"/usr/include/kpathsea \
+ --with-xdvi-x-toolkit="${toolkit}" \
+ --x-includes="${EPREFIX}"/usr/include \
+ --x-libraries="${EPREFIX}"/usr/$(get_libdir)
+}
+
+src_compile() {
+ emake kpathsea_dir="${EPREFIX}/usr/include/kpathsea"
+ use emacs && elisp-compile xdvi-search.el
+}
+
+src_install() {
+ dodir /usr/share/texmf-dist/dvips/config
+
+ emake DESTDIR="${D}" install
+
+ dosym /usr/share/texmf-dist/xdvi/XDvi /usr/share/X11/app-defaults/XDvi
+
+ dodoc BUGS FAQ README.*
+
+ use emacs && elisp-install tex-utils *.el *.elc
+
+ doicon "${FILESDIR}"/${PN}.xpm
+ make_desktop_entry xdvi "XDVI" xdvik "Graphics;Viewer"
+ echo "MimeType=application/x-dvi;" >> "${ED}"usr/share/applications/xdvi-"${PN}".desktop
+}
+
+pkg_postinst() {
+ if use emacs; then
+ elog "Add"
+ elog " (add-to-list 'load-path \"${EPREFIX}${SITELISP}/tex-utils\")"
+ elog " (require 'xdvi-search)"
+ elog "to your ~/.emacs file"
+ fi
+}
diff --git a/app-text/xdvik/xdvik-22.87.ebuild b/app-text/xdvik/xdvik-22.87.ebuild
new file mode 100644
index 000000000000..2c223876166e
--- /dev/null
+++ b/app-text/xdvik/xdvik-22.87.ebuild
@@ -0,0 +1,103 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit eutils flag-o-matic elisp-common toolchain-funcs multilib
+
+DESCRIPTION="DVI previewer for X Window System"
+HOMEPAGE="http://xdvi.sourceforge.net/"
+SRC_URI="mirror://sourceforge/xdvi/${P}.tar.gz"
+
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~x86-freebsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~x64-solaris ~x86-solaris"
+SLOT="0"
+LICENSE="GPL-2"
+IUSE="motif neXt Xaw3d emacs"
+
+RDEPEND="media-libs/freetype:2
+ x11-libs/libXi
+ x11-libs/libXmu
+ x11-libs/libXp
+ x11-libs/libXpm
+ motif? ( >=x11-libs/motif-2.3:0 )
+ !motif? (
+ neXt? ( x11-libs/neXtaw )
+ !neXt? (
+ Xaw3d? ( x11-libs/libXaw3d )
+ !Xaw3d? ( x11-libs/libXaw )
+ )
+ )
+ dev-libs/kpathsea"
+DEPEND="sys-devel/flex
+ virtual/yacc
+ virtual/pkgconfig
+ ${RDEPEND}"
+RDEPEND="${RDEPEND}
+ virtual/latex-base
+ !<app-text/texlive-2007"
+S=${WORKDIR}/${P}/texk/xdvik
+
+src_prepare() {
+ local i
+ epatch "${FILESDIR}"/${P}-xaw3d.patch
+ # Make sure system kpathsea headers are used
+ cd "${WORKDIR}/${P}/texk/kpathsea"
+ for i in *.h ; do echo "#include_next \"$i\"" > $i; done
+}
+
+src_configure() {
+ has_version '>=dev-libs/kpathsea-6.2.1' && append-cppflags "$($(tc-getPKG_CONFIG) --cflags kpathsea)"
+
+ local toolkit
+
+ if use motif ; then
+ toolkit="motif"
+ use neXt && ewarn "neXt USE flag ignored (superseded by motif)"
+ use Xaw3d && ewarn "Xaw3d USE flag ignored (superseded by motif)"
+ elif use neXt ; then
+ toolkit="neXtaw"
+ use Xaw3d && ewarn "Xaw3d USE flag ignored (superseded by neXt)"
+ elif use Xaw3d ; then
+ toolkit="xaw3d"
+ else
+ toolkit="xaw"
+ fi
+
+ econf \
+ --with-system-freetype2 \
+ --with-system-kpathsea \
+ --with-kpathsea-include="${EPREFIX}"/usr/include/kpathsea \
+ --with-xdvi-x-toolkit="${toolkit}" \
+ --x-includes="${EPREFIX}"/usr/include \
+ --x-libraries="${EPREFIX}"/usr/$(get_libdir)
+}
+
+src_compile() {
+ emake kpathsea_dir="${EPREFIX}/usr/include/kpathsea"
+ use emacs && elisp-compile xdvi-search.el
+}
+
+src_install() {
+ dodir /usr/share/texmf-dist/dvips/config
+
+ emake DESTDIR="${D}" install
+
+ dosym /usr/share/texmf-dist/xdvi/XDvi /usr/share/X11/app-defaults/XDvi
+
+ dodoc BUGS FAQ README.*
+
+ use emacs && elisp-install tex-utils *.el *.elc
+
+ doicon "${FILESDIR}"/${PN}.xpm
+ make_desktop_entry xdvi "XDVI" xdvik "Graphics;Viewer"
+ echo "MimeType=application/x-dvi;" >> "${ED}"usr/share/applications/xdvi-"${PN}".desktop
+}
+
+pkg_postinst() {
+ if use emacs; then
+ elog "Add"
+ elog " (add-to-list 'load-path \"${EPREFIX}${SITELISP}/tex-utils\")"
+ elog " (require 'xdvi-search)"
+ elog "to your ~/.emacs file"
+ fi
+}