1. set ruff line-length to 100, reformat 18 files; 2. move pr34 version to pyproject.common.toml, read via toml in meson.build; 3. fix meson install_subdir to only include meson/toolchains, not entire meson/; 4. add meson:install:list command with --mode meson|pyproject for dry-run; 5. add .venv-whl-cache to .gitignore exceptions and .gitattributes lfs tracking; 6. release pr34 v0.1.5.66 .whl; 7. commit python/.venv-whl-cache and archlinux/.venv-whl-cache via lfs;
93 lines
1.9 KiB
Meson
93 lines
1.9 KiB
Meson
project(
|
|
run_command(
|
|
'.venv/bin/toml', 'get', '--toml-path', 'pyproject.toml', 'project.name',
|
|
check: true
|
|
).stdout().strip('\n'),
|
|
# 'online.fxreader.uv',
|
|
# ['c', 'cpp'],
|
|
version: run_command(
|
|
'.venv/bin/toml', 'get', '--toml-path', 'pyproject.toml', 'project.version',
|
|
check: true
|
|
).stdout().strip('\n'),
|
|
# default_options: [
|
|
# 'cpp_std=c++23',
|
|
# # 'prefer_static=true',
|
|
# ],
|
|
)
|
|
|
|
install_path = get_option('install_path')
|
|
message('install_path = ' + install_path)
|
|
|
|
modes = get_option('modes')
|
|
|
|
fs = import('fs')
|
|
|
|
assert(modes.length() == 1, 'only one mode allowed')
|
|
|
|
mode = modes[0]
|
|
|
|
|
|
project_root = '.'
|
|
source_dir = project_root
|
|
include_dir = project_root
|
|
|
|
|
|
if mode == 'meson'
|
|
# error()
|
|
endif
|
|
|
|
if mode == 'pyproject'
|
|
py = import('python').find_installation(pure: false)
|
|
|
|
namespace_path = meson.project_name().replace('.', '/')
|
|
|
|
install_root = py.get_install_dir(pure: true)
|
|
install_root_binary = py.get_install_dir(pure: false)
|
|
|
|
module_root = install_root / namespace_path
|
|
|
|
python_sources = run_command(
|
|
'find', namespace_path,
|
|
'-path', namespace_path / 'commands_typed' / 'archlinux', '-prune',
|
|
'-o', '-iname', '*.py', '-print',
|
|
check: true
|
|
).stdout().strip().split('\n')
|
|
|
|
py.install_sources(
|
|
python_sources,
|
|
preserve_path: true,
|
|
pure: true,
|
|
# subdir: namespace_path,
|
|
)
|
|
|
|
# install_subdir(
|
|
# namespace_path,
|
|
# install_dir: py.get_install_dir(),
|
|
# install_tag: 'python-runtime',
|
|
# # python_sources,
|
|
# # subdir: namespace_path,
|
|
# )
|
|
|
|
install_data(
|
|
files(
|
|
[
|
|
namespace_path / 'py.typed',
|
|
],
|
|
# 'py.typed',
|
|
# '__init__.py',
|
|
# 'pyproject.toml',
|
|
),
|
|
install_dir : install_root,
|
|
install_tag: 'python-runtime',
|
|
preserve_path: true,
|
|
)
|
|
#
|
|
install_subdir(
|
|
project_root / '..' / 'meson' / 'toolchains',
|
|
install_dir : module_root / 'meson',
|
|
strip_directory: false,
|
|
# install_tag: 'devel',
|
|
install_tag: 'devel',
|
|
)
|
|
endif
|