[+] partially migrate pr34 to meson.build
1. add wasm toolchain for meson;
This commit is contained in:
		
							parent
							
								
									0a6e82b616
								
							
						
					
					
						commit
						0166dc4756
					
				
							
								
								
									
										13
									
								
								meson/toolchains/wasm-cross-meson.ini
									
									
									
									
									
										Normal file
									
								
							
							
								
								
								
								
								
									
									
								
							
						
						
									
										13
									
								
								meson/toolchains/wasm-cross-meson.ini
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,13 @@ | |||||||
|  | [binaries] | ||||||
|  | cpp = 'em++' | ||||||
|  | c = 'emcc' | ||||||
|  | ar = 'emar' | ||||||
|  | windres = '/usr/bin/false' | ||||||
|  | ; exe_wrapper = '/usr/bin/false' | ||||||
|  | exe_wrapper = 'node' | ||||||
|  | 
 | ||||||
|  | [host_machine] | ||||||
|  | system = 'linux' | ||||||
|  | cpu_family = 'x86_64' | ||||||
|  | cpu = 'x86_64' | ||||||
|  | endian = 'little' | ||||||
| @ -47,6 +47,7 @@ class CLI(_cli.CLI): | |||||||
|                 source_dir=self.settings.base_dir / 'python', |                 source_dir=self.settings.base_dir / 'python', | ||||||
|                 build_dir=self.settings.base_dir / 'tmp' / 'online' / 'fxreader' / 'pr34' / 'build', |                 build_dir=self.settings.base_dir / 'tmp' / 'online' / 'fxreader' / 'pr34' / 'build', | ||||||
|                 dest_dir=self.settings.base_dir / 'tmp' / 'online' / 'fxreader' / 'pr34' / 'install', |                 dest_dir=self.settings.base_dir / 'tmp' / 'online' / 'fxreader' / 'pr34' / 'install', | ||||||
|  |                 meson_path=self.settings.base_dir / 'python' / 'meson.build', | ||||||
|             ) |             ) | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|  | |||||||
							
								
								
									
										60
									
								
								python/meson.build
									
									
									
									
									
										Normal file
									
								
							
							
								
								
								
								
								
									
									
								
							
						
						
									
										60
									
								
								python/meson.build
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,60 @@ | |||||||
|  | project( | ||||||
|  | 	run_command( | ||||||
|  | 		'tomlq', '-r', '.project.name', 'pyproject.toml', | ||||||
|  | 		check: true | ||||||
|  | 	).stdout().strip('\n'), | ||||||
|  | # 	'online.fxreader.uv', | ||||||
|  | # 	['c', 'cpp'], | ||||||
|  | 	version: '0.1.5.16+27.7', | ||||||
|  | # 	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('.', '/') | ||||||
|  | 
 | ||||||
|  | 	module_root = py.get_install_dir() / namespace_path | ||||||
|  | 
 | ||||||
|  | 	py.install_sources( | ||||||
|  | 		[ | ||||||
|  | 			namespace_path, | ||||||
|  | 		], | ||||||
|  | 		subdir: namespace_path, | ||||||
|  | 	) | ||||||
|  | 
 | ||||||
|  | 	install_data( | ||||||
|  | 		files( | ||||||
|  | # 			'py.typed', | ||||||
|  | 			# '__init__.py', | ||||||
|  | # 			'pyproject.toml', | ||||||
|  | 			'py.typed', | ||||||
|  | 		), | ||||||
|  | 		install_dir : namespace_path, | ||||||
|  | 		install_tag: 'python-runtime', | ||||||
|  | 	) | ||||||
|  | endif | ||||||
| @ -1,6 +1,9 @@ | |||||||
| [project] | [project] | ||||||
| name = 'online.fxreader.pr34' | name = 'online.fxreader.pr34' | ||||||
| version = '0.1.5.16+27.7' | # version = '0.1.5.16+27.7' | ||||||
|  | dynamic = [ | ||||||
|  |     'version', | ||||||
|  | ] | ||||||
| 
 | 
 | ||||||
| dependencies = [ | dependencies = [ | ||||||
|     #"-r requirements.txt", |     #"-r requirements.txt", | ||||||
| @ -31,30 +34,8 @@ lint = [ | |||||||
| early_features = ['default', 'early', 'lint',] | early_features = ['default', 'early', 'lint',] | ||||||
| 
 | 
 | ||||||
| [build-system] | [build-system] | ||||||
| requires = ['setuptools'] | requires = ["meson-python", "pybind11"] | ||||||
| build-backend = 'setuptools.build_meta' | build-backend = "mesonpy" | ||||||
| 
 |  | ||||||
| [tool.setuptools] |  | ||||||
| include-package-data = false |  | ||||||
| 
 |  | ||||||
| [tool.setuptools.package-dir] |  | ||||||
| 'online.fxreader.pr34' = 'online/fxreader/pr34' |  | ||||||
| #package_dir = '..' |  | ||||||
| #packages = ['online_fxreader'] |  | ||||||
| #[tool.setuptools.packages.find] |  | ||||||
| #where = ['../..'] |  | ||||||
| #include = ['../../online_fxreader/vpn'] |  | ||||||
| #exclude =['../../aiortc/*', '../../_cffi_src/*'] |  | ||||||
| 
 |  | ||||||
| #[tool.setuptools.packages.find] |  | ||||||
| #exclude = ['*'] |  | ||||||
| #include = ['*.py'] |  | ||||||
| 
 |  | ||||||
| # [tool.setuptools.exclude-package-data] |  | ||||||
| # 'online.fxreader.pr34' = ['online/fxreader/pr34/py.typed'] |  | ||||||
| 
 |  | ||||||
| #[tool.setuptools.package-data] |  | ||||||
| #'online_fxreader.vpn' = ['requirements.txt'] |  | ||||||
| 
 | 
 | ||||||
| [project.scripts] | [project.scripts] | ||||||
| online-fxreader-pr34-commands = 'online.fxreader.pr34.commands:commands_cli' | online-fxreader-pr34-commands = 'online.fxreader.pr34.commands:commands_cli' | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user