diff options
| author | Eli Schwartz <eschwartz@archlinux.org> | 2021-08-17 16:25:22 -0400 |
|---|---|---|
| committer | Eli Schwartz <eschwartz@archlinux.org> | 2021-08-18 17:58:30 -0400 |
| commit | 1f46b4ce64864c6805b4c64b449a1d4818895435 (patch) | |
| tree | 7d20980da4175f561dad34bbf4ca4db6fca2d721 /test cases/python/2 extmodule/ext | |
| parent | b0ffb80ecf845c71453aa34c05570b0c3122db3f (diff) | |
| download | meson-1f46b4ce64864c6805b4c64b449a1d4818895435.tar.gz | |
tests: python module should install files correctly
- default to python site-packages
- subdir to site-packages/subdir
- arbitrary install_dir
Diffstat (limited to 'test cases/python/2 extmodule/ext')
4 files changed, 28 insertions, 1 deletions
diff --git a/test cases/python/2 extmodule/ext/meson.build b/test cases/python/2 extmodule/ext/meson.build index b13bb326f..799e9b08a 100644 --- a/test cases/python/2 extmodule/ext/meson.build +++ b/test cases/python/2 extmodule/ext/meson.build @@ -1,6 +1,10 @@ pylib = py.extension_module('tachyon', 'tachyon_module.c', dependencies : py_dep, + c_args: '-DMESON_MODULENAME="tachyon"', + install: true, ) +subdir('nested') +subdir('wrongdir') pypathdir = meson.current_build_dir() diff --git a/test cases/python/2 extmodule/ext/nested/meson.build b/test cases/python/2 extmodule/ext/nested/meson.build new file mode 100644 index 000000000..38d3d3e28 --- /dev/null +++ b/test cases/python/2 extmodule/ext/nested/meson.build @@ -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', +) diff --git a/test cases/python/2 extmodule/ext/tachyon_module.c b/test cases/python/2 extmodule/ext/tachyon_module.c index b2592e482..a5d7cdc98 100644 --- a/test cases/python/2 extmodule/ext/tachyon_module.c +++ b/test cases/python/2 extmodule/ext/tachyon_module.c @@ -38,7 +38,7 @@ static PyMethodDef TachyonMethods[] = { static struct PyModuleDef tachyonmodule = { PyModuleDef_HEAD_INIT, - "tachyon", + MESON_MODULENAME, NULL, -1, TachyonMethods diff --git a/test cases/python/2 extmodule/ext/wrongdir/meson.build b/test cases/python/2 extmodule/ext/wrongdir/meson.build new file mode 100644 index 000000000..1355d4fd7 --- /dev/null +++ b/test cases/python/2 extmodule/ext/wrongdir/meson.build @@ -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') +) |
