Skip to content

Commit 8640ebd

Browse files
committed
Fix subproject install, yajltcl bench dep
1 parent 6491aa4 commit 8640ebd

5 files changed

Lines changed: 23 additions & 13 deletions

File tree

claude/skills/rl_json/SKILL.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,8 +248,8 @@ set users {[]}
248248
db eval {SELECT name, email, active FROM users} {
249249
json set users end+1 [json template {
250250
{
251-
"name": "~S:name",
252-
"email": "~S:email",
251+
"name": "~S:name",
252+
"email": "~S:email",
253253
"active": "~B:active"
254254
}
255255
}]

generic/rl_json.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4138,7 +4138,7 @@ static int jsonNRObj(ClientData cdata, Tcl_Interp* interp, int objc, Tcl_Obj *co
41384138
};
41394139
int idx;
41404140

4141-
enum {A_cmd, A_KEY, A_objc};
4141+
enum {A_cmd=1, A_KEY, A_objc};
41424142
CHECK_ARGS("key");
41434143

41444144
TEST_OK(Tcl_GetIndexFromObjStruct(interp, objv[A_KEY], tstr, sizeof(struct teststring), "key", TCL_EXACT, &idx));

meson.build

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
project('rl_json', 'c',
2-
version: '0.17.1',
2+
version: '0.17.2',
33
default_options: ['c_std=c23,c2x,c17,c11','warning_level=3','werror=true'],
44
meson_version: '>=1.3.0',
55
)
@@ -31,15 +31,16 @@ tea_want_shims = [
3131
'Tcl_GetBytesFromObj',
3232
]
3333

34-
# Optional dependency to compare our performance against yajl-tcl's in the benchmarks
35-
yajl_tcl_sub = subproject('yajl-tcl', required: false)
36-
tea_bench_deps = yajl_tcl_sub.found() ? [yajl_tcl_sub.get_variable('yajltcl_mod')] : []
37-
3834
deps = []
3935
inc = []
4036

4137
subdir('teabase/init')
4238

39+
# Optional dependency to compare our performance against yajl-tcl's in the benchmarks
40+
yajl_tcl_sub = subproject('yajl-tcl', required: false)
41+
tea_bench_extra_depends = yajl_tcl_sub.found() ? [yajl_tcl_sub.get_variable('yajltcl_mod')] : []
42+
tea_bench_deps += yajl_tcl_sub.get_variable('yajl_tcl_dep')
43+
4344
# Feature detection (must come after teabase/init which provides tcl_dep) <<<
4445
conf.set10('HAVE___BUILTIN_FFSLL', cc.has_function('__builtin_ffsll'))
4546
conf.set10('HAVE_FFSLL', cc.has_function('ffsll', prefix: '#include <strings.h>'))
@@ -76,8 +77,9 @@ deps += declare_dependency(
7677
meson.project_build_root(),
7778
meson.project_source_root() / 'generic/rl_json.decls',
7879
],
79-
install: true,
80+
install: true,
8081
install_dir: [false, pkg_dir],
82+
install_tag: [false, meson.is_subproject() ? 'deps' : 'runtime'],
8183
),
8284
)
8385

@@ -116,6 +118,7 @@ inc += include_directories('.')
116118
install_data(
117119
'generic/rl_json.h',
118120
install_dir: pkg_dir,
121+
install_tag: meson.is_subproject() ? 'deps' : 'runtime',
119122
)
120123

121124
# teabase builds the shared module and generates config.h
@@ -128,6 +131,7 @@ stubs_lib = static_library(meson.project_name() + 'stub',
128131
include_directories: inc,
129132
install: true,
130133
install_dir: pkg_dir,
134+
install_tag: meson.is_subproject() ? 'deps' : 'runtime',
131135
)
132136

133137
# Generate relocatable pkg-config file for stub library
@@ -142,14 +146,14 @@ configure_file(
142146
configuration: pc_conf,
143147
install_dir: tcl_dep.get_variable('libdir') / 'pkgconfig',
144148
install: true,
149+
install_tag: meson.is_subproject() ? 'deps' : 'runtime',
145150
)
146151

147152
# Override-dependency for meson subproject consumers. Mirrors the
148153
# tcl_pkg_path variable shipped in the .pc file so that a downstream
149154
# `dependency('rl_json', fallback: ['rl_json', 'rl_json_dep']).get_variable('tcl_pkg_path')`
150155
# returns the right directory regardless of whether rl_json was found
151156
# via pkg-config or rebuilt from source as a subproject.
152-
fs = import('fs')
153157
rl_json_dep = declare_dependency(
154158
variables: {
155159
'tcl_pkg_path': fs.parent(pkg_so.full_path()),

subprojects/packagefiles/yajl-tcl/meson.build

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
project('yajltcl', 'c',
22
version: '1.8.1',
3-
meson_version: '>=0.64.0',
3+
meson_version: '>=1.3.0',
44
default_options: ['warning_level=1', 'werror=false'],
55
)
66

@@ -36,7 +36,13 @@ configure_file(input: 'pkgIndex.tcl.in', output: 'pkgIndex.tcl', configuration:
3636
configure_file(input: 'yajl.tcl', output: 'yajl.tcl', copy: true)
3737

3838
# Wrap fallback dependency
39-
yajl_tcl_dep = declare_dependency(dependencies: deps)
39+
yajl_tcl_dep = declare_dependency(
40+
dependencies: deps,
41+
variables: {
42+
'tcl_pkg_path': fs.parent(yajltcl_mod.full_path()),
43+
'version': meson.project_version(),
44+
},
45+
)
4046
meson.override_dependency('yajl-tcl', yajl_tcl_dep)
4147

4248
# Extend devenv so 'package require yajltcl' works during build

0 commit comments

Comments
 (0)