summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO18
-rw-r--r--PKGBUILD31
-rw-r--r--evince-synctex.install3
-rw-r--r--evince-synctex.patch75
4 files changed, 127 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..35ddec2dbee7
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,18 @@
+pkgbase = evince-synctex
+ pkgdesc = Several scripts to ease the use of Evince with SyncTeX
+ pkgver = 1
+ pkgrel = 1
+ url = http://forum.ubuntuusers.de/topic/evince-synctex-vim-emacs-scite-lyx-kile-editor/
+ install = evince-synctex.install
+ arch = any
+ license = GPL
+ depends = dbus-glib
+ depends = python2-dbus
+ depends = python2-gobject2
+ source = http://dud.inf.tu-dresden.de/~ben/evince_synctex.tar.gz
+ source = evince-synctex.patch
+ sha256sums = 65b43f00e894d116bbccf62cac1d6bdd753c6bcb4d0d7f90efbf10c59dc95052
+ sha256sums = 2a8a5a55c68051f70a2ec8fe1e48b5c9a27f3def29ee4efb2f8e9773afda43cc
+
+pkgname = evince-synctex
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..36e60ad787c1
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,31 @@
+# Maintainer: Marcel Korpel <marcel[dot]korpel[at]gmail>
+
+pkgname=evince-synctex
+_pkgname=${pkgname/-/_}
+pkgver=1
+pkgrel=1
+pkgdesc="Several scripts to ease the use of Evince with SyncTeX"
+arch=('any')
+url="http://forum.ubuntuusers.de/topic/evince-synctex-vim-emacs-scite-lyx-kile-editor/"
+license=('GPL')
+depends=('dbus-glib' 'python2-dbus' 'python2-gobject2')
+install=$pkgname.install
+source=(http://dud.inf.tu-dresden.de/~ben/${_pkgname}.tar.gz
+ $pkgname.patch)
+sha256sums=('65b43f00e894d116bbccf62cac1d6bdd753c6bcb4d0d7f90efbf10c59dc95052'
+ '2a8a5a55c68051f70a2ec8fe1e48b5c9a27f3def29ee4efb2f8e9773afda43cc')
+
+prepare() {
+ cd "$srcdir/${_pkgname}"
+
+ patch -p1 < ../$pkgname.patch
+}
+
+package() {
+ cd "$srcdir/${_pkgname}"
+
+ install -D evince "$pkgdir/usr/bin/$pkgname"
+ install evince_backward_search \
+ evince_forward_search \
+ "$pkgdir/usr/bin"
+}
diff --git a/evince-synctex.install b/evince-synctex.install
new file mode 100644
index 000000000000..ec74ecd51685
--- /dev/null
+++ b/evince-synctex.install
@@ -0,0 +1,3 @@
+post_install() {
+ echo 'Do not forget to set $EDITORCMD in ~/.bashrc (or similar)'
+}
diff --git a/evince-synctex.patch b/evince-synctex.patch
new file mode 100644
index 000000000000..c9362f1432fa
--- /dev/null
+++ b/evince-synctex.patch
@@ -0,0 +1,75 @@
+diff --git a/evince b/evince
+index 5380585..f42c27f 100755
+--- a/evince
++++ b/evince
+@@ -1,5 +1,10 @@
+ #!/bin/sh
+-EDITORCMD="gvim --servername '`basename "$1" .pdf`' --remote-silent '+%l<Enter>' %f"
++#EDITORCMD="gvim --servername '`basename "$1" .pdf`' --remote-silent '+%l<Enter>' %f"
++if [ -z "$EDITORCMD" ]; then
++ echo 'Please set variable $EDITORCMD'
++ exit 1
++fi
++
+ # Highlight matched column
+ # EDITORCMD="gvim --servername '`basename "$1" .pdf`' --remote-silent '+%l<Enter>:match Search /\%%ll/' %f"
+
+@@ -8,7 +13,7 @@ PDFFILE="$1"
+ if [ -f "$PDFFILE" ];then
+ # danke an Feuerfieber
+ # http://forum.ubuntuusers.de/topic/evince-synctex-vim-emacs-scite-lyx-kile-editor/#post-2841828
+- if [ -f "${PDFFILE%%.pdf}.synctex.gz" ];then
++ if [ -f "${PDFFILE%.pdf}.synctex.gz" ];then
+ evince_backward_search "$PDFFILE" "$EDITORCMD"&
+ BACKWARD_SEARCH_PID=$!
+ echo $BACKWARD_SEARCH_PID
+diff --git a/evince_backward_search b/evince_backward_search
+index 747de5b..0b6e818 100755
+--- a/evince_backward_search
++++ b/evince_backward_search
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python
++#!/usr/bin/python2
+ # -*- coding: utf-8 -*-
+
+ # Copyright (C) 2010 Jose Aliste <jose.aliste@gmail.com>
+@@ -18,7 +18,7 @@
+ # this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
+ # Street, Fifth Floor, Boston, MA 02110-1301, USA
+
+-import dbus, subprocess, time, re
++import dbus, subprocess, time, re, urllib2
+
+ RUNNING, CLOSED = range(2)
+
+@@ -104,9 +104,9 @@ class EvinceWindowProxy:
+ if self._log:
+ self._log.debug("GetWindowList returned empty list")
+
+- def on_sync_source(self, input_file, source_link):
++ def on_sync_source(self, input_file, source_link, timestamp):
+ print input_file + ":" + str(source_link[0])
+- cmd = re.sub("%f",input_file,self.editor)
++ cmd = re.sub("%f",'"'+urllib2.unquote(input_file.split("file://")[1])+'"',self.editor)
+ cmd = re.sub("%l",str(source_link[0]), cmd)
+ print cmd
+ subprocess.call(cmd, shell=True)
+@@ -142,7 +142,7 @@ E.g.:
+ print_usage()
+
+ dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
+- a = EvinceWindowProxy('file://' + pdf_file, sys.argv[2] ,True)
++ a = EvinceWindowProxy('file://' + urllib2.quote(pdf_file,safe="%/:=&?~#+!$,;'@()*[]"), sys.argv[2] ,True)
+
+
+ loop = gobject.MainLoop()
+diff --git a/evince_forward_search b/evince_forward_search
+index 420e16a..a0b690a 100755
+--- a/evince_forward_search
++++ b/evince_forward_search
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python
++#!/usr/bin/python2
+ # -*- coding: utf-8 -*-
+
+ # Copyright (C) 2010 Jose Aliste <jose.aliste@gmail.com>