aboutsummaryrefslogtreecommitdiff
path: root/packaging
diff options
context:
space:
mode:
authorEli Schwartz <eschwartz@archlinux.org>2022-04-03 01:34:21 -0400
committerJussi Pakkanen <jpakkane@gmail.com>2022-04-09 14:20:31 +0300
commit7ceec99c55c8534f6c0ec287e0ca7092a8c29ef5 (patch)
treed06e91552225b348b7d8a2e8614fa561c2223941 /packaging
parente5aa47d8af917282794a8da3956ce444b8d8378d (diff)
downloadmeson-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
Diffstat (limited to 'packaging')
-rw-r--r--packaging/hook-mesonbuild.py7
1 files changed, 7 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')