@@ -32,90 +32,28 @@ common_c_args = [
3232 ' -DLIBSYSTEMD_VERSION=' + libsystemd_dep.version(),
3333]
3434
35- # Build _journal extension module
36- python.extension_module(
37- ' _journal' ,
38- [' systemd/_journal.c' , ' systemd/pyutil.c' ],
39- dependencies : [libsystemd_dep],
40- c_args : common_c_args,
41- install : true ,
42- subdir : ' systemd' ,
43- )
44-
45- # Build _reader extension module
46- python.extension_module(
47- ' _reader' ,
48- [' systemd/_reader.c' , ' systemd/pyutil.c' , ' systemd/strv.c' ],
49- dependencies : [libsystemd_dep],
50- c_args : common_c_args,
51- install : true ,
52- subdir : ' systemd' ,
53- )
54-
55- # Build _daemon extension module
56- python.extension_module(
57- ' _daemon' ,
58- [' systemd/_daemon.c' , ' systemd/pyutil.c' , ' systemd/util.c' ],
59- dependencies : [libsystemd_dep],
60- c_args : common_c_args,
61- install : true ,
62- subdir : ' systemd' ,
63- )
64-
65- # Build id128 extension module
66- python.extension_module(
67- ' id128' ,
68- [' systemd/id128.c' , ' systemd/pyutil.c' ],
69- dependencies : [libsystemd_dep],
70- c_args : common_c_args,
71- install : true ,
72- subdir : ' systemd' ,
73- )
35+ subdir (' src' )
7436
75- # Build login extension module
76- python.extension_module(
77- ' login' ,
78- [' systemd/login.c' , ' systemd/pyutil.c' , ' systemd/strv.c' ],
79- dependencies : [libsystemd_dep],
80- c_args : common_c_args,
81- install : true ,
82- subdir : ' systemd' ,
83- )
84-
85- # Install Python modules (matching py_modules in setup.py)
86- python.install_sources(
87- ' systemd/__init__.py' ,
88- ' systemd/journal.py' ,
89- ' systemd/daemon.py' ,
90- subdir : ' systemd' ,
91- )
92-
93- # Install test modules
94- python.install_sources(
95- ' systemd/test/test_daemon.py' ,
96- ' systemd/test/test_journal.py' ,
97- ' systemd/test/test_login.py' ,
98- ' systemd/test/test_id128.py' ,
99- subdir : ' systemd/test' ,
37+ run_target (
38+ ' update-constants' ,
39+ command : [
40+ python,
41+ files (' update-constants.py' ),
42+ ' -i' , libsystemd_dep.get_variable (' includedir' ),
43+ ' -s' , meson .project_source_root() / ' systemd' ,
44+ ],
10045)
10146
10247# Run target to generate TAGS file for Emacs
10348run_target (
104- ' etags ' ,
105- command : [' etags ' , ' -R' , ' @SOURCE_ROOT@/systemd' ],
49+ ' ctags ' ,
50+ command : [' ctags ' , ' -R' , ' @SOURCE_ROOT@/systemd' ],
10651)
10752
108- # Use 'uv run' to ensure Sphinx and its dependencies are installed before being run.
109- uv_prog = find_program (' uv' )
110-
111- # The '--no-editable' option tells uv to install the systemd package so that Sphinx can import it and extract docstrings.
11253run_target (
11354 ' doc' ,
11455 command : [
115- uv_prog,
116- ' run' ,
117- ' --group' , ' docs' ,
118- ' --no-editable' ,
56+ python,
11957 ' -m' , ' sphinx' ,
12058 ' -b' , ' html' ,
12159 ' -D' , ' version=' + meson .project_version(),
@@ -125,14 +63,10 @@ run_target(
12563 ],
12664)
12765
128- # The '--no-editable' option tells uv to install the systemd package so tests can import it.
12966test (
13067 ' pytest' ,
131- uv_prog ,
68+ python ,
13269 args : [
133- ' run' ,
134- ' --group' , ' test' ,
135- ' --no-editable' ,
13670 ' -m' , ' pytest' ,
13771 ' ../systemd/test' ,
13872 ],
@@ -165,5 +99,5 @@ run_target(
16599# NOTE: Run 'sign' target before 'upload' to ensure the signature file exists.
166100run_target (
167101 ' upload' ,
168- command : [' uvx ' , ' twine' , ' upload' , archive, signature_filename],
102+ command : [python, ' -m ' , ' twine' , ' upload' , archive, signature_filename],
169103)
0 commit comments