diff options
author | Eli Schwartz <eschwartz@archlinux.org> | 2022-04-03 01:34:21 -0400 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2022-04-09 14:20:31 +0300 |
commit | 7ceec99c55c8534f6c0ec287e0ca7092a8c29ef5 (patch) | |
tree | d06e91552225b348b7d8a2e8614fa561c2223941 | |
parent | e5aa47d8af917282794a8da3956ce444b8d8378d (diff) | |
download | meson-7ceec99c55c8534f6c0ec287e0ca7092a8c29ef5.zip meson-7ceec99c55c8534f6c0ec287e0ca7092a8c29ef5.tar.gz meson-7ceec99c55c8534f6c0ec287e0ca7092a8c29ef5.tar.bz2 |
packaging: make sure pyinstaller sees our distributed data files
Running pyinstaller to create a bundle, and using the resulting
`pyinst-tmp/meson/meson setup ...` with the cmake module revealed that
no data files were being bundled, unlike what we did for setup.cfg. Fix
this oversight.
Fixes #10163
-rw-r--r-- | packaging/hook-mesonbuild.py | 7 | ||||
-rw-r--r-- | setup.cfg | 1 |
2 files changed, 8 insertions, 0 deletions
diff --git a/packaging/hook-mesonbuild.py b/packaging/hook-mesonbuild.py index b5f09ef..b076c50 100644 --- a/packaging/hook-mesonbuild.py +++ b/packaging/hook-mesonbuild.py @@ -7,6 +7,9 @@ PyInstaller hook to make mesonbuild include everything it needs to. import os from glob import glob +from PyInstaller.utils.hooks import collect_data_files + +datas = [] hiddenimports = [] def get_all_modules_from_dir(dirname): @@ -18,6 +21,10 @@ def get_all_modules_from_dir(dirname): modules = ['mesonbuild.' + modname + '.' + x for x in modules if not x.startswith('_')] return modules +datas += collect_data_files('mesonbuild.scripts') +datas += collect_data_files('mesonbuild.cmake.data') +datas += collect_data_files('mesonbuild.dependencies.data') + hiddenimports += get_all_modules_from_dir('mesonbuild/modules') hiddenimports += get_all_modules_from_dir('mesonbuild/scripts') @@ -47,6 +47,7 @@ typing = mypy typing_extensions; python_version <"3.8" +# this must be synced with packaging/hook-mesonbuild.py [options.package_data] mesonbuild.scripts = cmd_or_ps.ps1 mesonbuild.cmake.data = * |