From 9aaec8b2f0ce983f0274dae88df31f4c5c0c04b9 Mon Sep 17 00:00:00 2001 From: nirenjan Date: Wed, 22 Apr 2026 12:12:21 -0700 Subject: [PATCH] feat: Add Python paths module This will be used in future commits to enable Python support --- meson.build | 1 + python/meson.build | 15 +++++++++++++++ python/paths.py.in | 7 +++++++ 3 files changed, 23 insertions(+) create mode 100644 python/meson.build create mode 100644 python/paths.py.in diff --git a/meson.build b/meson.build index 9202901..998cfb2 100644 --- a/meson.build +++ b/meson.build @@ -102,6 +102,7 @@ dep_inih = dependency('inih') includes = include_directories('include') subdir('include') +subdir('python') subdir('libx52') subdir('libx52io') subdir('libx52util') diff --git a/python/meson.build b/python/meson.build new file mode 100644 index 0000000..7f7b3c0 --- /dev/null +++ b/python/meson.build @@ -0,0 +1,15 @@ +# Generate the paths module so that the Python scripts work +# exactly the same as the C code. + +path_data = configuration_data() +path_data.set('PREFIX', get_option('prefix')) +path_data.set('SYSCONFDIR', get_option('prefix') / get_option('sysconfdir')) +path_data.set('LOCALSTATEDIR', get_option('prefix') / get_option('localstatedir')) +path_data.set('DATADIR', get_option('prefix') / get_option('datadir')) +path_data.set('SOCK_PATH', get_option('prefix') / get_option('localstatedir') / 'run' / 'x52d' / 'x52d.cmd') + +path_data_py = configure_file( + input: 'paths.py.in', + output: 'paths.py', + configuration: path_data +) diff --git a/python/paths.py.in b/python/paths.py.in new file mode 100644 index 0000000..19272e3 --- /dev/null +++ b/python/paths.py.in @@ -0,0 +1,7 @@ +"""System paths defined at build time""" + +PREFIX = "@PREFIX@" +SYSCONFDIR = "@SYSCONFDIR@" +LOCALSTATEDIR = "@LOCALSTATEDIR@" +DATADIR = "@DATADIR@" +SOCK_PATH = "@SOCK_PATH@"