You are not logged in.
I'm creating a PKGBUILD for a bunch of scripts that ease the use of Evince with SyncTeX a bit (to elaborate: SyncTeX creates a file that stores positions in original (La)TeX files from a corresponding pdf file, so one can Ctrl-click in Evince and an editor is shown at the corresponding position in the source file, and vice versa). The current version is in this Gist.
Two of those scripts are written in Python (2), a language I'm nearly illiterate in. I want to set the correct dependencies, but I don't know which dependencies I need.
At the moment the following Python2 packages are installed:
$ pacman -Q|grep python2
python2 2.7.8-2
python2-babel 1.3-5
python2-cairo 1.10.0-2
python2-crypto 2.6.1-2
python2-dbus 1.2.0-4
python2-ecdsa 0.11-2
python2-gobject2 2.28.6-11
python2-jinja 2.7.3-1
python2-markupsafe 0.23-1
python2-notify 0.1.1-13
python2-numpy 1.9.0-1
python2-oauth 1.0.1-3
python2-paramiko 1.15.1-1
python2-pexpect 3.3-1
python2-pyqt4 4.11.2-1
python2-pysqlite 2.6.3-4
python2-pytz 2014.7-1
python2-requests 2.4.3-1
python2-setuptools 1:7.0-1
python2-simplejson 3.6.3-1
python2-sip 4.16.3-1
With these packages, both scripts seem to work.
I suppose I can just look at the `import` lines and see that at least dbus and gobject2 are needed, but where can I find 'subprocess', 'time', 're', 'glib', 'sys' (like Java: in the default package?) and 'os'? Or are there other ways to get the dependencies right (an introspection tool, for instance)?
Last edited by Marcel- (2014-10-23 18:33:46)
Offline
I think I'm a bit further now: I created a file pytest only containing:
#!/usr/bin/python2
import dbus, subprocess, time, re, dbus.mainloop.glib, gobject, glib, sys, os
I added this file in my PKGBUILD as such:
check() {
cd "$srcdir"
./pytest
}
and ran makechrootpkg successively, each time adding dependencies that were needed to run this script. In the end I succeeded with
depends=('dbus-glib' 'python2-dbus' 'python2-gobject2')
Now my question is: is this enough?
Offline
Don't know much about python but [1] should be helpful as it lists all functions in the python 2.7 standard library.
sys for example is listed, so should not need a separate dependency.
Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.
(A works at time B) && (time C > time B ) ≠ (A works at time C)
Offline
I use something like this to find the package for a python import:
pythondep() {
test "$1" -gt 0 2>/dev/null && set -- "$2" "$1"
pkgfile "$(python$2 -c "import $1; print($1.__file__)")"
}
pythondep dbus # for default python
pythondep 3 dbus # for python3
pythondep 2 dbus # for python2
| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |
Online
Thanks Progandy, that's what I need, though it doesn't detect the dependency dbus-glib, which is clearly needed.
Offline
Thanks Progandy, that's what I need, though it doesn't detect the dependency dbus-glib, which is clearly needed.
dbus-glib is an optional dependency of python2-dbus, so it is not automatically in the dependency chain, you'll have to find it manually. Optional dependencies are a bit tricky to find.
| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |
Online