diff options
author | Jonathan Yantis | 2015-06-11 08:31:04 -0700 |
---|---|---|
committer | Jonathan Yantis | 2015-06-11 08:31:04 -0700 |
commit | de7fb252dc2885c274554976c3b6b4232f484beb (patch) | |
tree | d1022f724fd5122a8b88874242a865e7f5f4310c | |
download | aur-de7fb252dc2885c274554976c3b6b4232f484beb.tar.gz |
Initial import
-rw-r--r-- | .SRCINFO | 22 | ||||
-rw-r--r-- | PKGBUILD | 62 | ||||
-rw-r--r-- | reloader.patch | 16 |
3 files changed, 100 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..b4b08be75748 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,22 @@ +pkgbase = pythonar-git + pkgdesc = Provides a simple way to restart applications when you change source code or resources thus providing better workflow. Written in Python 2 + pkgver = r19.9b2a3b4 + pkgrel = 2 + url = https://github.com/kivy/pythonar + arch = any + license = MIT + makedepends = git + depends = python2 + depends = python2-colorama + depends = python2-termcolor + depends = python2-watchdog + optdepends = xdotool: x11 automation + provides = pythonar + conflicts = pythonar + source = git+https://github.com/kivy/pythonar.git + source = reloader.patch + sha256sums = SKIP + sha256sums = 412cd7de6c52f4d3d6e11ff1af059e1e2e995270dd0e483fa834ddc6b7653f43 + +pkgname = pythonar-git + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..f12446952e15 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,62 @@ +# Maintainer: jyantis <yantis@yantis.net> + +# Note it will crash if you run it without arguments +# try reloader --help + +# If your windows are jumping around on you it is because you have xdotool installed +# I am not sure if its working as intended but I don't like it so I personally don't have it installed. + +pkgname=pythonar-git +pkgver=r19.9b2a3b4 +pkgrel=2 +pkgdesc='Provides a simple way to restart applications when you change source code or resources thus providing better workflow. Written in Python 2' +arch=('any') +url='https://github.com/kivy/pythonar' +license=('MIT') +depends=('python2' + 'python2-colorama' + 'python2-termcolor' + 'python2-watchdog') +optdepends=('xdotool: x11 automation') +source=('git+https://github.com/kivy/pythonar.git' 'reloader.patch') +sha256sums=('SKIP' '412cd7de6c52f4d3d6e11ff1af059e1e2e995270dd0e483fa834ddc6b7653f43') +makedepends=('git') +provides=('pythonar') +conflicts=('pythonar') +pkgver() { + cd pythonar + set -o pipefail + git describe --long | sed -r 's/([^-]*-g)/r\1/;s/-/./g' || + printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" +} + +build() { + # patch to fix error messages if xdotool isn't installed + patch pythonar/reloader.py < reloader.patch + + cd pythonar + + # patch any #!/usr/bin/python to #!/usr/bin/python2 + for file in $(find . -name '*.py' -print); do + sed -r -i 's_^#!.*/usr/bin/python(\s|$)_#!/usr/bin/python2_' $file + sed -r -i 's_^#!.*/usr/bin/env(\s)*python(\s|$)_#!/usr/bin/env python2_' $file + done +} + +package() { + cd pythonar + + # We don't need anything related to git in the package + rm -rf .git* + + # Install License + install -D -m644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE" + + # Install Documentation + install -D -m644 README.md "${pkgdir}/usr/share/doc/${pkgname}/README.md" + + # Install the program + install -D -m755 reloader.py "$pkgdir/usr/bin/reloader" +} + +# vim:set ts=2 sw=2 et: diff --git a/reloader.patch b/reloader.patch new file mode 100644 index 000000000000..e6922e6d0d3b --- /dev/null +++ b/reloader.patch @@ -0,0 +1,16 @@ +--- reloader.py 2014-10-13 13:10:08.354595249 -0700 ++++ reloader-updated 2014-10-13 13:25:48.200914826 -0700 +@@ -71,8 +71,12 @@ + self._process = Popen(self.command) + log('green', 'STARTED %s' % self._process) + +- self.swid = int(Popen(['/usr/bin/env', 'xdotool', 'getwindowfocus'], ++ if self.focus: ++ self.swid = int(Popen(['/usr/bin/env', 'xdotool', 'getwindowfocus'], + stdout=PIPE).communicate()[0]) ++ else: ++ self.swid = 0 ++ + if self.focus: + while time() < t + self.focus: + # try to detect a window appeared by tracking focus |