summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorShadowKyogre2017-04-28 10:58:12 -0700
committerShadowKyogre2017-04-28 10:58:12 -0700
commit763e5be9f19d4d3435527b64dd6159d98c377dec (patch)
tree78665bc30595873614cf4ee2c79d9e2c95e22757
parent1cd4c7166f7db77dfbf4120752e12386f2e00776 (diff)
downloadaur-763e5be9f19d4d3435527b64dd6159d98c377dec.tar.gz
Autodetect python2 and python3
-rw-r--r--.SRCINFO2
-rw-r--r--PKGBUILD19
2 files changed, 15 insertions, 6 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 7dc7ed90a94..0f9d9dcf80f 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,5 +1,5 @@
# Generated by mksrcinfo v8
-# Mon Apr 24 22:01:49 UTC 2017
+# Fri Apr 28 17:58:04 UTC 2017
pkgbase = fusion-icon-git
pkgdesc = Simple tray icon for Compiz 0.8
pkgver = 0.2.3.r4.g84e27a8
diff --git a/PKGBUILD b/PKGBUILD
index 1906f97b05d..5eaad33ac0d 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -19,13 +19,22 @@ conflicts=('fusion-icon0.9' 'fusion-icon')
provides=('fusion-icon')
depends=('compizconfig-python' 'hicolor-icon-theme' 'xorg-utils' 'mesa-demos')
+# presume that if compizconfig-python deps are met, it's against python2
+_python="python"
+_sitearch_check="from distutils import sysconfig; print(sysconfig.get_python_lib(plat_specific=1))"
+
+# do we have a python2 compizconfig-python?
+if [[ -f "$(python2 -c "${_sitearch_check}")/compizconfig.so" ]]; then
+ _python=python2
+fi
+
# Note to anyone who builds this: Make sure you install the appropriate
# dependencies for the user interfaces you want to use! Otherwise, it'll appear
# like it's not working!
-# Change to python2 if using Compiz 0.9.x
+# Also - change these to python2 if you're using Compiz 0.9.x
optdepends=(
- 'python-pyqt5: For the Qt Interface'
- 'python-gobject: For the GTK+ Interface'
+ "${_python}-pyqt5: For the Qt Interface"
+ "${_python}-gobject: For the GTK+ Interface"
'libappindicator-gtk3: For the GTK+ Interface'
)
@@ -40,13 +49,13 @@ pkgver() {
build() {
cd "${srcdir}/${_upstream}"
# Change to python2 if using Compiz 0.9.x
- python ./setup.py build
+ "${_python}" ./setup.py build
}
package() {
cd "${srcdir}/${_upstream}"
# Change to python2 if using Compiz 0.9.x
- python ./setup.py install --root="$pkgdir" --optimize=1
+ "${_python}" ./setup.py install --root="$pkgdir" --optimize=1
}
sha256sums=('SKIP')