setup.py fixes, guix and pyopencl

- detect GUIX
- FreeBSD uses "pkg install", not "pkg_install"
- add pyopencl dependency checking
This commit is contained in:
Peter Šurda 2017-02-28 22:22:36 +01:00
parent eaafb9efa5
commit b7e75b9bc5
Signed by: PeterSurda
GPG Key ID: 0C5F50C0B5F37D87

View File

@ -14,7 +14,7 @@ from src.version import softwareVersion
packageManager = { packageManager = {
"OpenBSD": "pkg_add", "OpenBSD": "pkg_add",
"FreeBSD": "pkg_install", "FreeBSD": "pkg install",
"Debian": "apt-get install", "Debian": "apt-get install",
"Ubuntu": "apt-get install", "Ubuntu": "apt-get install",
"openSUSE": "zypper install", "openSUSE": "zypper install",
@ -43,6 +43,13 @@ packageName = {
"Fedora": "python2-msgpack", "Fedora": "python2-msgpack",
"Guix": "python2-msgpack", "Guix": "python2-msgpack",
"Gentoo": "dev-python/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" detectOS.result = "Gentoo"
else: else:
detectOS.result = None detectOS.result = None
elif os.path.isfile("/etc/config.scm"):
detectOS.result = "Guix"
return detectOS.result return detectOS.result
@ -92,6 +101,13 @@ def detectPrereqs(missing=False):
except ImportError: except ImportError:
if missing: if missing:
available.append("msgpack") available.append("msgpack")
try:
import_module("pyopencl")
if not missing:
available.append("pyopencl")
except ImportError:
if missing:
available.append("pyopencl")
return available return available