Skip to content

Commit b7e75b9

Browse files
committed
setup.py fixes, guix and pyopencl
- detect GUIX - FreeBSD uses "pkg install", not "pkg_install" - add pyopencl dependency checking
1 parent eaafb9e commit b7e75b9

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

setup.py

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
packageManager = {
1616
"OpenBSD": "pkg_add",
17-
"FreeBSD": "pkg_install",
17+
"FreeBSD": "pkg install",
1818
"Debian": "apt-get install",
1919
"Ubuntu": "apt-get install",
2020
"openSUSE": "zypper install",
@@ -43,6 +43,13 @@
4343
"Fedora": "python2-msgpack",
4444
"Guix": "python2-msgpack",
4545
"Gentoo": "dev-python/msgpack"
46+
},
47+
"pyopencl": {
48+
"FreeBSD": "py27-pyopencl",
49+
"Debian": "python-pyopencl",
50+
"Ubuntu": "python-pyopencl",
51+
"Fedora": "python2-pyopencl",
52+
"Gentoo": "dev-python/pyopencl"
4653
}
4754
}
4855

@@ -73,6 +80,8 @@ def detectOS():
7380
detectOS.result = "Gentoo"
7481
else:
7582
detectOS.result = None
83+
elif os.path.isfile("/etc/config.scm"):
84+
detectOS.result = "Guix"
7685
return detectOS.result
7786

7887

@@ -92,6 +101,13 @@ def detectPrereqs(missing=False):
92101
except ImportError:
93102
if missing:
94103
available.append("msgpack")
104+
try:
105+
import_module("pyopencl")
106+
if not missing:
107+
available.append("pyopencl")
108+
except ImportError:
109+
if missing:
110+
available.append("pyopencl")
95111
return available
96112

97113

0 commit comments

Comments
 (0)