Generate and install a npy-pkg config file from a template. The config file generated from `template` is installed in the given install directory, using `subst_dict` for variable substitution. Parameters ---------- template : str The pat
(self, template, install_dir, subst_dict=None)
| 1646 | self.installed_libraries.append(InstallableLib(name, build_info, install_dir)) |
| 1647 | |
| 1648 | def add_npy_pkg_config(self, template, install_dir, subst_dict=None): |
| 1649 | """ |
| 1650 | Generate and install a npy-pkg config file from a template. |
| 1651 | |
| 1652 | The config file generated from `template` is installed in the |
| 1653 | given install directory, using `subst_dict` for variable substitution. |
| 1654 | |
| 1655 | Parameters |
| 1656 | ---------- |
| 1657 | template : str |
| 1658 | The path of the template, relatively to the current package path. |
| 1659 | install_dir : str |
| 1660 | Where to install the npy-pkg config file, relatively to the current |
| 1661 | package path. |
| 1662 | subst_dict : dict, optional |
| 1663 | If given, any string of the form ``@key@`` will be replaced by |
| 1664 | ``subst_dict[key]`` in the template file when installed. The install |
| 1665 | prefix is always available through the variable ``@prefix@``, since the |
| 1666 | install prefix is not easy to get reliably from setup.py. |
| 1667 | |
| 1668 | See also |
| 1669 | -------- |
| 1670 | add_installed_library, get_info |
| 1671 | |
| 1672 | Notes |
| 1673 | ----- |
| 1674 | This works for both standard installs and in-place builds, i.e. the |
| 1675 | ``@prefix@`` refer to the source directory for in-place builds. |
| 1676 | |
| 1677 | Examples |
| 1678 | -------- |
| 1679 | :: |
| 1680 | |
| 1681 | config.add_npy_pkg_config('foo.ini.in', 'lib', {'foo': bar}) |
| 1682 | |
| 1683 | Assuming the foo.ini.in file has the following content:: |
| 1684 | |
| 1685 | [meta] |
| 1686 | Name=@foo@ |
| 1687 | Version=1.0 |
| 1688 | Description=dummy description |
| 1689 | |
| 1690 | [default] |
| 1691 | Cflags=-I@prefix@/include |
| 1692 | Libs= |
| 1693 | |
| 1694 | The generated file will have the following content:: |
| 1695 | |
| 1696 | [meta] |
| 1697 | Name=bar |
| 1698 | Version=1.0 |
| 1699 | Description=dummy description |
| 1700 | |
| 1701 | [default] |
| 1702 | Cflags=-Iprefix_dir/include |
| 1703 | Libs= |
| 1704 | |
| 1705 | and will be installed as foo.ini in the 'lib' subpath. |