summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuca Weiss2021-06-13 10:02:35 +0200
committerLuca Weiss2021-06-13 10:02:35 +0200
commit3b762b6e32341c70ee0b5127c1053cad96f8eb0a (patch)
tree3e8990c604e2790b5c1e02ce12b10c4187df89b2
parentf0ef076d8cbaf87ca9761565daf099c4ab99be75 (diff)
downloadaur-3b762b6e32341c70ee0b5127c1053cad96f8eb0a.tar.gz
openrazer: add python sanity check
Hopefully less issue reports because of weird python setups in the future...
-rw-r--r--.SRCINFO1
-rw-r--r--PKGBUILD10
2 files changed, 10 insertions, 1 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 93fa24cf80e3..e190b9cff284 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -41,4 +41,3 @@ pkgname = openrazer-meta
optdepends = polychromatic: frontend
optdepends = razergenie: qt frontend
optdepends = razercommander: gtk frontend
-
diff --git a/PKGBUILD b/PKGBUILD
index 6ea2acf001fc..16ec6a58bea0 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -13,6 +13,16 @@ makedepends=('python-setuptools')
source=("https://github.com/openrazer/openrazer/releases/download/v$pkgver/openrazer-$pkgver.tar.xz")
sha256sums=('b27a7ab459e5290f9fe4d56f49922f97ed83fc92ba2bc0154aff8c4cdd1de73f')
+prepare() {
+ # Do a sanity check in the environment of the builder so the build process doesn't place files into a wrong directory.
+ # If you think this is incorrect you can always remove this from the PKGBUILD, but then please don't complain if it doesn't work.
+ if [ "$(which python3)" != "/usr/bin/python3" ]; then
+ echo "ERROR: Your 'python3' does not point to /usr/bin/python3 but to $(which python3), likely a custom environment like anaconda."
+ echo "Please build this package in a clean chroot (e.g. with https://wiki.archlinux.org/title/DeveloperWiki:Building_in_a_clean_chroot) or point your PATH variable to prefer /usr/bin/ temporarily."
+ return 1
+ fi
+}
+
package_python-openrazer() {
pkgdesc="Python library for accessing the Razer daemon from Python."
depends=('openrazer-daemon' 'python-numpy')