From b7e75b9bc51e7036045167ad6191fe339f1a9daa Mon Sep 17 00:00:00 2001 From: Peter Surda Date: Tue, 28 Feb 2017 22:22:36 +0100 Subject: [PATCH] setup.py fixes, guix and pyopencl - detect GUIX - FreeBSD uses "pkg install", not "pkg_install" - add pyopencl dependency checking --- setup.py | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index e5a0fb7d..078fbc2d 100644 --- a/setup.py +++ b/setup.py @@ -14,7 +14,7 @@ from src.version import softwareVersion packageManager = { "OpenBSD": "pkg_add", - "FreeBSD": "pkg_install", + "FreeBSD": "pkg install", "Debian": "apt-get install", "Ubuntu": "apt-get install", "openSUSE": "zypper install", @@ -43,6 +43,13 @@ packageName = { "Fedora": "python2-msgpack", "Guix": "python2-msgpack", "Gentoo": "dev-python/msgpack" + }, + "pyopencl": { + "FreeBSD": "py27-pyopencl", + "Debian": "python-pyopencl", + "Ubuntu": "python-pyopencl", + "Fedora": "python2-pyopencl", + "Gentoo": "dev-python/pyopencl" } } @@ -73,6 +80,8 @@ def detectOS(): detectOS.result = "Gentoo" else: detectOS.result = None + elif os.path.isfile("/etc/config.scm"): + detectOS.result = "Guix" return detectOS.result @@ -92,6 +101,13 @@ def detectPrereqs(missing=False): except ImportError: if missing: available.append("msgpack") + try: + import_module("pyopencl") + if not missing: + available.append("pyopencl") + except ImportError: + if missing: + available.append("pyopencl") return available