diff options
author | Xavier Claessens <xavier.claessens@collabora.com> | 2021-10-04 11:12:29 -0400 |
---|---|---|
committer | Eli Schwartz <eschwartz93@gmail.com> | 2021-10-08 17:47:35 -0400 |
commit | 329d111709ab5c5140f75f29c7176c9546de5770 (patch) | |
tree | 101c75a8dab9b02784d8401cb1d6877f0f241a05 /docs | |
parent | 5316c7df62926d49149053b5d8ccfb4a0042856e (diff) | |
download | meson-329d111709ab5c5140f75f29c7176c9546de5770.zip meson-329d111709ab5c5140f75f29c7176c9546de5770.tar.gz meson-329d111709ab5c5140f75f29c7176c9546de5770.tar.bz2 |
python: Add platlibdir and purelibdir options
Diffstat (limited to 'docs')
-rw-r--r-- | docs/markdown/Builtin-options.md | 20 | ||||
-rw-r--r-- | docs/markdown/Python-module.md | 6 | ||||
-rw-r--r-- | docs/markdown/snippets/python_install_path.md | 12 |
3 files changed, 38 insertions, 0 deletions
diff --git a/docs/markdown/Builtin-options.md b/docs/markdown/Builtin-options.md index 37bf715..41f8b84 100644 --- a/docs/markdown/Builtin-options.md +++ b/docs/markdown/Builtin-options.md @@ -260,3 +260,23 @@ The value is overridden in this order: - Value from command line if set Since 0.56.0 `warning_level` can also be defined per subproject. + +## Module options + +Some Meson modules have built-in options. They can be set by prefixing the option +name with the module name: `-D<module>.<option>=<value>` (e.g. `-Dpython.platlibdir=/foo`). + +### Python module + +| Option | Default value | Possible values | Description | +| ------ | ------------- | --------------- | ----------- | +| platlibdir | | Directory path | Directory for site-specific, platform-specific files (Since 0.60.0) | +| purelibdir | | Directory path | Directory for site-specific, non-platform-specific files (Since 0.60.0) | + +*Since 0.60.0* `python.platlibdir` and `python.purelibdir` options are used by +python module methods `python.install_sources()` and `python.get_install_dir()`. +By default Meson tries to detect the correct installation path, but make them +relative to the installation `prefix`, which will often result in installed python +modules to not be found by the interpreter unless `prefix` is `/usr` on Linux, +or for example `C:\Python39` on Windows. These options can be absolute paths +outside of `prefix`. diff --git a/docs/markdown/Python-module.md b/docs/markdown/Python-module.md index 5d7b5ed..0602955 100644 --- a/docs/markdown/Python-module.md +++ b/docs/markdown/Python-module.md @@ -128,6 +128,9 @@ Install actual python sources (`.py`). All positional and keyword arguments are the same as for [[install_data]], with the addition of the following: +*Since 0.60.0* `python.platlibdir` and `python.purelibdir` options can be used +to control the default installation path. See [Python module options](Builtin-options.md#python-module). + - `pure`: On some platforms, architecture independent files are expected to be placed in a separate directory. However, if the python sources should be installed alongside an extension module @@ -154,6 +157,9 @@ directly, for example when using [[configure_file]]. This function accepts no arguments, its keyword arguments are the same as [][`install_sources()`]. +*Since 0.60.0* `python.platlibdir` and `python.purelibdir` options can be used +to control the default installation path. See [Python module options](Builtin-options.md#python-module). + **Returns**: A string #### `language_version()` diff --git a/docs/markdown/snippets/python_install_path.md b/docs/markdown/snippets/python_install_path.md new file mode 100644 index 0000000..4f22e50 --- /dev/null +++ b/docs/markdown/snippets/python_install_path.md @@ -0,0 +1,12 @@ +## Override python installation paths + +The `python` module now has options to control where modules are installed: +- python.platlibdir: Directory for site-specific, platform-specific files. +- python.purelibdir: Directory for site-specific, non-platform-specific files. + +Those options are used by python module methods `python.install_sources()` and +`python.get_install_dir()`. By default Meson tries to detect the correct installation +path, but make them relative to the installation `prefix`, which will often result +in installed python modules to not be found by the interpreter unless `prefix` +is `/usr` on Linux, or for example `C:\Python39` on Windows. These new options +can be absolute paths outside of `prefix`. |