Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[meson.build]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer this file to be added first, so that the meson file is not reformatted in the middle of the series.

indent_style = space
indent_size = 8
114 changes: 57 additions & 57 deletions meson.build
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
project(
'python-systemd',
'c',
version: '236',
license: 'LGPL-2.1-or-later',
default_options: ['warning_level=2', 'c_std=c99'],
'python-systemd',
'c',
version: '236',
license: 'LGPL-2.1-or-later',
default_options: ['warning_level=2', 'c_std=c99'],
)

# Dependencies
Expand All @@ -12,89 +12,89 @@ python_dep = python.dependency()

# Try to find libsystemd
foreach name : [
'libsystemd',
'libsystemd-journal',
'libsystemd-daemon',
'libsystemd-id128',
'libsystemd-login',
'libsystemd',
'libsystemd-journal',
'libsystemd-daemon',
'libsystemd-id128',
'libsystemd-login',
]
libsystemd_dep = dependency(name, required: false)
if libsystemd_dep.found()
break
endif
libsystemd_dep = dependency(name, required: false)
if libsystemd_dep.found()
break
endif
endforeach

# Common compile arguments matching setup.py
common_c_args = [
'-std=c99',
'-Werror=implicit-function-declaration',
'-DPACKAGE_VERSION="' + meson.project_version() + '"',
'-DLIBSYSTEMD_VERSION=' + libsystemd_dep.version(),
'-std=c99',
'-Werror=implicit-function-declaration',
'-DPACKAGE_VERSION="' + meson.project_version() + '"',
'-DLIBSYSTEMD_VERSION=' + libsystemd_dep.version(),
]

# Build _journal extension module
python.extension_module(
'_journal',
['systemd/_journal.c', 'systemd/pyutil.c'],
dependencies: [libsystemd_dep],
c_args: common_c_args,
install: true,
subdir: 'systemd',
'_journal',
['systemd/_journal.c', 'systemd/pyutil.c'],
dependencies: [libsystemd_dep],
c_args: common_c_args,
install: true,
subdir: 'systemd',
)

# Build _reader extension module
python.extension_module(
'_reader',
['systemd/_reader.c', 'systemd/pyutil.c', 'systemd/strv.c'],
dependencies: [libsystemd_dep],
c_args: common_c_args,
install: true,
subdir: 'systemd',
'_reader',
['systemd/_reader.c', 'systemd/pyutil.c', 'systemd/strv.c'],
dependencies: [libsystemd_dep],
c_args: common_c_args,
install: true,
subdir: 'systemd',
)

# Build _daemon extension module
python.extension_module(
'_daemon',
['systemd/_daemon.c', 'systemd/pyutil.c', 'systemd/util.c'],
dependencies: [libsystemd_dep],
c_args: common_c_args,
install: true,
subdir: 'systemd',
'_daemon',
['systemd/_daemon.c', 'systemd/pyutil.c', 'systemd/util.c'],
dependencies: [libsystemd_dep],
c_args: common_c_args,
install: true,
subdir: 'systemd',
)

# Build id128 extension module
python.extension_module(
'id128',
['systemd/id128.c', 'systemd/pyutil.c'],
dependencies: [libsystemd_dep],
c_args: common_c_args,
install: true,
subdir: 'systemd',
'id128',
['systemd/id128.c', 'systemd/pyutil.c'],
dependencies: [libsystemd_dep],
c_args: common_c_args,
install: true,
subdir: 'systemd',
)

# Build login extension module
python.extension_module(
'login',
['systemd/login.c', 'systemd/pyutil.c', 'systemd/strv.c'],
dependencies: [libsystemd_dep],
c_args: common_c_args,
install: true,
subdir: 'systemd',
'login',
['systemd/login.c', 'systemd/pyutil.c', 'systemd/strv.c'],
dependencies: [libsystemd_dep],
c_args: common_c_args,
install: true,
subdir: 'systemd',
)

# Install Python modules (matching py_modules in setup.py)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This commit removes setup.py, so the comment is immediately outdated.

python.install_sources(
'systemd/__init__.py',
'systemd/journal.py',
'systemd/daemon.py',
subdir: 'systemd',
'systemd/__init__.py',
'systemd/journal.py',
'systemd/daemon.py',
subdir: 'systemd',
)

# Install test modules
python.install_sources(
'systemd/test/test_daemon.py',
'systemd/test/test_journal.py',
'systemd/test/test_login.py',
'systemd/test/test_id128.py',
subdir: 'systemd/test',
'systemd/test/test_daemon.py',
'systemd/test/test_journal.py',
'systemd/test/test_login.py',
'systemd/test/test_id128.py',
subdir: 'systemd/test',
)