-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmeson.build
More file actions
56 lines (48 loc) · 1.93 KB
/
Copy pathmeson.build
File metadata and controls
56 lines (48 loc) · 1.93 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
project('gc_class',
version: '1.1',
meson_version: '>=1.3.0',
)
# Pure-Tcl module: gc_class is a single .tm file. No compiler needed.
# Meson's implicit 'c' language default is unused.
tcl_dep = dependency('tcl')
tclver_full = tcl_dep.version()
tclver_parts = tclver_full.split('.')
tclver_major = tclver_parts[0]
tm_install_dir = tcl_dep.get_variable('libdir') / 'tcl' + tclver_major / 'site-tcl'
master_tm_name = meson.project_name() + '-' + meson.project_version() + '.tm'
gc_class_tm = configure_file(
input: 'gc_class.tcl',
output: master_tm_name,
copy: true,
install: true,
install_dir: tm_install_dir,
install_tag: meson.is_subproject() ? 'deps' : 'runtime',
)
pc_conf = configuration_data()
pc_conf.set('PACKAGE_NAME', meson.project_name())
pc_conf.set('PACKAGE_VERSION', meson.project_version())
pc_conf.set('TCL_MAJOR', tclver_major)
configure_file(
input: meson.project_name() + '.pc.in',
output: meson.project_name() + '.pc',
configuration: pc_conf,
install: true,
install_dir: tcl_dep.get_variable('libdir') / 'pkgconfig',
install_tag: meson.is_subproject() ? 'deps' : 'runtime',
)
gc_class_dep = declare_dependency(
variables: {
'tcl_tm_path': meson.current_build_dir(),
'version': meson.project_version(),
},
)
meson.override_dependency(meson.project_name(), gc_class_dep)
# Devenv so `meson devenv -C <builddir> tclsh` picks up this package
# without having to install it. .tm modules are scanned via
# tcl::tm::path, which is populated from TCL<major>_<minor>_TM_PATH.
tclver_minor = tclver_parts[1].split('a')[0].split('b')[0].split('rc')[0]
tm_env_name = 'TCL' + tclver_major + '_' + tclver_minor + '_TM_PATH'
devenv = environment()
devenv.prepend(tm_env_name, meson.current_build_dir(), separator: ':')
meson.add_devenv(devenv)
# vim: foldmethod=marker foldmarker=<<<,>>> shiftwidth=2 expandtab