diff --git a/packaging/hook-mesonbuild.py b/packaging/hook-mesonbuild.py index b5f09effe..b076c506d 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') diff --git a/setup.cfg b/setup.cfg index b7d7c101f..4a0ffadbb 100644 --- a/setup.cfg +++ b/setup.cfg @@ -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 = *