updated on Sat Jan 21 20:03:50 UTC 2012
[aur-mirror.git] / evince-gtk-synctex / PKGBUILD
blob0b5691a414582fbe66e0fdbe9c687300b4cade9b
1 # Contributor: Thomas Lundgaard <thomaslundgaard at gmail dot com>
2 # Initial PKGBUILD from http://bbs.archlinux.org/viewtopic.php?pid=621606 (thanks to Tristero)
4 # To change which editor to sync to, change the EDITOR variable in
5 # build().  This editor is used as the '-x' argument to the synctex
6 # CLI-tool, so see "synctex help edit" for info on the syntax and
7 # possible options
8 # If you work out EDITOR-options for another editor,
9 # add them in the comments on aur.archlinux.org, and I will add it to
10 # the list of commented-out EDITORs.
12 # You need to compile your tex files with pdflatex and use the
13 # argument --synctex=1.  To go from evince to the selected editor,
14 # doubleclick anywhere in the PDF in evince.  To go from your editor
15 # to evince, you can use some of the scripts avaliable from:
16 # http://aur.archlinux.org/packages/evince-gtk-synctex/evince-gtk-synctex
17 # See the comments in the top of the scripts for info on how to use
18 # them.
20 pkgname=evince-gtk-synctex
21 pkgver=2.26.2
22 pkgrel=3
23 pkgdesc="The Evince documentviewer patched to have no gnome deps + inverse and forward search with SyncTex, options to sync to emacs, gvim or kile (edit PKGBUILD to choose editor)"
24 url="http://www.gnome.org"
25 arch=('i686' 'x86_64')
26 license=('GPL')
27 depends=('gsfonts' 'poppler-glib>=0.10.7' 't1lib' 'libdjvu>=3.5.20' 'desktop-file-utils' 'libspectre>=0.2.2' 'hicolor-icon-theme' 'gtk2' 'texlive-bin')
28 makedepends=('pkgconfig' 'texlive-bin' 'intltool' 'gnome-doc-utils')
29 optdepends=('texlive-bin: DVI support')
30 replaces=('gpdf')
31 provides=('evince')
32 conflicts=('evince')
33 install=evince-gtk-synctex.install
34 options=('!libtool' '!emptydirs')
35 source=("http://ftp.gnome.org/pub/gnome/sources/evince/2.26/evince-${pkgver}.tar.bz2"
36         "evince-${pkgver}-gtk.patch"
37         "evince-${pkgver}-synctex.patch")
38 md5sums=('ed8b9fb5c5d6feafd19f0114b736c9ef'
39          '2e999966461e731206b03644bce5d52d'
40          'a46c330a9b7ebf74f2dc4279bbbd7bb4')
42 build() {
43   # Emacs
44   EDITOR="sh -c 'cd $(dirname %{output}); emacs +%{line} %{input}'"
45   # Emacsclient, great if you do not want multiple emacs windows. (thanks to haarward)
46   # This requires (server-start) in .emacs, and 'export ALTERNATE_EDITOR="emacs"' in .bashrc
47   #EDITOR="sh -c 'cd $(dirname %{output}); emacsclient -n +%{line} %{input}'"
48   # Gvim
49   #EDITOR="sh -c 'cd $(dirname %{output}); gvim --servername EVINCE --remote-silent +%{line} %{input}'
50   # Kile
51   #EDITOR="sh -c 'cd $(dirname %{output}); kile --line %{line} %{input}'"
53   cd "${srcdir}/evince-${pkgver}"
54   patch -Np0 -i ../evince-${pkgver}-gtk.patch || return 1
55   patch -Np0 -i ../evince-${pkgver}-synctex.patch || return 1
56   sed -i "s/SED_SYNCTEX_EDITOR/$EDITOR/g" libview/ev-view.c
58   ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var \
59           --enable-pdf --enable-dvi \
60           --enable-djvu --enable-tiff \
61           --enable-t1lib --enable-pixbuf \
62           --enable-comics --enable-impress \
63               --without-gconf --without-keyring \
64               --disable-static --disable-schemas-install \
65               --disable-scrollkeeper \
66               || return 1
67   make || return 1
68   make DESTDIR="${pkgdir}" install || return 1