tests: python module should install files correctly
- default to python site-packages - subdir to site-packages/subdir - arbitrary install_dir
This commit is contained in:
parent
b0ffb80ecf
commit
1f46b4ce64
|
@ -1,6 +1,6 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
import tachyon
|
import @tachyon_module@ as tachyon
|
||||||
|
|
||||||
result = tachyon.phaserize('shoot')
|
result = tachyon.phaserize('shoot')
|
||||||
|
|
|
@ -1,6 +1,10 @@
|
||||||
pylib = py.extension_module('tachyon',
|
pylib = py.extension_module('tachyon',
|
||||||
'tachyon_module.c',
|
'tachyon_module.c',
|
||||||
dependencies : py_dep,
|
dependencies : py_dep,
|
||||||
|
c_args: '-DMESON_MODULENAME="tachyon"',
|
||||||
|
install: true,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
subdir('nested')
|
||||||
|
subdir('wrongdir')
|
||||||
pypathdir = meson.current_build_dir()
|
pypathdir = meson.current_build_dir()
|
||||||
|
|
|
@ -0,0 +1,16 @@
|
||||||
|
py.extension_module('tachyon',
|
||||||
|
'../tachyon_module.c',
|
||||||
|
dependencies : py_dep,
|
||||||
|
c_args: '-DMESON_MODULENAME="nested.tachyon"',
|
||||||
|
install: true,
|
||||||
|
subdir: 'nested'
|
||||||
|
)
|
||||||
|
py.install_sources(
|
||||||
|
configure_file(
|
||||||
|
input: '../../blaster.py.in',
|
||||||
|
output: 'blaster.py',
|
||||||
|
configuration: {'tachyon_module': 'nested.tachyon'}
|
||||||
|
),
|
||||||
|
pure: false,
|
||||||
|
subdir: 'nested',
|
||||||
|
)
|
|
@ -38,7 +38,7 @@ static PyMethodDef TachyonMethods[] = {
|
||||||
|
|
||||||
static struct PyModuleDef tachyonmodule = {
|
static struct PyModuleDef tachyonmodule = {
|
||||||
PyModuleDef_HEAD_INIT,
|
PyModuleDef_HEAD_INIT,
|
||||||
"tachyon",
|
MESON_MODULENAME,
|
||||||
NULL,
|
NULL,
|
||||||
-1,
|
-1,
|
||||||
TachyonMethods
|
TachyonMethods
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
py.extension_module('tachyon',
|
||||||
|
'../tachyon_module.c',
|
||||||
|
dependencies : py_dep,
|
||||||
|
c_args: '-DMESON_MODULENAME="tachyon"',
|
||||||
|
install: true,
|
||||||
|
install_dir: get_option('libdir')
|
||||||
|
)
|
|
@ -18,11 +18,19 @@ endif
|
||||||
|
|
||||||
subdir('ext')
|
subdir('ext')
|
||||||
|
|
||||||
|
blaster = configure_file(
|
||||||
|
input: 'blaster.py.in',
|
||||||
|
output: 'blaster.py',
|
||||||
|
configuration: {'tachyon_module': 'tachyon'}
|
||||||
|
)
|
||||||
|
|
||||||
test('extmod',
|
test('extmod',
|
||||||
py,
|
py,
|
||||||
args : files('blaster.py'),
|
args : blaster,
|
||||||
env : ['PYTHONPATH=' + pypathdir])
|
env : ['PYTHONPATH=' + pypathdir])
|
||||||
|
|
||||||
|
py.install_sources(blaster, pure: false)
|
||||||
|
py.install_sources(blaster, subdir: 'pure')
|
||||||
|
|
||||||
py3_pkg_dep = dependency('python3', method: 'pkg-config', required : false)
|
py3_pkg_dep = dependency('python3', method: 'pkg-config', required : false)
|
||||||
if py3_pkg_dep.found()
|
if py3_pkg_dep.found()
|
||||||
|
|
|
@ -0,0 +1,13 @@
|
||||||
|
{
|
||||||
|
"installed": [
|
||||||
|
{ "type": "python_file", "file": "usr/@PYTHON_PLATLIB@/blaster.py" },
|
||||||
|
{ "type": "python_lib", "file": "usr/@PYTHON_PLATLIB@/tachyon" },
|
||||||
|
{ "type": "py_implib", "file": "usr/@PYTHON_PLATLIB@/tachyon" },
|
||||||
|
{ "type": "python_file", "file": "usr/@PYTHON_PURELIB@/pure/blaster.py" },
|
||||||
|
{ "type": "python_file", "file": "usr/@PYTHON_PLATLIB@/nested/blaster.py" },
|
||||||
|
{ "type": "python_lib", "file": "usr/@PYTHON_PLATLIB@/nested/tachyon" },
|
||||||
|
{ "type": "py_implib", "file": "usr/@PYTHON_PLATLIB@/nested/tachyon" },
|
||||||
|
{ "type": "python_lib", "file": "usr/lib/tachyon" },
|
||||||
|
{ "type": "py_implib", "file": "usr/lib/tachyon" }
|
||||||
|
]
|
||||||
|
}
|
Loading…
Reference in New Issue